All Projects → pyasi → pybuildkite

pyasi / pybuildkite

Licence: BSD-2-Clause license
A Python library for the Buildkite API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pybuildkite

on-demand
CloudFormation resources for scheduling On-Demand Buildkite Agents with AWS ECS and AWS Fargate
Stars: ✭ 19 (-34.48%)
Mutual labels:  continuous-integration, buildkite
gitea-buildkite-connector
Connect Gitea & Buildkite
Stars: ✭ 16 (-44.83%)
Mutual labels:  continuous-integration, buildkite
pjbank-js-sdk
PJBank SDK para Javascript! ⚡ ⚡ ⚡
Stars: ✭ 24 (-17.24%)
Mutual labels:  api-wrapper
bitflyer
⚡ bitFlyer API wrapper for Ruby
Stars: ✭ 25 (-13.79%)
Mutual labels:  api-wrapper
ZmopSharp
ZMOP (芝麻信用开放平台) SDK for .NET
Stars: ✭ 11 (-62.07%)
Mutual labels:  api-wrapper
valorant.py
Complete Python interface for the Valorant API. Works right out of the box!
Stars: ✭ 84 (+189.66%)
Mutual labels:  api-wrapper
docker-ansible
Alpine-based multistage-build version of Ansible for reproducible usage in CI
Stars: ✭ 168 (+479.31%)
Mutual labels:  continuous-integration
compile-sketches
GitHub Actions action that checks whether Arduino sketches compile and produces a report of data from the compilations
Stars: ✭ 35 (+20.69%)
Mutual labels:  continuous-integration
software-factory
The ready to use Continuous Integration platform
Stars: ✭ 17 (-41.38%)
Mutual labels:  continuous-integration
article-downloader
Uses publisher APIs to programmatically retrieve scientific journal articles for text mining.
Stars: ✭ 81 (+179.31%)
Mutual labels:  api-wrapper
py-vkontakte
A Python wrapper around the vk.com
Stars: ✭ 17 (-41.38%)
Mutual labels:  api-wrapper
bookops-worldcat
BookOps WorldCat Metadata API wrapper
Stars: ✭ 21 (-27.59%)
Mutual labels:  api-wrapper
cf-mailchimp
ColdFusion wrapper for the MailChimp 3.0 API
Stars: ✭ 17 (-41.38%)
Mutual labels:  api-wrapper
Caraya
Assertion and unit test framework for LabVIEW
Stars: ✭ 45 (+55.17%)
Mutual labels:  continuous-integration
maestro
Faster CI/CD for multi-artifact projects
Stars: ✭ 13 (-55.17%)
Mutual labels:  continuous-integration
tatsumaki.js
A api wrapper for the Tatsumaki Discord Bot API
Stars: ✭ 9 (-68.97%)
Mutual labels:  api-wrapper
HaxeCI
An example of using CI for Haxe projects.
Stars: ✭ 45 (+55.17%)
Mutual labels:  continuous-integration
arduino-ci-script
Bash script for continuous integration of Arduino projects
Stars: ✭ 25 (-13.79%)
Mutual labels:  continuous-integration
travis-ci-latex-pdf
Overview of different methods to build LaTeX with GitHub Actions or Travis-CI (idea by @jackolney but completely rewritten by @PHPirates and contributors).
Stars: ✭ 113 (+289.66%)
Mutual labels:  continuous-integration
jokeapi
Official golang wrapper for Sv443's jokeapi.
Stars: ✭ 19 (-34.48%)
Mutual labels:  api-wrapper

PyBuildkite

Build status Coverage Status PyPI most recent version PyPI downloads

A Python library and client for the Buildkite API.

Usage

To get the package, execute:

pip install pybuildkite

Then set up an instance of the Buildkite object, set you access token, and make any available requests.

from pybuildkite.buildkite import Buildkite, BuildState

buildkite = Buildkite()
buildkite.set_access_token('YOUR_API_ACCESS_TOKEN_HERE')

# Get all info about particular org
org = buildkite.organizations().get_org('my-org')

# Get all running and scheduled builds for a particular pipeline
builds = buildkite.builds().list_all_for_pipeline('my-org', 'my-pipeline', states=[BuildState.RUNNING, BuildState.SCHEDULED])

# Create a build
buildkite.builds().create_build('my-org', 'my-pipeline', 'COMMITSHA', 'master', 
clean_checkout=True, message="My First Build!")

Pagination

Buildkite offers pagination for endpoints that return a lot of data. By default this wrapper return 100 objects. However, any request that may contain more than that offers a pagination option.

When with_pagination=True, we return a response object with properties that may have next_page, last_page, previous_page, or first_page depending on what page you're on.

builds_response = buildkite.builds().list_all(page=1, with_pagination=True)

# Keep looping until next_page is not populated
while builds_response.next_page:
    builds_response = buildkite.builds().list_all(page=builds_response.next_page, with_pagination=True)

Artifacts

Artifacts can be downloaded as binary data. The following example loads the artifact into memory as Python bytes and then writes them to disc:

artifacts = buildkite.artifacts()
artifact = artifacts.download_artifact("org_slug", "pipe_slug", "build_no", 123, "artifact")
with open('artifact.bin', 'b') as f:
  f.write(artifact)

Large artifacts should be streamed as chunks of bytes to limit the memory consumption:

stream = artifacts.download_artifact("org_slug", "pipe_slug", "build_no", 123, "artifact", as_stream=True)
with open('artifact.bin', 'b') as f:
  for chunk in stream:
    f.write(chunk)

A unicode text artifact can be turned into a string easily:

text = str(artifact)

License

This library is distributed under the BSD-style license found in the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].