项目作者: alpinweis

项目描述 :
Python client for CircleCI API
高级语言: Python
项目地址: git://github.com/alpinweis/pycircleci.git
创建时间: 2020-02-18T07:51:56Z
项目社区:https://github.com/alpinweis/pycircleci

开源协议:MIT License

下载


pycircleci

PyPI version
Build Status

Python client for CircleCI API.

Based on the discontinued circleci.py project.

Features

Installation

  1. $ pip install pycircleci

Usage

Create a personal API token.

Set up the expected env vars:

  1. CIRCLE_TOKEN # CircleCI API access token
  2. CIRCLE_API_URL # CircleCI API base url. Defaults to https://circleci.com/api
  1. from pycircleci.api import Api, CIRCLE_TOKEN, CIRCLE_API_URL
  2. circle_client = Api(token=CIRCLE_TOKEN, url=CIRCLE_API_URL)
  3. # get current user info
  4. circle_client.get_user_info()
  5. # get list of projects
  6. results = circle_client.get_projects()
  7. # pretty print results as json
  8. circle_client.ppj(results)
  9. # pretty print the details of the last request/response
  10. circle_client.ppr()

Interactive development console

  1. 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

  1. Fork it
  2. Install dev dependencies (pip install -r requirements-dev.txt)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Make sure flake8 and the pytest test suite successfully run locally
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request