stellar-model is based on pydantic, you can use it to parse the JSON returned by Stellar Horizon into Python models, through it, you can get a better development experience in the editor with things like code completion, type hints, and more.
Installing
You need to choose a suitable stellar-model version according to the Horizon version number you are using. Please check the list here.
pip install stellar-model==0.7.0
Example
import requests
from stellar_model import AccountResponse
url = "https://horizon.stellar.org/accounts/GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO"
raw_resp = requests.get(url).json()
parsed_resp = AccountResponse.model_validate(raw_resp)
print(f"Account Sequence: {parsed_resp.sequence}")
Of course you can use it with stellar-sdk.
from stellar_sdk import Server
from stellar_model import AccountResponse
server = Server("https://horizon.stellar.org")
account_id = "GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO"
raw_resp = server.accounts().account_id(account_id).call()
parsed_resp = AccountResponse.model_validate(raw_resp)
print(f"Account Sequence: {parsed_resp.sequence}")
Documentation
stellar-model’s documentation can be found at https://stellar-model.readthedocs.io
Metadata
Release files for stellar-model 0.7.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 | |
|---|---|---|---|---|
| stellar_model-0.7.0.tar.gz | 25.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stellar_model-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.2 kB
Release files / stellar_model-0.7.0.tar.gz
| Download URL | stellar_model-0.7.0.tar.gz |
|---|---|
| Size | 25.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
270c6259e89127b056bc92e99cda9145ace7b62e5568697b78565e6260923a54
|
|
BLAKE2b-256 checksum How to use checksums |
c48e15a723d8743960e186af4448bda199cedcbfa5d2fbb3d0e1a9e068236798
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.7 Darwin/24.6.0
|
Release files / stellar_model-0.7.0-py3-none-any.whl
| Download URL | stellar_model-0.7.0-py3-none-any.whl |
|---|---|
| Size | 50.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
460a426f0f0755d34578b7869560cce2cdb426c3de83f33faaec57e98916d9dc
|
|
BLAKE2b-256 checksum How to use checksums |
89b49ef1aafde31dd376f571ac579f7848369a38d5a2ef87469723a99419987c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.7 Darwin/24.6.0
|
Security for stellar-model 0.7.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.