Skip to main content

ethfinex-python

Build Status Downloads License

The unofficial Python client for the Ethfinex and Ethfinex Trustless APIs.

Provided under MIT License by Shane Fontaine.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

I am in no way affiliated with or funded by Ethfinex, Ethfinex Trustless, Ethfinex Inc., Bitfinex, iFinex Inc., Tether, Tether Limited, or any subsidiaries or affiliates of any of the previously mentioned entities.

Functionality

Under Development

  • Better error handling
  • Tests

Getting Started

This README is documentation on the syntax of the python client presented in this repository. See function docstrings for full syntax details. This API attempts to present a clean interface to Ethfinex, but in order to use it to its full potential, you must familiarize yourself with the official Ethfinex documentation.

You may manually install the project or use pip:

pip install ethfinex-python

# or

pip install git+git://github.com/shanefontaine/ethfinex-python.git

Public Client

Only some endpoints in the API are available to everyone. The public endpoints can be reached using PublicClient

import ethfinex
public_client = ethfinex.PublicClient()

PublicClient Methods

public_client.get_platform_status()
# Get the ticker for a specific pair.
public_client.get_ticker('tBTCUSD')
# Get the trades for a specific pair
public_client.get_trades('tBTCUSD')
# To include a start and end time
public_client.get_trades('tBTCUSD', start=1514764800000, end=1514765700000)
# To reverse the order that data is delivered (old to new)
public_client.get_trades('tBTCUSD', start=1514764800000, end=1514765700000, sort=1)
# Get the books for a specific pair
public_client.get_books('tBTCUSD')
# To get more or less granular precision
public_client.get_books('tBTCUSD', precision='P1')
# Get the stats for a specific pair
public_client.get_stats('tBTCUSD', 'funding.size', 'long', 'hist')
# To reverse the order that data is delivered (old to new)
public_client.get_stats('tBTCUSD', 'funding.size', 'long', 'hist', sort=1)
# Get the candles for a specific pair
public_client.get_candles('tBTCUSD', '1m', 'hist')
# To include a start and end time
public_client.get_candles('tBTCUSD', '1m', 'hist', start=1514764800000, end=1514765700000)

Testing

Unit tests are under development using the pytest framework. Contributions are welcome!

To run the full test suite, in the project directory run:

python -m pytest

Changelog

0.1.2

  • Major README update

0.1.1

  • Add CI
  • Add public_client tests

0.1.0

  • Fully functional public client.

0.0.1

  • Original PyPI release.

Metadata

Release files for ethfinex-python 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ethfinex-python 0.1.2
File Size Uploaded Provenance Actions
ethfinex-python-0.1.2.tar.gz 5.6 kB Without provenance Details for ethfinex-python-0.1.2.tar.gz

Release files / ethfinex-python-0.1.2.tar.gz

Download URL ethfinex-python-0.1.2.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
41a3097bbdaad74b04061b53b01dd7bbe2b05201df1eb69440dbb2a22e184b20
BLAKE2b-256 checksum
How to use checksums
ef198186d960315dfc24c48ac9a20ed91de4f1acc8c8c6a19ad9cdbed6a87cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Security for ethfinex-python 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page