Metadata-Version: 2.4
Name: mpratyush54-sdk
Version: 0.6.1
Summary: Platform Python SDK
Home-page: https://github.com/Mpratyush54/server-automation
Author: Platform Team
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: pymongo>=4.5.0
Requires-Dist: redis>=5.0.0
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# mpratyush54-sdk

The official Python SDK for the Platform.

This SDK provides core backend integrations for your Python microservices, including auto-registration with the platform, metrics aggregation, structured logging, and standardized database connections.

## Installation

```bash
pip install mpratyush54-sdk
```

## Features

- **Service Registration:** Automatically registers your microservice with the Platform API on startup.
- **Metrics Aggregation:** Utility decorators and middleware to record route metrics, execution times, and memory deltas.
- **Database Connections:** Pre-configured Psycopg2 (PostgreSQL), PyMongo (MongoDB), and Redis connection utilities.
- **Logging:** Structured logging that automatically ships to the platform.

## Usage

```python
from platform_sdk import PlatformSDK

sdk = PlatformSDK(
    project_id="your-project-id",
    environment="production",
    api_url="https://api.your-platform.com"
)

# Initialize connections and register service
sdk.initialize()

# Use database connections safely
db = sdk.connections.get_postgres()
cursor = db.cursor()
cursor.execute("SELECT version();")
print(cursor.fetchone())
```
