Skip to main content

No project description provided

Project description

codecov PyPI - Python Version GitHub Workflow Status GitHub

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gemini_public_api-0.10.10.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

gemini_public_api-0.10.10-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file gemini_public_api-0.10.10.tar.gz.

File metadata

  • Download URL: gemini_public_api-0.10.10.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.8.0-1014-azure

File hashes

Hashes for gemini_public_api-0.10.10.tar.gz
Algorithm Hash digest
SHA256 dd4997f2bde7e00d2275d1817c9d4b0cd7687904f18d0029bda82493eb780c35
MD5 c551f4b58af3cae977e8c438e4a3efa2
BLAKE2b-256 eb39bb5432ff055e799643c0240713ff4d33c1f7cbe3dacfe81149aa94b712a3

See more details on using hashes here.

File details

Details for the file gemini_public_api-0.10.10-py3-none-any.whl.

File metadata

File hashes

Hashes for gemini_public_api-0.10.10-py3-none-any.whl
Algorithm Hash digest
SHA256 4a93539d2294d57fb43d29f64a75f85977d097db7cc2b2aa7698c2facb04f496
MD5 7d7efb262ba90bbe41183b8b48a7b896
BLAKE2b-256 26b7376b4658a6cc124132a8faf5375a1c14d317aaab0b5c45ac31d6e9a0eeeb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page