stellar-identity-python-sdk
Facilitate secure interactions with the Magic backend infrastructure for managing decentralized cryptographic credentials and enabling user authentication flows within Python applications. This toolkit furnishes essential routines for the robust handling and verification of Decentralized ID (DID) assertions.
Author

luisgj
Quick Info
Actions
Tags
Refined Python SDK for Stellar Identity Management
The [Advanced] Stellar Identity Python SDK furnishes streamlined mechanisms for engaging with the Magic service endpoints, alongside a suite of utilities dedicated to processing Decentralized Identifier (DID) Tokens.
This package has undergone a complete revision from its predecessor to ensure full compatibility with contemporary Python runtime environments.
Navigational Index
- Comprehensive Reference
- Initial Setup Guide
- Contribution & Maintenance
- Revision History
- Usage Agreement
Comprehensive Reference
Consult the official Magic documentation for in-depth details!
Installation Procedure
The package is readily acquirable via PyPI:
pip install stellar-identity-python-sdk
Prerequisites
- Requires Python environment version 3.9 or newer.
Initial Setup Guide
To begin, securing your unique API secret key from the Magic Control Panel is mandatory. With this key, you can instantiate the core StellarIdentity client object.
from stellar_identity import StellarIdentity
client = StellarIdentity(api_secret_key='
Example usage: verifying an incoming assertion
client.AssertionManager.verify('RECEIVED_DID_ASSERTION')
Explore further capabilities in the documentation! ✨
Alternatively, the API secret can be sourced from the system environment variable, STELLAR_API_SECRET_KEY.
Ensure the environment variable STELLAR_API_SECRET_KEY is set.
client = StellarIdentity()
Important Note: Any explicitly supplied constructor argument will always override the value read from environment variables.
Customizing Network Parameters
The primary StellarIdentity instance constructor optionally accepts configuration for retry logic, request timeouts, and exponential backoff factors to tailor network communication behavior.
client = StellarIdentity(max_attempts=5, request_timeout_seconds=10, backoff_increment=0.03)
Contribution & Maintenance
We warmly welcome community involvement in enhancing this SDK. Initiate development by cloning the repository and setting up an isolated virtual environment.
make setup-development
This command prepares the necessary isolated environment containing all required local development dependencies.
Subsequently, activate the environment for easier local iteration:
source .venv/bin/activate
To confirm that new code integrates correctly across all supported Python versions, execute the testing suite:
make run-tests
To discard the existing virtual environment, tox logs, and pytest artifacts, use:
make cleanup
This repository enforces code consistency through integrated pre-commit hooks, which execute automatically upon every commit action.
You may also trigger these formatting checks manually:
pre-commit run --all-files
Refer to the CONTRIBUTING document for additional guidance.
Revision History
Consult the CHANGELOG file.
Usage Agreement
Review the terms detailed in [LICENSE.txt].
