Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Major README update
Browse files Browse the repository at this point in the history
  • Loading branch information
shanefontaine committed Dec 29, 2018
1 parent 999d902 commit 899c6e3
Showing 1 changed file with 80 additions and 8 deletions.
88 changes: 80 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,94 @@ _I am in no way affiliated with or funded by Ethfinex, Ethfinex Trustless, Ethfi
- [Easy trading directly against Ethfinex Trustless, Bitfinex and Ethfinex orderbooks](https://blog.ethfinex.com/introducing-ethfinex-trustless-2f7390955fe0/)
- Simple parsing of data returned from the Ethfinex API

## Under Development
- Better error handling
- Tests

## Getting Started
- TODO
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.

## Examples
- TODO
- https://www.ethfinex.com/api_docs

## TODO
- Error handling
- Add tests
- Add CI
You may manually install the project or use pip:

```python
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

```python
import ethfinex
public_client = ethfinex.PublicClient()
```

### PublicClient Methods
- [get_platform_status](https://docs.bitfinex.com/v2/reference#rest-public-platform-status)
```python
public_client.get_platform_status()
```

- [get_ticker](https://docs.bitfinex.com/v2/reference#rest-public-ticker)
```python
# Get the ticker for a specific pair.
public_client.get_ticker('tBTCUSD')
```

- [get_trades](https://docs.bitfinex.com/v2/reference#rest-public-trades)
```python
# 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_books](https://docs.bitfinex.com/v2/reference#rest-public-books)
```python
# 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_stats](https://docs.bitfinex.com/v2/reference#rest-public-stats)
```python
# 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_candles](https://docs.bitfinex.com/v2/reference#rest-public-candles)
```python
# 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
- TODO
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
Expand Down

0 comments on commit 899c6e3

Please sign in to comment.