Moonstream entity API client library
Project description
Moonstream Entity Python Client
In order to use this client, you will need a Moonstream access token. You can generate one at https://moonstream.to/account/tokens.
The client library reads this token from the MOONSTREAM_ACCESS_TOKEN
environment variable. To set it:
export MOONSTREAM_ACCESS_TOKEN="<your_access_token>"
Collections
Create collection:
entity --token "$MOONSTREAM_ACCESS_TOKEN" collections create --name "My Ethereum addresses"
List collections:
entity --token "$MOONSTREAM_ACCESS_TOKEN" collections list
Delete collection:
export ENTITY_COLLECTION_ID="<your_collection_id>"
entity --token "$MOONSTREAM_ACCESS_TOKEN" collections delete --collection_id "$ENTITY_COLLECTION_ID"
Entities
export ENTITY_COLLECTION_ID="<your_collection_id>"
Create entity:
entity --token "$MOONSTREAM_ACCESS_TOKEN" entities create --collection_id "$ENTITY_COLLECTION_ID" --address "0x000000000000000000000000000000000000dEaD" --blockchain ethereum --name "Dead address" --required_field '{"dead": true}' --required_field '{"owner": "unknown"}' --secondary_field '{"description": "Dangerous address for tokens burning mechanism."}'
Create entity bulk from csv:
Input file addresses.csv
contains list of addresses:
address,name
0xe1991fFb1f2271Bc645293cCDf4e38a3f1b7a13c,Address 1
0x37309157eC7863b04c66B6fB2bf7b21EE8B03bA1,Address 2
entity --token "$MOONSTREAM_ACCESS_TOKEN" entities bulk --blockchain ethereum --collection_id "$ENTITY_COLLECTION_ID" --input addresses.csv --required_field '{"owner": "me"}' --secondary_field '{"description": "My bot address"}'
List entities in collection:
entity --token "$MOONSTREAM_ACCESS_TOKEN" entities list --collection_id "$ENTITY_COLLECTION_ID"
Delete entity:
export ENTITY_ID="<your_entity_id>"
entity --token "$MOONSTREAM_ACCESS_TOKEN" entities delete --collection_id "$ENTITY_COLLECTION_ID" --entity_id "$ENTITY_ID"
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
Built Distribution
Close
Hashes for moonstream_entity-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8e9d73959b36d9efab3f6fd16bad41e943a5a2227d16d7df43c6a701e10d64b |
|
MD5 | 36c7d2062129b4455f370688731c4e34 |
|
BLAKE2b-256 | 376cd19f758ef144521c813faacec8cc37222ce6fc492841c3fdb709c88ab831 |