geminitools
Geminitools is a Python package that can help you talk to the Gemini Exchange REST API.
Geminitools is a simple API. You can't interface 1:1 with the Gemini Exchange API with geminitools. There are other packages for that. Instead, the main thing you can do is buy. As of yet there is no sell option (why would you want to anyway?).
Installation
pip install geminitools
Example Usage
import geminitools
gem = geminitools.Gem('https://api.gemini.com', 'key', 'secret')
gem.place_cost_buy_order('BTCUSD', 10, 70000)
API
class geminitools.Gem(base_url, key, secret)
get_supported_symbols()
Make a call to the /v1/symbols endpoint and return a list of accepted symbols.
get_ticker_price(symbol, price_type='ask')
Make a call to the /v1/pubticker/ endpoint and return the value defined by price_type - defaults to 'ask', the asking price.
convert_cost_to_asset_amount(symbol, cost, rounded=8)
Divides cost by the current ticker price given by symbol rounding to rounded decimal places, and returns the resulting asset amount.
E.g. if symbol is 'btcusd', cost is 50 (USD) and the current ticker price is 60000 (USD), the result would be 50 / 60000 = 0.00083333 (BTC)
place_amount_buy_order(symbol, amount, price)
Make a call to the /v1/order/new endpoint, placing a buy order for amount with a limit of price, and returns the API response. If you pass symbol 'BTCUSD', amount would be the quantity of BTC you want to buy, while price would be the max USD market price you're willing to pay.
E.g. amount = 0.1 and price = 10000 would cause 0.1 BTC to be bought if the price of BTC is less than or equal to 10000 USD.
place_cost_buy_order(symbol, cost, price)
Similar to place_asset_buy_order but calculates the amount of the asset to buy based on the cost passed. Returns the API response.
E.g. Passing symbol 'BTCUSD' and a cost value of 10 would cause the order of 10 USD worth of BTC to be bought.
Metadata
Release files for geminitools 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geminitools-0.0.2.tar.gz | 19.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geminitools-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.1 kB
Release files / geminitools-0.0.2.tar.gz
| Download URL | geminitools-0.0.2.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d54d630283aec41cb5767a02c072c2e940a7ed9dcc09043dc9208e6fb838b5c0
|
|
BLAKE2b-256 checksum How to use checksums |
90ed753184550bbe830cfd4f48900ee9850a7f65f37387d6858712626319537c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.3
|
Release files / geminitools-0.0.2-py3-none-any.whl
| Download URL | geminitools-0.0.2-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df448c769e166c2b045fdf5a690f86250527238ca3ae434a35de971cb5f7e59c
|
|
BLAKE2b-256 checksum How to use checksums |
67b37551368dc3caef1719f6335b59801e5abe7ddd613feec3cc907a364a1cdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.3
|