Python library for interacting with the Goated Exchange API.
Project description
Goated Python Library
A handy library to interacting with, sourcing information from and trading on the Goated Exchange.
Creating an authenticated Client to interact with the API using email and password
from goated.client import TradingClient
# Create a Goated Client Object to interact with the API
client = TradingClient.create_with_login(
url = "https://api.goated.com",
email = "YOUR_GOATED_EMAIL",
password = "YOUR_GOATED_PASSWORD"
)
Or using API Key and Secret (available from account tab)
from goated.client import TradingClient
# Create a Goated Client Object to interact with the API
client = TradingClient.create_with_api_key(
url = "https://api.goated.com",
api_key = "YOUR_GOATED_API_KEY",
api_secret = "YOUR_GOATED_API_SECRET"
)
Creating a State container, sourcing and loading some user information into the container
# Create a State Container object to hold relational state
state = Container()
# Get balances response from API
balances_response = client.get_balances()
# Add/update it within the state container
state.update_balances(balances_response)
# Get positions response from API
positions_response = client.get_positions() # Without any filters
# Add/update it within the state container
state.update_positions(positions_response)
# Get orders response from API
orders_response = client.get_orders() # Without any filters
# Add/update it within the state container
state.update_orders(orders_response)
print(state.__dict__)
Sourcing information from the API
# Get all categories
categories = client.get_categories() # Without any filters
print('Categories:')
print(categories)
# Get subcategory record for first category
category_id = categories[0].get('id')
subcategories = client.get_subcategories(
category_ids=[category_id]
) if category_id != None else []
print('Subcategories:')
print(subcategories)
# Get events in the first subcategory
subcategory_id = subcategories[0].get('id') if len(subcategories) > 0 else None
events = client.get_events(
subcategory_ids=[subcategory_id]
) if subcategory_id != None else []
print('Events:')
print(events)
# Get all markets in the first event
event_id = events[0].get('id') if len(events) > 0 else None
markets = client.get_markets(
event_id=[event_id]
) if event_id != None else []
print('Markets:')
print(markets)
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
goated-0.0.7.tar.gz
(26.0 kB
view details)
Built Distribution
goated-0.0.7-py3-none-any.whl
(34.9 kB
view details)
File details
Details for the file goated-0.0.7.tar.gz
.
File metadata
- Download URL: goated-0.0.7.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3879a33fb9296abb0602287c69978d56581a8fe14b761d9231fbe4a7522eaa6 |
|
MD5 | cde6a2896ae7069500bb09ddf840fd9f |
|
BLAKE2b-256 | 4257b908720159f0829cfc02899cee9c2029fc0af1e4a0a480f3e096bf61cad9 |
File details
Details for the file goated-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: goated-0.0.7-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4bb0e510a331bce696aa73595134b5096c5388511fe4dc862d4d857df268da |
|
MD5 | 55cc0f64465789aa5bcbaaf1c7d4366c |
|
BLAKE2b-256 | eb6ef2bbc91fc8cf0e7f2e374b2a2a499a8fda4fcd0f736c8f6064f1c3c348cd |