Skip to main content

Python client for the Drone CI public API

Project description

PyDroneio Build Status

Python client for the Drone CI public remote api built using the popular python requests library.

Installation

Ensure you have a working installation of Python 3.x on your system.
Clone the repository and run the setup script provided.

$ git clone https://github.com/tinvaan/PyDroneio.git
$ cd PyDroneio
$ python setup.py install

Environment

Ensure you have the DRONE_TOKEN and optionally, the DRONE_SERVER environment variables setup correctly.

$ export DRONE_SERVER="https://cloud.drone.io"
$ export DRONE_TOKEN="<your Drone CI access token>

Usage examples

Fetch all linked repos

>>> from drone import drone
>>> client = drone('tinvaan', 'packager')
>>> client.repos.all()
[{'id': 799963,
  'uid': '45485693',
  'user_id': 0,
  'namespace': 'tinvaan',
  'name': 'Algorithms',
  'slug': 'tinvaan/Algorithms',
    ...
    ...
  'version': 1},

    ...
    ...
    ...

 {'id': 7993143,
  'uid': '1897133997',
  'user_id': 0,
  'namespace': 'tinvaan',
  'name': 'zeit-logdna',
  'slug': 'tinvaan/zeit-logdna',
    ...
    ...
  'version': 1}]

Add a new secret

>>> secret = {
        'name': 'testsecret',
        'data': 'mysecretvalue',
        'pull_request': False
   }
>>> client.secret.create(**secret)
{'id': 55114, 'repo_id': 7134978, 'name': 'testsecret'}

Fetch all builds for a repository

>>> client.build.all()
[{'id': 342416, ... 'version': 3},
 {'id': 342400, ... 'version': 3},
 {'id': 341144, ... 'version': 3}]

Contribute

If you notice any issues, bugs or missing features in this project, please feel free to open tickets(github issues) or pull requests for the same.

If you would like to contribute code, check out the open issues and if you need help getting started, shoot a mail to harishnavnit@gmail.com

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

drone-python-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drone_python-1.0.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file drone-python-1.0.0.tar.gz.

File metadata

  • Download URL: drone-python-1.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for drone-python-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e7da4224f09f0b69f9dc2638c630cfede58d94f66b3ded2e75f0026bece891f0
MD5 af9f1380b91312b02ccf791779bf6324
BLAKE2b-256 7b7eeb690fc8c4b8f71107684acdf9fba625f8e5749163d55d293bff93a311e7

See more details on using hashes here.

File details

Details for the file drone_python-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: drone_python-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for drone_python-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c3a6717ed2613a7e203507ca7f1e7f8ce1aebd61806e0cdb7f24e672c698bc5
MD5 94b7cd72094a5bea4c7992d15c3026f3
BLAKE2b-256 4988100975e3832dd98398547eafe8f7119bf4dc51aab418a49ac1731e5b1b38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page