A micro rest client
Project description
RestClientMicro
Run REST calls
Usage
from rest_client_micro.rest_client import RESTClient as rc
from rest_client_micro.rest_object import RESTObject as ro
rest_object = ro()
rest_object.endpoint = 'https://api.scryfall.com/cards/named'
rest_object.params = {'exact':'Overgrown Tomb'}
rest_client = rc()
result = rest_client.execute(rest_object)
print(result)
e.g
runs a Magic the Gathering card search against the exact name 'Overgrown Tomb'.
Returns the content of the response
{
'error': False,
'response':"{\"object\":\"card\",\"id\":\"eff1f52c-5c43-4260-aaa0-6920846a191c\",\"oracle_id\":\"975ec9a3-6f20-4177-8211-82526e092538\",\"multiverse_ids\":[453003],\"mtgo_id\":69919,\"arena_id\":68734,\"tcgplayer_id\":175196,\"cardmarket_id\":363554,\"name\":\"Overgrown Tomb\",.....ll\"}}"
}
Or an object describing an error
{
"error":True,
"description":"Resource not found"
}
or
{
"error":True,
"description":"Unterminated string starting at: line 1 column 14 (char 13)"
}
Build
python -m build
python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
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 rest_client_micro-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b021e995857c4da2d0c61802c99cf25a05bfb2a9ce9a0d18fe4be883b4e66515 |
|
MD5 | 5adf992bb31f772c8519f4d79256d96b |
|
BLAKE2b-256 | d40c6a44e10d5e21af286cfa5ed4a754544c938efce87ec624df56dfa371dfba |