This is the core module for the Mighty Network's SDK, providing essential functionalities and utilities.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mighty_sdk_core-0.1.6.tar.gz.
File metadata
- Download URL: mighty_sdk_core-0.1.6.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52432b7c4410f4d5d3ebb3a1cd475804ef5eab59435fc3bbd21e61c2432612c5
|
|
| MD5 |
bc05b8c31c9ddb29dac8e2ef1296de2e
|
|
| BLAKE2b-256 |
6d0382bfe445efd0bc3080231e1162b04dec7bdee01208ace081ea975b87ffd2
|
File details
Details for the file mighty_sdk_core-0.1.6-py3-none-any.whl.
File metadata
- Download URL: mighty_sdk_core-0.1.6-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/24.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b10792ec79451123c1e4844516a1ef597c85835269b305956370e83c5f92a9cc
|
|
| MD5 |
df8d11a6fb52d8f057d34c4091b72158
|
|
| BLAKE2b-256 |
11c7b7ea719a5fd852ec21dffc9c2691dec5cafb9c754e20070f68514fd6b9f4
|