Python client for CircleCI API
Project description
pycircleci
Python client for CircleCI API.
Based on the discontinued circleci.py project.
Features
- Supports API v1.1 and API v2
- Supports both
circleci.com
and self-hosted Enterprise CircleCI
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)
# get current user info
circle_client.get_user_info()
# get list of projects
results = circle_client.get_projects()
# pretty print results as json
circle_client.ppj(results)
# pretty print the details of the last request/response
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 thepytest
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycircleci-0.6.0.tar.gz
(15.4 kB
view hashes)
Built Distribution
pycircleci-0.6.0-py3-none-any.whl
(15.3 kB
view hashes)
Close
Hashes for pycircleci-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11dd4fcb8e7693a58660fa88b018dd34b15a267394f81ba0d2d8c1766a5cb4b7 |
|
MD5 | 894464f2360e5451ec8847bf3d417084 |
|
BLAKE2b-256 | 3149e1624ba8909c9b330c4f7b48199320a94ca71377e2ee15ac518d55ab8568 |