pycircleci
Python client for CircleCI API.
Based on the discontinued circleci.py project.
Features
Installation
$ pip install pycircleci
Usage
Create a personal API token.
Set up the expected env vars:
CIRCLE_TOKEN # CircleCI API access token
CIRCLE_API_URL # CircleCI API base url. Defaults to https://circleci.com/api
from pycircleci.api import Api, CIRCLE_TOKEN, CIRCLE_API_URL
circle_client = Api(token=CIRCLE_TOKEN, url=CIRCLE_API_URL)
circle_client.get_user_info()
results = circle_client.get_projects()
circle_client.ppj(results)
circle_client.ppr()
Interactive development console
make console
This starts a pre-configured python interactive console which gives you access to a
client
object - an instance of the Api
class to play around. From the console
type man()
to see the help screen.
Contributing
- Fork it
- Install dev dependencies (
pip install -r requirements-dev.txt
) - Create your feature branch (
git checkout -b my-new-feature
) - Make sure
flake8
and the pytest
test suite successfully run locally - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request