Cirun Python Client
Project description
cirun-py
🚀 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
- Get your API key from the Cirun dashboard
- Set your API key as an environment variable:
export CIRUN_API_KEY=<your-api-key>
- 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:
- Slack: Join our community
- Email: support@cirun.io
- GitHub Issues: Report bugs
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
We welcome contributions! Here's how:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
🔄 Related Projects
- cirun-agent: Rust agent for on-premise runner provisioning
- cirun-docs: Documentation for the Cirun platform
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe6199a1a889697fe6864b4d904e851273717367b9872cfa3d865dec8a2768d4
|
|
| MD5 |
f04c10156d09c823aba4904c95a381f7
|
|
| BLAKE2b-256 |
7a1e02a26e447588f678a7effd2e29c17331ae8874504f234c28522a65bc9191
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dfd56fc7117058970017e29e2552aeb0578ae3a54f09a5d6fcdac96d9592f2f
|
|
| MD5 |
a9b2c36c7e54652427b5752f28a887ac
|
|
| BLAKE2b-256 |
57671f6f3e54aba3b912c710ea62542265e0a20aabaab086f032b268527cb66f
|