echomirror-sdk (Python)
Official Python SDK for EchoMirror — mood tracking with Stellar-powered rewards.
Native bindings (PyO3 + maturin) over the same Rust core that powers the JS and Flutter SDKs — every call is real native code and returns a proper asyncio coroutine, so nothing blocks the event loop.
Install
python -m venv .venv
source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
pip install echomirror-sdk
The package targets Python 3.9–3.12. If a wheel for your platform is not yet available, build the checkout with maturin:
git clone https://github.com/Echo-Mirror-Butler/echomirror-sdk.git
cd echomirror-sdk/crates/echomirror-python
pip install maturin
maturin develop --release
Quickstart
Set the API key issued by your EchoMirror deployment, then create one client for mood, Stellar, and social operations:
export ECHOMIRROR_API_KEY="your_api_key"
# Windows PowerShell: $env:ECHOMIRROR_API_KEY = "your_api_key"
import asyncio
import os
from echomirror import EchoMirror, StellarNetwork
async def main():
app = EchoMirror(
api_key=os.environ["ECHOMIRROR_API_KEY"],
network=StellarNetwork.Testnet,
)
entry = await app.mood.log(score=8, note="Great day", tags=["work", "proud"])
print(f"Logged mood {entry.score}/10")
balance = await app.stellar.get_balance(os.environ["STELLAR_PUBLIC_KEY"])
print(f"{balance.xlm} XLM • {balance.echo} ECHO")
payment = await app.stellar.build_transfer(
from_address=os.environ["STELLAR_PUBLIC_KEY"],
to_address=os.environ["STELLAR_DESTINATION"],
amount=5.0,
memo="Great energy today",
)
print(f"Unsigned payment XDR ({payment.fee} stroops): {payment.xdr}")
feed = await app.social.get_global_feed(limit=10)
print(f"{len(feed)} entries in the global feed")
asyncio.run(main())
build_transfer deliberately returns an unsigned XDR. Sign it with the account owner's wallet or signer before calling submit_transaction; never put a secret key in source code or environment variables used by this example.
For a complete script that also demonstrates authentication, a fixture-backed payment submission, and typed error handling, see examples/quickstart.py.
Run the complete example safely
The repository's contract-test fixture is deterministic and never broadcasts a Stellar transaction. From the repository root, start both fixture roles and run the example with one command:
python crates/echomirror-python/examples/quickstart.py --start-fixture
The example defaults to the fixture URLs and keys from contract-tests/contract-spec.json. Without --start-fixture, override its ECHOMIRROR_* and STELLAR_* environment variables to point at an already running fixture or another test deployment.
Sub-clients
Each sub-client also works standalone against a shared EchoMirrorClient — handy if you only need one slice of the API:
from echomirror import EchoMirrorClient, MoodClient, StellarClient, SocialClient, StellarNetwork
client = EchoMirrorClient("your_api_key", network=StellarNetwork.Mainnet)
mood = MoodClient(client)
stellar = StellarClient(client)
social = SocialClient(client)
Error handling
All errors inherit from EchoMirrorException:
from echomirror import AuthError, RateLimitError, NotFoundError, EchoMirrorException
try:
await app.mood.get_streak()
except AuthError:
... # invalid or expired API key
except RateLimitError:
... # back off and retry
except NotFoundError:
...
except EchoMirrorException as e:
... # anything else
HTTP 401, 404, and 429 responses map to AuthError, NotFoundError, and RateLimitError; transport and server failures remain catchable through EchoMirrorException.
Type checking
The package ships py.typed and type stubs. Editors using Pyright and projects running mypy can catch mistakes before execution—for example, await app.mood.log(score="8") is rejected because score must be an int.
Testnet
app = EchoMirror(api_key="your_api_key", network=StellarNetwork.Testnet)
await app.stellar.fund_testnet_account("GPUBLIC_KEY") # Friendbot: 10,000 XLM
Development
pip install maturin pytest pytest-asyncio
maturin develop --release
pytest
License
MIT
Metadata
Release files for echomirror-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| echomirror_sdk-0.1.0.tar.gz | 70.3 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 42.1 MB
Release files / echomirror_sdk-0.1.0.tar.gz
| Download URL | echomirror_sdk-0.1.0.tar.gz |
|---|---|
| Size | 70.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c35139602a82a080861e5aba0cabb84200391c808fa80b8f56cf028c1a834c68
|
|
BLAKE2b-256 checksum How to use checksums |
44c39ad828afb68ed54d3b076707a3341d27fd30f1f6d8245c9bd725be5b6be3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Release files / echomirror_sdk-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | echomirror_sdk-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
2efe5d365f24d54e2d9b6d54d5cc80acf859bb764a9b4711d49666bb26f1cd62
|
|
BLAKE2b-256 checksum How to use checksums |
99c32432e89ea8e0acc135b47777b245574dadb5f709e57e9008e706a708383b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Release files / echomirror_sdk-0.1.0-cp312-cp312-win_amd64.whl
| Download URL | echomirror_sdk-0.1.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
321d241f113408ae24233c39addfa8c47068f872aaa59547cfb6c6a60ad4ddae
|
|
BLAKE2b-256 checksum How to use checksums |
796f962da31116da319f7c5b7faf7fd499782ca01a7ee69c5ca4242018db0d4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | echomirror_sdk-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
0f441ac096e85b99ecddaf38ce7539f4643fc6f929d089fe33fc40e11274b8f5
|
|
BLAKE2b-256 checksum How to use checksums |
dd93cb9b9e00f1030680551a5363c7c88956ef5c9468d4647bf41ecedb6bd1b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | echomirror_sdk-0.1.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b6dd93d1f766251834e16df304a60110e174f107b0c6acdfd368f61787c0cc4a
|
|
BLAKE2b-256 checksum How to use checksums |
5f04c460280fad3e005e6e0644a813deb01dcd7203b4a55b1babb15271916b63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp311-cp311-win_amd64.whl
| Download URL | echomirror_sdk-0.1.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
be4402a7a55bd1d67e7bc7b4418b5888f559461536a0d88c1a868f1e4bd92889
|
|
BLAKE2b-256 checksum How to use checksums |
66ffd02c2150388fa2d780d0f90d1f03a298e8abe3fc3955758ffb4321d67b94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | echomirror_sdk-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
8cb7ee6036efd6bb874b08b81ce2ff55392d36b317eda0cca1ca855dc1da9a8c
|
|
BLAKE2b-256 checksum How to use checksums |
ff603bf1d7e3287fb49c0718695bee303202b0ee178974f77661b76894496ad9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | echomirror_sdk-0.1.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.11 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d6de00e9aaaa160f2463d762d57bd8e25ffa2aec6b9130cf39e887c3f6699bf1
|
|
BLAKE2b-256 checksum How to use checksums |
1c3c63e61c9fb50f47a4b1cafa6e92d0cc172e39f0ba797a3fae2831880d4e6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp310-cp310-win_amd64.whl
| Download URL | echomirror_sdk-0.1.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cf25a766432e91b637fae5215c089360f9052e2176521b19e57a314bb54f3c77
|
|
BLAKE2b-256 checksum How to use checksums |
9dac7473067b691f1016bcda929a36f4e9ff7a37681a7f2e5f9772c059c04789
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | echomirror_sdk-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
7c26bf9043913250f29b7772e1e1c5aedbac154201a3aefe0c1cddb2c7079a57
|
|
BLAKE2b-256 checksum How to use checksums |
72b9877f017e28deb9162dcada73697a99b87ee64fff8a1d0dea434aeeecb2c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | echomirror_sdk-0.1.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.10 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ed30a2370868fbbbdc2237e894508e4c251751bb735c0710e27630e3010baf59
|
|
BLAKE2b-256 checksum How to use checksums |
4749e2d96f3f1fc3d493091724382d07434323d9f9164ddd05db0a53f74e302a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp39-cp39-win_amd64.whl
| Download URL | echomirror_sdk-0.1.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
56a21c0c1689f5aa3c288754cae6bd22a4f63d6f23dcf10bde58a2811ae2226b
|
|
BLAKE2b-256 checksum How to use checksums |
13c5c15501aabbe0453b07056cc2fd34bd7741decba17f01eec963681cb8e83a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | echomirror_sdk-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e6df7d43809e7208e382dcf2dbca0d3fe708bdc2e767f0dd7e80443eaf4c717f
|
|
BLAKE2b-256 checksum How to use checksums |
e77c3451b8cf28c86bb9f75b4940acf2913d469da611ed88a105a837e815e193
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / echomirror_sdk-0.1.0-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | echomirror_sdk-0.1.0-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.9 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7b56ad089a66dbb963c6ab692a1187f068f4d65b0e38870dc3d74e0084d4287b
|
|
BLAKE2b-256 checksum How to use checksums |
a063fd9b950deabe881ea707b44b0e4df6cb907657b4efc0741a3124ddcb5218
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Security for echomirror-sdk 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.