Skip to main content

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

  1. Initialize the Client: Create an instance of MightyUserDataClient with 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
    )
    
  2. Fetch and Decrypt Data: Use the get_data method 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_data method 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mighty_sdk_core-0.1.9.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mighty_sdk_core-0.1.9-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file mighty_sdk_core-0.1.9.tar.gz.

File metadata

  • Download URL: mighty_sdk_core-0.1.9.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/24.4.0

File hashes

Hashes for mighty_sdk_core-0.1.9.tar.gz
Algorithm Hash digest
SHA256 1f60b6a8d9bf6aa5093f8acdfa13fb53971af415570b96eed9ff0bbf9cad762a
MD5 2ea5d93b7afdec25d4d0308b056fbcde
BLAKE2b-256 c3cc6c5addf14cecab65adebedc694e07de802bf3f61027bd907b2dd9265511d

See more details on using hashes here.

File details

Details for the file mighty_sdk_core-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: mighty_sdk_core-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 14.7 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

Hashes for mighty_sdk_core-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 5b919dd76c56ab3f832c11fa276895e3506f2ffeb27a75edfadf6d65a7a24c8b
MD5 e3caead845bdaf92dff1a947e309b142
BLAKE2b-256 42e3d1938872332f3a019da7e69481a87c2c0e7cb96dcbb1a93eb8598e4f23b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page