Skip to main content

Python SDK for Vibecontrols API - A GraphQL-based SDK for quick API integrations

Project description

Vibecontrols Sdk-python

A Python SDK vibecontrols 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 vibecontrols-sdk

# Or install in development mode
pip install -e .

# Install with development dependencies
pip install -e ".[dev]"

Quick Start

import asyncio
from vibecontrols_sdk import VibecontrolsSDK, VibecontrolsSDKConfig
from vibecontrols_sdk.types.common import UserRegisterInput

async def main():
    # Initialize the SDK
    config = VibecontrolsSDKConfig(
        endpoint="https://api.example.com/graphql",
        api_key="your-api-key"  # Optional
    )
    
    sdk = VibecontrolsSDK(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 VibecontrolsSDKConfig class:

from vibecontrols_sdk import VibecontrolsSDKConfig

config = VibecontrolsSDKConfig(
    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 operations
  • advanced_usage.py - Advanced features and error handling

Development

Setup Development Environment

# Clone the repository
git clone <repository-url>
cd vibecontrols-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=vibecontrols_sdk --cov-report=html

Testing

# Run all tests
pytest

# Run specific test file
pytest tests/test_auth.py

# Run with coverage
pytest --cov=vibecontrols_sdk

# Run only unit tests
pytest -m unit

# Run only integration tests
pytest -m integration

Project Structure

vibecontrols-sdk-python/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ vibecontrols_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

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Run the test suite: pytest
  5. Commit your changes: git commit -am 'Add feature'
  6. Push to the branch: git push origin feature-name
  7. Create a Pull Request

Type Hints

This SDK is fully typed and supports mypy type checking:

mypy src/vibecontrols_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

Related Projects

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

vibecontrols_sdk-2025.11.0.tar.gz (70.5 kB view details)

Uploaded Source

Built Distribution

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

vibecontrols_sdk-2025.11.0-py3-none-any.whl (63.9 kB view details)

Uploaded Python 3

File details

Details for the file vibecontrols_sdk-2025.11.0.tar.gz.

File metadata

  • Download URL: vibecontrols_sdk-2025.11.0.tar.gz
  • Upload date:
  • Size: 70.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vibecontrols_sdk-2025.11.0.tar.gz
Algorithm Hash digest
SHA256 0b37c04428b43904f944b01070e3e2bb702997ad331c837995dc19a223554cbd
MD5 2d64190ea599fb17816955a9dab351b6
BLAKE2b-256 85dbea57dcec216bb1774420ff91ea93f3a17ebf5828ad5750ab2a78d673ac8f

See more details on using hashes here.

File details

Details for the file vibecontrols_sdk-2025.11.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vibecontrols_sdk-2025.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2260b710c25dd0c2f87495fa389da0744f36d7315c19cf62c00de0df6651e8e
MD5 55bff44662bba1451848127d04267ad3
BLAKE2b-256 b5acff640d6c415b8d3ca84c8cdec86bb9d92e71da213557d509b8669c750ad9

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