Skip to main content

Python client for CircleCI API

Project description

circleclient

https://travis-ci.org/qba73/circleclient.svg?branch=master

Python client library for CircleCI API.

Features

  • Retrieving information about user
  • Listing followed repositories
  • Starting build
  • Cancelling build
  • Retrying build

Usage

Retrieve information about User

import os
import circleclient


token = os.environ['API_TOKEN']
client = circleclient.CircleClient(api_token=token)

# Retrieve User data
info = client.user.get_info()
print(info)

List projects followed by the user

import os
import circleclient


token = os.environ['API_TOKEN']
client = circleclient.CircleClient(api_token=token)

# Retrieve information about projects
projects = client.projects.list_projects()
print(projects)

Trigger new build in CircleCI

import os
import circleclient

token = os.environ['API_TOKEN']
client = circleclient.CircleClient(api_token=token)

# Trigger build
client.build.triger_new(username='<your_username>', project='<your_project>', branch='<branch>')

Cancel running build

import os
import circleclient

token = os.environ['API_TOKEN']
client = circleclient.CircleClient(api_token=token)

# Cancel build
client.build.cancel(username='<your_username>', project='<your_project>', build_num=<build_number>)

Retry build

import os
import circleclient

token = os.environ['API_TOKEN']
client = circleclient.CircleClient(api_token=token)

# Rerty build
client.build.retry(username='<your_username>', project='<your_project>', build_num=<build_number>)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for circleclient, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size circleclient-0.1.1.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page