Skip to main content

Cirun Python Client

Project description

cirun-py

Cirun logo

Python Client and CLI for the Cirun Platform

PyPI - Version Conda Downloads PyPI - Python Version Conda Recipe License Documentation

🚀 Overview

cirun-py is a Python client and command-line interface for the Cirun platform, enabling seamless management of your CI/CD infrastructure. Whether you're managing repositories, or connecting cloud providers, cirun-py makes it simple with both a programmatic API and intuitive CLI.

✨ Features

  • Dual Interface: Use as both a Python client library and CLI tool
  • Repository Management: Easily activate, deactivate, and list repositories
  • Cloud Provider Integration: Connect AWS, Azure, GCP, and other cloud providers
  • Elegant API: Clean, Pythonic interface for all Cirun operations
  • Rich Output Formatting: Beautiful CLI output for better readability

📦 Installation

Using pip (Recommended)

pip install cirun

Using conda

conda install -c conda-forge cirun

From Source

git clone https://github.com/cirun-io/cirun-py
cd cirun-py
pip install -e .

🏃‍♂️ Quick Start

  1. Get your API key from the Cirun dashboard
  2. Set your API key as an environment variable:
export CIRUN_API_KEY=<your-api-key>
  1. Start using cirun-py!

🧰 Usage

CLI Examples

Repository Management

# List active repositories
cirun repo list

# Activate a repository
cirun repo add username/repo-name

# Deactivate a repository
cirun repo remove username/repo-name

Cloud Provider Integration

# Connect AWS
cirun cloud connect aws --access-key AKIXXXXXXXXX --secret-key KFCF3yi+df0n12345678AMASDFGHJ

# Connect Azure
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

# Or create Azure credentials automatically and connect in one step
# (requires Azure CLI to be installed and logged in)
cirun cloud create azure --auto-connect

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

Python Client Examples

from cirun import Cirun

# Initialize client (pass token or set CIRUN_API_KEY environment variable)
cirun_client = Cirun(token='cirun-4cabcdbf-275c-4500-890d-712340663ddc')

# List all repositories
repos = cirun_client.get_repos()
print(repos)

# Activate a repository
cirun_client.set_repo('username/repo-name', active=True)

# Deactivate a repository
cirun_client.set_repo('username/repo-name', active=False)

⚙️ Configuration

Environment Variables

Variable Description Default
CIRUN_API_KEY API key for authentication (Required)
CIRUN_API_ENDPOINT Base URL for Cirun API https://api.cirun.io/api/v1

📚 Documentation

For comprehensive documentation, visit:

🔍 Troubleshooting

Common Issues

  • Authentication Errors: Ensure your API key is correctly set
  • Connection Issues: Check your network connection to api.cirun.io
  • Permission Problems: Verify you have the required permissions for the operation

💬 Support

Get help from our team and community:

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

We welcome contributions! Here's how:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

🔄 Related Projects

  • cirun-agent: Rust agent for on-premise runner provisioning
  • cirun-docs: Documentation for the Cirun platform

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.31.tar.gz (203.8 kB view details)

Uploaded Source

Built Distribution

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

cirun-0.31-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cirun-0.31.tar.gz
Algorithm Hash digest
SHA256 fe6199a1a889697fe6864b4d904e851273717367b9872cfa3d865dec8a2768d4
MD5 f04c10156d09c823aba4904c95a381f7
BLAKE2b-256 7a1e02a26e447588f678a7effd2e29c17331ae8874504f234c28522a65bc9191

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cirun-0.31-py3-none-any.whl
Algorithm Hash digest
SHA256 4dfd56fc7117058970017e29e2552aeb0578ae3a54f09a5d6fcdac96d9592f2f
MD5 a9b2c36c7e54652427b5752f28a887ac
BLAKE2b-256 57671f6f3e54aba3b912c710ea62542265e0a20aabaab086f032b268527cb66f

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