Python SDK for Boiler API - A GraphQL-based SDK for quick API integrations
Project description
Timecampus Sdk-python
A Python SDK timecampus for building GraphQL-based API clients quickly. This SDK provides a structured foundation for creating Python SDKs that interact with GraphQL APIs, similar to the Node.js workspace SDK but adapted for Python.
Features
- ๐ Async/await support - Built with modern Python async patterns
- ๐ Authentication handling - Token management and refresh logic
- ๐ฆ Modular architecture - Organized by feature modules
- ๐ง Type hints - Full typing support with mypy
- ๐งช Testing ready - Pytest configuration included
- ๐ Documentation - Sphinx-ready documentation setup
- ๐ ๏ธ Development tools - Code formatting, linting, and pre-commit hooks
Installation
# Install from PyPI (when published)
pip install timecampus-sdk
# Or install in development mode
pip install -e .
# Install with development dependencies
pip install -e ".[dev]"
Quick Start
import asyncio
from boiler_sdk import BoilerSDK, BoilerSDKConfig
from boiler_sdk.types.common import UserRegisterInput
async def main():
# Initialize the SDK
config = BoilerSDKConfig(
endpoint="https://api.example.com/graphql",
api_key="your-api-key" # Optional
)
sdk = BoilerSDK(config)
try:
# Register a new user
user_input = UserRegisterInput(
email="user@example.com",
name="John Doe",
password="secure_password"
)
user = await sdk.auth.register(user_input)
print(f"User registered: {user.name}")
# Set authentication tokens
sdk.set_tokens(
access_token="your-access-token",
refresh_token="your-refresh-token"
)
# Get current user
current_user = await sdk.users.get_current_user()
print(f"Current user: {current_user.name}")
finally:
await sdk.client.close()
# Run the example
asyncio.run(main())
Configuration
The SDK is configured using the BoilerSDKConfig class:
from boiler_sdk import BoilerSDKConfig
config = BoilerSDKConfig(
endpoint="https://api.example.com/graphql", # Required
api_key="your-api-key", # Optional
access_token="your-access-token", # Optional
refresh_token="your-refresh-token", # Optional
timeout=30.0 # Optional, default: 30.0
)
Available Modules
The SDK is organized into the following modules:
- auth - Authentication operations (register, login, logout, etc.)
- user - User management operations
- workspace - Workspace operations (TODO)
- rbac - Role-based access control (TODO)
- team - Team management (TODO)
- project - Project operations (TODO)
- resources - Resource management (TODO)
- billing - Billing operations (TODO)
- organization - Organization management (TODO)
- payment - Payment processing (TODO)
- quota - Quota management (TODO)
- store - Store operations (TODO)
- support - Support ticket management (TODO)
- usage - Usage analytics (TODO)
- utils - Utility functions (TODO)
- addon - Add-on management (TODO)
- plan - Plan management (TODO)
- product - Product management (TODO)
- config - Configuration management (TODO)
Examples
See the examples/ directory for more detailed usage examples:
basic_usage.py- Basic SDK operationsadvanced_usage.py- Advanced features and error handling
Development
Setup Development Environment
# Clone the repository
git clone <repository-url>
cd timecampus-sdk-python
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Code Quality
The project uses several tools for code quality:
# Format code
black src/ tests/ examples/
isort src/ tests/ examples/
# Lint code
flake8 src/ tests/ examples/
mypy src/
# Run tests
pytest
# Run tests with coverage
pytest --cov=boiler_sdk --cov-report=html
Testing
# Run all tests
pytest
# Run specific test file
pytest tests/test_auth.py
# Run with coverage
pytest --cov=boiler_sdk
# Run only unit tests
pytest -m unit
# Run only integration tests
pytest -m integration
Project Structure
timecampus-sdk-python/
โโโ src/
โ โโโ boiler_sdk/
โ โโโ __init__.py # Main SDK class
โ โโโ client/ # HTTP/GraphQL client
โ โโโ auth/ # Authentication module
โ โโโ user/ # User management
โ โโโ workspace/ # Workspace operations
โ โโโ types/ # Type definitions
โ โโโ ... # Other modules
โโโ tests/ # Test files
โโโ examples/ # Usage examples
โโโ docs/ # Documentation
โโโ pyproject.toml # Package configuration
โโโ requirements.txt # Production dependencies
โโโ requirements-dev.txt # Development dependencies
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run the test suite:
pytest - Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Create a Pull Request
Type Hints
This SDK is fully typed and supports mypy type checking:
mypy src/boiler_sdk
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
See CHANGELOG.md for version history and changes.
Support
- ๐ Documentation: docs.algoshred.com/sdk/python
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
Related Projects
- Workspaces SDK Node.js - The Node.js version this SDK is based on
- Boiler Frontend - Frontend timecampus
- Boiler Backend - Python GraphQL backend timecampus
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 timecampus_sdk-0.1.1a20251023084133.tar.gz.
File metadata
- Download URL: timecampus_sdk-0.1.1a20251023084133.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f1a8b7e82f73f0bef75f67288a67166f5a153b8e2a488b9654c282bc2598d7b
|
|
| MD5 |
2526fdb8cb48813e356e43896a4505d4
|
|
| BLAKE2b-256 |
4ad4801c73576cbaabb03db296561bc0f4ecad5f3623abb2516e03e02eb75270
|
File details
Details for the file timecampus_sdk-0.1.1a20251023084133-py3-none-any.whl.
File metadata
- Download URL: timecampus_sdk-0.1.1a20251023084133-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c413314f11aa62fd3a25dcf36b9ad7f3e1b908452f7dadf1df7f6ea18b464ad
|
|
| MD5 |
96147b83bc8ac50a77a585d52c0ace93
|
|
| BLAKE2b-256 |
44c40da531d8cb4f664529cca68fbdd80e5798d11965eda9d2fbf5d682325929
|