No project description provided
Project description
Gemini Public API
The gemini-public-api is an unofficial Python implementation of the public Gemini REST API. It provides a simple interface for interacting with the Gemini cryptocurrency exchange, supporting both synchronous and asynchronous communication.
Installation
To get the Gemini Public API Python client running on your local machine, use pip:
pip3 install gemini-public-api
Please make sure that you have Python 3.6 or newer, as this library requires it.
Usage
Synchronous Usage
from gemini_public_api import api
symbols = api.get_symbols()
print(symbols.json())
Asynchronous Usage
The library relies on the aiohttp package for truly asynchronous execution. The SessionContextManager context manager is used for making async requests. Here's how to fetch the available symbols asynchronously:
from gemini_public_api.aiohttp import api
from gemini_public_api.aiohttp.session_context_manager import SessionContextManager
async with SessionContextManager() as session:
response = await api.get_symbols(session)
async with response as resp:
data = await resp.json()
print(data)
Alternatively, without the context manager:
import aiohttp
from gemini_public_api.aiohttp import api
session = aiohttp.ClientSession()
response = await api.get_symbols(session)
async with response as resp:
data = await resp.json()
print(data)
await session.close()
Dependencies
gemini-public-api is built with:
- poetry - A tool for dependency management and packaging in Python.
- hypothesis - A powerful, flexible, and easy-to-use library for property-based testing.
- requests - The definitive library for making HTTP requests in Python.
- aiohttp - An asynchronous HTTP client/server framework for asyncio and Python.
Authors
- mpol1t
License
This project is licensed under the MIT License
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gemini_public_api-0.11.0.tar.gz.
File metadata
- Download URL: gemini_public_api-0.11.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.1 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b9f5c812960fdcb0402a1712b89e8008cfe11da4788d9b65b1dfee3aa05a30c
|
|
| MD5 |
8dcaf77ba6ff5dd0f197702c557d69c9
|
|
| BLAKE2b-256 |
1627e8343fdfed43744f6173535fdeffb03d919c0abc018f6acfc377cc31bb2f
|
File details
Details for the file gemini_public_api-0.11.0-py3-none-any.whl.
File metadata
- Download URL: gemini_public_api-0.11.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.1 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98e87e6bfa76b77644f97c506bed30298b87b4a4d75781e0eae51041eeeb5c49
|
|
| MD5 |
178c4ae0d1808aa8d7db6e5b356a4d99
|
|
| BLAKE2b-256 |
b1b8f34c9084b76ac82b45f4222aa3dcbe1e25de9e11df843f29e9d2eb54e7b1
|