mighty-sdk-core
This directory contains the core functionalities of the Mighty Network's official SDK. It includes essential modules and utilities that provide the foundational features required for the SDK to operate efficiently.
Quick Start
This section guides you through setting up and using the MightyUserDataClient to fetch and decrypt user data from the Mighty Network API.
Prerequisites
-
Python 3.12+
-
Install required dependencies:
pip install aiohttp mighty-sdk-core
-
Obtain your API key, public key, and private key from the Mighty Network API dashboard.
-
Ensure the Mighty API base URL is accessible (defaults to
http://localhost:8080).
Basic Usage
-
Initialize the Client: Create an instance of
MightyUserDataClientwith your API credentials.from mighty_sdk_core.mighty.user_data_client import MightyUserDataClient # Replace with your actual credentials api_key = "your-data-api-key" public_key = "data-api-key-public-key" private_key = "data-api-key-private-key" client = MightyUserDataClient( api_key=api_key, api_public_key=public_key, api_private_key=private_key )
-
Fetch and Decrypt Data: Use the
get_datamethod to asynchronously retrieve and decrypt user data.import asyncio async def main(): try: data = await client.get_data() print("Decrypted Data:", data) except Exception as e: print(f"Error: {e}") # Run the async function asyncio.run(main())
Environment Configuration
You can configure the API base URL using an environment variable:
export MIGHTY_BASE_URL="<https://your-mighty-api-url>"
If not set, it defaults to http://localhost:8080.
Notes
- Ensure your API credentials are kept secure and not hard-coded in production code.
- The
get_datamethod handles HTTP requests and decryption automatically, returning the decrypted data as a string. - Errors during fetching or decryption will be raised as exceptions, so use try-except blocks for robust error handling.
This setup should get you up and running quickly with the MightyUserDataClient. For advanced usage, refer to the full documentation.
Metadata
Release files for mighty-sdk-core 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mighty_sdk_core-0.1.10.tar.gz | 11.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mighty_sdk_core-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.8 kB
Release files / mighty_sdk_core-0.1.10.tar.gz
| Download URL | mighty_sdk_core-0.1.10.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a5ab00c09b3d28471c37a25151727de1d0bab128ca2c7c37f9bd581eceddf9f
|
|
BLAKE2b-256 checksum How to use checksums |
645772cf0fd876b622e32552f9b853a50a011b7f4beadfaaac7334ef033562b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Darwin/24.4.0
|
Release files / mighty_sdk_core-0.1.10-py3-none-any.whl
| Download URL | mighty_sdk_core-0.1.10-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d003a7474890f56c307a05864179a00c3df4e3393b7bf6ef33bd8a26a8df84a
|
|
BLAKE2b-256 checksum How to use checksums |
eb8cff22bc130b19eed7a625d63caaaf01c2539e3f351c350599a9fc9aae6cbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Darwin/24.4.0
|