Python client for CircleCI API
Project description
circleclient
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>')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
circleclient-0.1.2.tar.gz
(3.7 kB
view hashes)