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

  • Retrieve information about user
  • List followed repositories
  • Start build
  • Cancel build
  • Retry build
  • Clear build cache

Installation

pip install circleclient

Usage

Retrieve information about User

import os
import circleclient


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

# Retrieve User data
client.user.get_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
client.projects.list_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>)

Clear build cache

import os
import circleclient

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

# Clear build cache
client.cache.clear(username='<your_username>', project='<your_project>')

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.2
Filename, size File type Python version Upload date Hashes
Filename, size circleclient-0.1.2.tar.gz (3.7 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