gymix


Namegymix JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/mrssd/gymix-python-sdk
SummaryOfficial Python SDK for Gymix API - Gym management and backup services
upload_time2025-08-30 08:29:58
maintainerNone
docs_urlNone
authorGymix Team
requires_python>=3.7
licenseMIT
keywords gymix api sdk gym management backup
VCS
bugtrack_url
requirements requests typing-extensions
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Gymix Python SDK

![PyPI](https://img.shields.io/pypi/v/gymix)
![Python](https://img.shields.io/pypi/pyversions/gymix)
![License](https://img.shields.io/pypi/l/gymix)

Official Python SDK for the Gymix API - A comprehensive gym management and backup service platform.

## Features

- 🏋️ **User Management**: Get user profile and gym information
- 🏢 **Gym Management**: Access gym details, subscriptions, and plans
- 💾 **Backup Services**: Create, list, download, and delete gym backups
- 🔐 **Authentication**: Secure API key-based authentication
- 📊 **Health Monitoring**: Check API service status
- 🚀 **Easy to Use**: Simple and intuitive Python interface
- 🛡️ **Type Safe**: Full type hints support
- ⚡ **Async Support**: Built-in support for async/await patterns

## Installation

```bash
pip install gymix
```

## Quick Start

```python
from gymix import GymixClient

# Initialize the client
client = GymixClient(api_token="your_api_token_here")

# Get user information
user_info = client.users.get_info()
print(f"Welcome, {user_info['name']} {user_info['lastname']}")

# Get gym information
gym_info = client.gym.get_info(gym_public_key="your_gym_key")
print(f"Gym: {gym_info['gym_info']['name']}")

# Create a backup
with open("backup.zip", "rb") as backup_file:
    backup = client.backup.create(
        gym_public_key="your_gym_key",
        file=backup_file
    )
print(f"Backup created with ID: {backup['id']}")

# List all backups
backups = client.backup.list(gym_public_key="your_gym_key")
for backup in backups['backups']:
    print(f"Backup: {backup['file_name']} - {backup['created_at']}")
```

## Authentication

The Gymix SDK uses Bearer token authentication. You can obtain your API token from the Gymix dashboard.

```python
from gymix import GymixClient

client = GymixClient(api_token="your_api_token_here")
```

## API Reference

### Users

#### Get User Information

```python
user_info = client.users.get_info()
```

### Gym Management

#### Get Gym Information

```python
gym_info = client.gym.get_info(gym_public_key="gym_key")
```

### Backup Services

#### Create Backup

```python
with open("backup.zip", "rb") as file:
    backup = client.backup.create(gym_public_key="gym_key", file=file)
```

#### List Backups

```python
backups = client.backup.list(gym_public_key="gym_key", verified=False)
```

#### Download Backup

```python
download_info = client.backup.download(backup_id="backup_id", gym_public_key="gym_key")
# Use download_info['download_url'] to download the file
```

#### Delete Backup

```python
result = client.backup.delete(backup_id="backup_id", gym_public_key="gym_key")
```

#### Get Backup Plan Information

```python
plan_info = client.backup.get_plan(gym_public_key="gym_key")
```

### Health Check

#### Check API Health

```python
health = client.health.check()
print(f"API Status: {health['status']}")
```

## Error Handling

The SDK provides comprehensive error handling with specific exception types:

```python
from gymix import GymixClient
from gymix.exceptions import (
    GymixAuthenticationError,
    GymixForbiddenError,
    GymixNotFoundError,
    GymixRateLimitError,
    GymixAPIError
)

client = GymixClient(api_token="your_token")

try:
    user_info = client.users.get_info()
except GymixAuthenticationError:
    print("Invalid or expired API token")
except GymixForbiddenError:
    print("Access forbidden - check account status")
except GymixNotFoundError:
    print("Resource not found")
except GymixRateLimitError:
    print("Rate limit exceeded")
except GymixAPIError as e:
    print(f"API error: {e.message}")
```

## Configuration

### Base URL

You can customize the base URL if needed:

```python
client = GymixClient(
    api_token="your_token",
    base_url="https://custom-api.gymix.ir"
)
```

### Timeout Settings

```python
client = GymixClient(
    api_token="your_token",
    timeout=30  # seconds
)
```

## Development

### Setting up Development Environment

```bash
# Clone the repository
git clone https://github.com/mrssd/gymix-python-sdk.git
cd python-sdk

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

# Run tests
pytest

# Run type checking
mypy gymix

# Format code
black gymix tests

# Lint code
flake8 gymix tests
```

### Running Tests

```bash
# Run all tests
pytest

# Run with coverage
pytest --cov=gymix

# Run specific test file
pytest tests/test_client.py
```

## Requirements

- Python 3.7+
- requests >= 2.25.0

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Support

- 📧 Email: support@gymix.ir
- 📖 Documentation: https://docs.gymix.ir/python-sdk
- 🐛 Issues: https://github.com/mrssd/gymix-python-sdk/issues

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## Changelog

See [CHANGELOG.md](CHANGELOG.md) for details about changes in each version.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mrssd/gymix-python-sdk",
    "name": "gymix",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "gymix, api, sdk, gym, management, backup",
    "author": "Gymix Team",
    "author_email": "Gymix Team <support@gymix.ir>",
    "download_url": "https://files.pythonhosted.org/packages/c1/d1/e9fdffac6db29b0ef941100baaaf0ea55cbc962d7aa525470530c82925a0/gymix-1.0.0.tar.gz",
    "platform": null,
    "description": "# Gymix Python SDK\n\n![PyPI](https://img.shields.io/pypi/v/gymix)\n![Python](https://img.shields.io/pypi/pyversions/gymix)\n![License](https://img.shields.io/pypi/l/gymix)\n\nOfficial Python SDK for the Gymix API - A comprehensive gym management and backup service platform.\n\n## Features\n\n- \ud83c\udfcb\ufe0f **User Management**: Get user profile and gym information\n- \ud83c\udfe2 **Gym Management**: Access gym details, subscriptions, and plans\n- \ud83d\udcbe **Backup Services**: Create, list, download, and delete gym backups\n- \ud83d\udd10 **Authentication**: Secure API key-based authentication\n- \ud83d\udcca **Health Monitoring**: Check API service status\n- \ud83d\ude80 **Easy to Use**: Simple and intuitive Python interface\n- \ud83d\udee1\ufe0f **Type Safe**: Full type hints support\n- \u26a1 **Async Support**: Built-in support for async/await patterns\n\n## Installation\n\n```bash\npip install gymix\n```\n\n## Quick Start\n\n```python\nfrom gymix import GymixClient\n\n# Initialize the client\nclient = GymixClient(api_token=\"your_api_token_here\")\n\n# Get user information\nuser_info = client.users.get_info()\nprint(f\"Welcome, {user_info['name']} {user_info['lastname']}\")\n\n# Get gym information\ngym_info = client.gym.get_info(gym_public_key=\"your_gym_key\")\nprint(f\"Gym: {gym_info['gym_info']['name']}\")\n\n# Create a backup\nwith open(\"backup.zip\", \"rb\") as backup_file:\n    backup = client.backup.create(\n        gym_public_key=\"your_gym_key\",\n        file=backup_file\n    )\nprint(f\"Backup created with ID: {backup['id']}\")\n\n# List all backups\nbackups = client.backup.list(gym_public_key=\"your_gym_key\")\nfor backup in backups['backups']:\n    print(f\"Backup: {backup['file_name']} - {backup['created_at']}\")\n```\n\n## Authentication\n\nThe Gymix SDK uses Bearer token authentication. You can obtain your API token from the Gymix dashboard.\n\n```python\nfrom gymix import GymixClient\n\nclient = GymixClient(api_token=\"your_api_token_here\")\n```\n\n## API Reference\n\n### Users\n\n#### Get User Information\n\n```python\nuser_info = client.users.get_info()\n```\n\n### Gym Management\n\n#### Get Gym Information\n\n```python\ngym_info = client.gym.get_info(gym_public_key=\"gym_key\")\n```\n\n### Backup Services\n\n#### Create Backup\n\n```python\nwith open(\"backup.zip\", \"rb\") as file:\n    backup = client.backup.create(gym_public_key=\"gym_key\", file=file)\n```\n\n#### List Backups\n\n```python\nbackups = client.backup.list(gym_public_key=\"gym_key\", verified=False)\n```\n\n#### Download Backup\n\n```python\ndownload_info = client.backup.download(backup_id=\"backup_id\", gym_public_key=\"gym_key\")\n# Use download_info['download_url'] to download the file\n```\n\n#### Delete Backup\n\n```python\nresult = client.backup.delete(backup_id=\"backup_id\", gym_public_key=\"gym_key\")\n```\n\n#### Get Backup Plan Information\n\n```python\nplan_info = client.backup.get_plan(gym_public_key=\"gym_key\")\n```\n\n### Health Check\n\n#### Check API Health\n\n```python\nhealth = client.health.check()\nprint(f\"API Status: {health['status']}\")\n```\n\n## Error Handling\n\nThe SDK provides comprehensive error handling with specific exception types:\n\n```python\nfrom gymix import GymixClient\nfrom gymix.exceptions import (\n    GymixAuthenticationError,\n    GymixForbiddenError,\n    GymixNotFoundError,\n    GymixRateLimitError,\n    GymixAPIError\n)\n\nclient = GymixClient(api_token=\"your_token\")\n\ntry:\n    user_info = client.users.get_info()\nexcept GymixAuthenticationError:\n    print(\"Invalid or expired API token\")\nexcept GymixForbiddenError:\n    print(\"Access forbidden - check account status\")\nexcept GymixNotFoundError:\n    print(\"Resource not found\")\nexcept GymixRateLimitError:\n    print(\"Rate limit exceeded\")\nexcept GymixAPIError as e:\n    print(f\"API error: {e.message}\")\n```\n\n## Configuration\n\n### Base URL\n\nYou can customize the base URL if needed:\n\n```python\nclient = GymixClient(\n    api_token=\"your_token\",\n    base_url=\"https://custom-api.gymix.ir\"\n)\n```\n\n### Timeout Settings\n\n```python\nclient = GymixClient(\n    api_token=\"your_token\",\n    timeout=30  # seconds\n)\n```\n\n## Development\n\n### Setting up Development Environment\n\n```bash\n# Clone the repository\ngit clone https://github.com/mrssd/gymix-python-sdk.git\ncd python-sdk\n\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Run type checking\nmypy gymix\n\n# Format code\nblack gymix tests\n\n# Lint code\nflake8 gymix tests\n```\n\n### Running Tests\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=gymix\n\n# Run specific test file\npytest tests/test_client.py\n```\n\n## Requirements\n\n- Python 3.7+\n- requests >= 2.25.0\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- \ud83d\udce7 Email: support@gymix.ir\n- \ud83d\udcd6 Documentation: https://docs.gymix.ir/python-sdk\n- \ud83d\udc1b Issues: https://github.com/mrssd/gymix-python-sdk/issues\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for details about changes in each version.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Official Python SDK for Gymix API - Gym management and backup services",
    "version": "1.0.0",
    "project_urls": {
        "Bug Reports": "https://github.com/mrssd/gymix-python-sdk/issues",
        "Documentation": "https://docs.gymix.ir/python-sdk",
        "Homepage": "https://gymix.ir",
        "Repository": "https://github.com/mrssd/gymix-python-sdk"
    },
    "split_keywords": [
        "gymix",
        " api",
        " sdk",
        " gym",
        " management",
        " backup"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2cacbdd08fe9a06aadc748f3480215a6fc70b134a0d8ea04f2e5d06fee02e34f",
                "md5": "09729ca6ab53e5a793a423400adff30d",
                "sha256": "7b4afc441396a0922312741187f0f8de6df98a8688c37246a43dc303c8b6b982"
            },
            "downloads": -1,
            "filename": "gymix-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09729ca6ab53e5a793a423400adff30d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 12654,
            "upload_time": "2025-08-30T08:29:57",
            "upload_time_iso_8601": "2025-08-30T08:29:57.113902Z",
            "url": "https://files.pythonhosted.org/packages/2c/ac/bdd08fe9a06aadc748f3480215a6fc70b134a0d8ea04f2e5d06fee02e34f/gymix-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c1d1e9fdffac6db29b0ef941100baaaf0ea55cbc962d7aa525470530c82925a0",
                "md5": "3290af6b1849ca8a119167d000439e56",
                "sha256": "b36c8917c75f2b7dc616719430c920a8eb964ebc113a4d099e40c63ea9394031"
            },
            "downloads": -1,
            "filename": "gymix-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3290af6b1849ca8a119167d000439e56",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 24712,
            "upload_time": "2025-08-30T08:29:58",
            "upload_time_iso_8601": "2025-08-30T08:29:58.823581Z",
            "url": "https://files.pythonhosted.org/packages/c1/d1/e9fdffac6db29b0ef941100baaaf0ea55cbc962d7aa525470530c82925a0/gymix-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-30 08:29:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mrssd",
    "github_project": "gymix-python-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.25.0"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        }
    ],
    "lcname": "gymix"
}
        
Elapsed time: 1.19065s