itryid-sdk


Nameitryid-sdk JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://github.com/IGBerko/itryid-sdk
SummaryModern ItryID SDK for Python apps with improved architecture, type safety, and error handling
upload_time2025-08-31 20:13:08
maintainerNone
docs_urlNone
authorItry
requires_python>=3.7
licenseNone
keywords authentication gaming progress sdk api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ItryID SDK v2.0

Modern Python SDK for ItryID authentication and game progress management with improved architecture, type safety, and error handling.

## Features

- 🔐 **User Authentication** - Register, login, logout with validation
- 🎮 **Game Progress Management** - Save/load progress with automatic sync
- 💾 **Local Storage** - Automatic local caching with fallback
- 🔄 **Retry Logic** - Automatic retry for failed network requests
- 🛡️ **Type Safety** - Full type hints and data models
- 📝 **Comprehensive Logging** - Detailed logging for debugging
- ⚡ **Modern Architecture** - Clean, maintainable code structure

## Installation

\`\`\`bash
pip install itryid-sdk
\`\`\`

## Quick Start

\`\`\`python
from itryid import ItryIDClient, GameProgress

# Initialize client
client = ItryIDClient(
    server_url="https://your-server.com/api.php",
    game_name="my_awesome_game"
)

# Register new user
try:
    response = client.register("username", "password123", "user@example.com")
    print("Registration successful!")
except ValidationError as e:
    print(f"Validation error: {e}")

# Login
try:
    response = client.login("username", "password123")
    print(f"Logged in as: {client.user.username}")
except AuthenticationError as e:
    print(f"Login failed: {e}")

# Update and save progress
client.update_progress(level=5, score=1500, achievements=["first_win"])
response = client.save_progress()
print(f"Progress saved: {response.status}")

# Load progress
progress = client.load_progress()
print(f"Current level: {progress.level}, Score: {progress.score}")
\`\`\`

## Advanced Usage

### Custom Progress Model

\`\`\`python
from itryid import GameProgress

# Create custom progress
progress = GameProgress(
    level=10,
    score=5000,
    achievements=["speedrun", "perfectionist"],
    settings={"difficulty": "hard", "sound": True}
)

# Save custom progress
client.save_progress(progress)
\`\`\`

### Error Handling

\`\`\`python
from itryid import NetworkError, AuthenticationError, ValidationError

try:
    client.login("user", "pass")
except NetworkError as e:
    print(f"Network issue: {e}")
except AuthenticationError as e:
    print(f"Auth failed: {e}")
except ValidationError as e:
    print(f"Invalid input: {e}")
\`\`\`

### Configuration

\`\`\`python
client = ItryIDClient(
    server_url="https://api.example.com",
    game_name="my_game",
    local_save_path="./saves/progress.json",  # Custom save location
    timeout=15,  # Request timeout in seconds
    retry_attempts=5  # Number of retry attempts
)
\`\`\`

## API Reference

### ItryIDClient

Main client class for interacting with ItryID API.

#### Methods

- `register(username, password, email=None)` - Register new user
- `login(username, password)` - Login user
- `logout()` - Logout and clear local data
- `is_logged_in()` - Check login status
- `save_progress(progress=None)` - Save game progress
- `load_progress()` - Load current progress
- `update_progress(**kwargs)` - Update progress fields

### Models

#### User
- `user_id: Optional[int]` - User ID from server
- `username: str` - Username
- `email: Optional[str]` - Email address
- `created_at: Optional[str]` - Account creation date

#### GameProgress
- `level: int` - Current game level
- `score: int` - Player score
- `achievements: List[str]` - Unlocked achievements
- `settings: Dict[str, Any]` - Game settings
- `last_played: Optional[str]` - Last play timestamp

#### APIResponse
- `status: str` - Response status
- `message: Optional[str]` - Response message
- `data: Optional[Dict]` - Response data
- `is_success: bool` - Success indicator

### Exceptions

- `ItryIDError` - Base exception
- `NetworkError` - Network-related errors
- `AuthenticationError` - Authentication failures
- `ValidationError` - Input validation errors
- `ServerError` - Server-side errors

## Development

### Setup Development Environment

\`\`\`bash
git clone https://github.com/IGBerko/itryid-sdk.git
cd itryid-sdk
pip install -e ".[dev]"
\`\`\`

### Run Tests

\`\`\`bash
pytest tests/ -v --cov=itryid
\`\`\`

### Code Formatting

\`\`\`bash
black itryid/
flake8 itryid/
mypy itryid/
\`\`\`

## Changelog

### v2.0.0
- Complete rewrite with modern architecture
- Added type safety and data models
- Improved error handling and validation
- Added comprehensive logging
- Better local storage management
- Retry logic for network requests
- Enhanced documentation

### v1.0.1
- Initial release
- Basic authentication and progress saving

## License

MIT License - see LICENSE file for details.

## Support

- GitHub Issues: https://github.com/IGBerko/itryid-sdk/issues
- Email: support@ut.itrypro.ru

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/IGBerko/itryid-sdk",
    "name": "itryid-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "authentication, gaming, progress, sdk, api",
    "author": "Itry",
    "author_email": "support@ut.itrypro.ru",
    "download_url": "https://files.pythonhosted.org/packages/71/6f/bed81bc8f15f00619d68c39d9a80e5df65ea3f3eacddde7418b6812c58e2/itryid_sdk-2.0.0.tar.gz",
    "platform": null,
    "description": "# ItryID SDK v2.0\r\n\r\nModern Python SDK for ItryID authentication and game progress management with improved architecture, type safety, and error handling.\r\n\r\n## Features\r\n\r\n- \ud83d\udd10 **User Authentication** - Register, login, logout with validation\r\n- \ud83c\udfae **Game Progress Management** - Save/load progress with automatic sync\r\n- \ud83d\udcbe **Local Storage** - Automatic local caching with fallback\r\n- \ud83d\udd04 **Retry Logic** - Automatic retry for failed network requests\r\n- \ud83d\udee1\ufe0f **Type Safety** - Full type hints and data models\r\n- \ud83d\udcdd **Comprehensive Logging** - Detailed logging for debugging\r\n- \u26a1 **Modern Architecture** - Clean, maintainable code structure\r\n\r\n## Installation\r\n\r\n\\`\\`\\`bash\r\npip install itryid-sdk\r\n\\`\\`\\`\r\n\r\n## Quick Start\r\n\r\n\\`\\`\\`python\r\nfrom itryid import ItryIDClient, GameProgress\r\n\r\n# Initialize client\r\nclient = ItryIDClient(\r\n    server_url=\"https://your-server.com/api.php\",\r\n    game_name=\"my_awesome_game\"\r\n)\r\n\r\n# Register new user\r\ntry:\r\n    response = client.register(\"username\", \"password123\", \"user@example.com\")\r\n    print(\"Registration successful!\")\r\nexcept ValidationError as e:\r\n    print(f\"Validation error: {e}\")\r\n\r\n# Login\r\ntry:\r\n    response = client.login(\"username\", \"password123\")\r\n    print(f\"Logged in as: {client.user.username}\")\r\nexcept AuthenticationError as e:\r\n    print(f\"Login failed: {e}\")\r\n\r\n# Update and save progress\r\nclient.update_progress(level=5, score=1500, achievements=[\"first_win\"])\r\nresponse = client.save_progress()\r\nprint(f\"Progress saved: {response.status}\")\r\n\r\n# Load progress\r\nprogress = client.load_progress()\r\nprint(f\"Current level: {progress.level}, Score: {progress.score}\")\r\n\\`\\`\\`\r\n\r\n## Advanced Usage\r\n\r\n### Custom Progress Model\r\n\r\n\\`\\`\\`python\r\nfrom itryid import GameProgress\r\n\r\n# Create custom progress\r\nprogress = GameProgress(\r\n    level=10,\r\n    score=5000,\r\n    achievements=[\"speedrun\", \"perfectionist\"],\r\n    settings={\"difficulty\": \"hard\", \"sound\": True}\r\n)\r\n\r\n# Save custom progress\r\nclient.save_progress(progress)\r\n\\`\\`\\`\r\n\r\n### Error Handling\r\n\r\n\\`\\`\\`python\r\nfrom itryid import NetworkError, AuthenticationError, ValidationError\r\n\r\ntry:\r\n    client.login(\"user\", \"pass\")\r\nexcept NetworkError as e:\r\n    print(f\"Network issue: {e}\")\r\nexcept AuthenticationError as e:\r\n    print(f\"Auth failed: {e}\")\r\nexcept ValidationError as e:\r\n    print(f\"Invalid input: {e}\")\r\n\\`\\`\\`\r\n\r\n### Configuration\r\n\r\n\\`\\`\\`python\r\nclient = ItryIDClient(\r\n    server_url=\"https://api.example.com\",\r\n    game_name=\"my_game\",\r\n    local_save_path=\"./saves/progress.json\",  # Custom save location\r\n    timeout=15,  # Request timeout in seconds\r\n    retry_attempts=5  # Number of retry attempts\r\n)\r\n\\`\\`\\`\r\n\r\n## API Reference\r\n\r\n### ItryIDClient\r\n\r\nMain client class for interacting with ItryID API.\r\n\r\n#### Methods\r\n\r\n- `register(username, password, email=None)` - Register new user\r\n- `login(username, password)` - Login user\r\n- `logout()` - Logout and clear local data\r\n- `is_logged_in()` - Check login status\r\n- `save_progress(progress=None)` - Save game progress\r\n- `load_progress()` - Load current progress\r\n- `update_progress(**kwargs)` - Update progress fields\r\n\r\n### Models\r\n\r\n#### User\r\n- `user_id: Optional[int]` - User ID from server\r\n- `username: str` - Username\r\n- `email: Optional[str]` - Email address\r\n- `created_at: Optional[str]` - Account creation date\r\n\r\n#### GameProgress\r\n- `level: int` - Current game level\r\n- `score: int` - Player score\r\n- `achievements: List[str]` - Unlocked achievements\r\n- `settings: Dict[str, Any]` - Game settings\r\n- `last_played: Optional[str]` - Last play timestamp\r\n\r\n#### APIResponse\r\n- `status: str` - Response status\r\n- `message: Optional[str]` - Response message\r\n- `data: Optional[Dict]` - Response data\r\n- `is_success: bool` - Success indicator\r\n\r\n### Exceptions\r\n\r\n- `ItryIDError` - Base exception\r\n- `NetworkError` - Network-related errors\r\n- `AuthenticationError` - Authentication failures\r\n- `ValidationError` - Input validation errors\r\n- `ServerError` - Server-side errors\r\n\r\n## Development\r\n\r\n### Setup Development Environment\r\n\r\n\\`\\`\\`bash\r\ngit clone https://github.com/IGBerko/itryid-sdk.git\r\ncd itryid-sdk\r\npip install -e \".[dev]\"\r\n\\`\\`\\`\r\n\r\n### Run Tests\r\n\r\n\\`\\`\\`bash\r\npytest tests/ -v --cov=itryid\r\n\\`\\`\\`\r\n\r\n### Code Formatting\r\n\r\n\\`\\`\\`bash\r\nblack itryid/\r\nflake8 itryid/\r\nmypy itryid/\r\n\\`\\`\\`\r\n\r\n## Changelog\r\n\r\n### v2.0.0\r\n- Complete rewrite with modern architecture\r\n- Added type safety and data models\r\n- Improved error handling and validation\r\n- Added comprehensive logging\r\n- Better local storage management\r\n- Retry logic for network requests\r\n- Enhanced documentation\r\n\r\n### v1.0.1\r\n- Initial release\r\n- Basic authentication and progress saving\r\n\r\n## License\r\n\r\nMIT License - see LICENSE file for details.\r\n\r\n## Support\r\n\r\n- GitHub Issues: https://github.com/IGBerko/itryid-sdk/issues\r\n- Email: support@ut.itrypro.ru\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Modern ItryID SDK for Python apps with improved architecture, type safety, and error handling",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/IGBerko/itryid-sdk"
    },
    "split_keywords": [
        "authentication",
        " gaming",
        " progress",
        " sdk",
        " api"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9dfb36a623480e111c3307f2992a070be6fc64188f3ff1396f20eda5f0b9d875",
                "md5": "20982426753a72866abc76fb79bcfc83",
                "sha256": "83f55a57642f023ea543793094beba0b37d83a9a58cd17226b4da176c363c164"
            },
            "downloads": -1,
            "filename": "itryid_sdk-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "20982426753a72866abc76fb79bcfc83",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7995,
            "upload_time": "2025-08-31T20:13:07",
            "upload_time_iso_8601": "2025-08-31T20:13:07.085550Z",
            "url": "https://files.pythonhosted.org/packages/9d/fb/36a623480e111c3307f2992a070be6fc64188f3ff1396f20eda5f0b9d875/itryid_sdk-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "716fbed81bc8f15f00619d68c39d9a80e5df65ea3f3eacddde7418b6812c58e2",
                "md5": "767661e9ea8ba0a4f87772f5a8fbe7f4",
                "sha256": "83bd03bb8c92ff59f3853ca3bc7462e67cb8b759999e503ed92eaff78495922a"
            },
            "downloads": -1,
            "filename": "itryid_sdk-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "767661e9ea8ba0a4f87772f5a8fbe7f4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9561,
            "upload_time": "2025-08-31T20:13:08",
            "upload_time_iso_8601": "2025-08-31T20:13:08.244937Z",
            "url": "https://files.pythonhosted.org/packages/71/6f/bed81bc8f15f00619d68c39d9a80e5df65ea3f3eacddde7418b6812c58e2/itryid_sdk-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-31 20:13:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "IGBerko",
    "github_project": "itryid-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "itryid-sdk"
}
        
Elapsed time: 1.95113s