Skip to main content

An unofficial python wrapper for the Ethfinex exchange

Project description

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.

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

ethfinex-python-0.1.2.tar.gz (5.6 kB view details)

Uploaded Source

File details

Details for the file ethfinex-python-0.1.2.tar.gz.

File metadata

  • Download URL: ethfinex-python-0.1.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for ethfinex-python-0.1.2.tar.gz
Algorithm Hash digest
SHA256 41a3097bbdaad74b04061b53b01dd7bbe2b05201df1eb69440dbb2a22e184b20
MD5 24926bfe37ab46d3c4a6ce53a7dd634a
BLAKE2b-256 ef198186d960315dfc24c48ac9a20ed91de4f1acc8c8c6a19ad9cdbed6a87cd7

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