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.5.0.tar.gz
(14.7 kB
view hashes)
Built Distribution
pycircleci-0.5.0-py3-none-any.whl
(14.7 kB
view hashes)
Close
Hashes for pycircleci-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7bb37ef56c3e49d51baaf5f7225054a799a947825f18426cda1cf8c39e23f76 |
|
MD5 | a1dea2141a6a4ca713eacf23051ac5f9 |
|
BLAKE2b-256 | 96cbb32c65ceecf6794cceaa65af2f49f4f865a31243f2974dbf1939d00d8aed |