Skip to main content

Cirun Python Client

Project description

Cirun Python Client and CLI

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install cirun

or via conda-forge

conda install -c conda-forge cirun

Usage

cirun-py can be used as a CLI as well as a Python client programmatically.

  • Create an API key from the Cirun Dashboard https://cirun.io/admin/api
  • Set that API Key as an environment variable named CIRUN_API_KEY
export CIRUN_API_KEY=<your-api-key>

CLI

  • List active repositories for Cirun
$ cirun repo list
──────────────────────────────────────────────────────────────────────────────────────────────────────────
{
  "repos": [
    {
      "repository": "aktech/cirun-openstack-example",
      "active": true,
      "private": false
    },
    {
      "repository": "aktechlabs/cirun-demo",
      "active": true,
      "private": true
    }
  ]
}
──────────────────────────────────────────────────────────────────────────────────────────────────────────
  • Active (add) a repository
$ cirun repo add aktech/sympy
──────────────────────────────────────────────────────────────────────────────────────────────────────────
{
  "name": "aktech/sympy",
  "active": true
}
──────────────────────────────────────────────────────────────────────────────────────────────────────────
  • Deactivate (remove) a repository
$ cirun repo remove aktech/sympy
──────────────────────────────────────────────────────────────────────────────────────────────────────────
{
  "name": "aktech/sympy",
  "active": false
}
──────────────────────────────────────────────────────────────────────────────────────────────────────────
  • Connect cloud provider with Cirun
cirun cloud connect aws --access-key AKIXXXXXXXXX --secret-key KFCF3yi+df0n12345678AMASDFGHJ

cirun cloud connect azure \
  --subscription-id 31184337-0346-4782-ae59-eb185fd0cfa1 \
  --tenant-id a66e466d-698b-4a91-b9e3-949f9cc04f11 \
  --client-id 340d01fc-ba24-43ee-844e-d364899d29e7 \
  --client-secret KFCF3yi+df0cirunIsAwesomeIsntIt?n1DFGHJ

cirun cloud connect gcp --key-file /path/to/service-account-key.json

Client

from cirun import Cirun
# Create cirun client object
# Pass the token or set `CIRUN_API_KEY` environment variable
c = Cirun(token='cirun-4cabcdbf-275c-4500-890d-712340663ddc')

# List repositories
c.get_repos()

# Active (add) a repository
c.set_repo('aktech/sympy', active=True)

# Deactivate (remove) a repository
c.set_repo('aktech/sympy', active=False)

License

cirun is distributed under the terms of the MIT license.

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

cirun-0.23.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

cirun-0.23-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file cirun-0.23.tar.gz.

File metadata

  • Download URL: cirun-0.23.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.1

File hashes

Hashes for cirun-0.23.tar.gz
Algorithm Hash digest
SHA256 f200bb78af36f11417f0f857a5d041fb2bcd1c0a519ae503359ff4e87df7aab7
MD5 c8de3e3b4de30a90cc07821166bd45b7
BLAKE2b-256 c95a77574b66ec6a9d77842d974e8233a1361d167e783f303dbcaaeeda36b932

See more details on using hashes here.

File details

Details for the file cirun-0.23-py3-none-any.whl.

File metadata

  • Download URL: cirun-0.23-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.24.1

File hashes

Hashes for cirun-0.23-py3-none-any.whl
Algorithm Hash digest
SHA256 7db6a5d072d6482f8334b9696ea115e86886449b9b27c98ca08a505d822aa307
MD5 f4ec28d31641e9f5ad3753c1ccfeb797
BLAKE2b-256 9e197693b4575914b56b571b8c697caa38226244c1e2eedb5c6e1689e3500c1d

See more details on using hashes here.

Supported by

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