https://github.com/guilyx/python-nexo
A python wrapper for Nexo Pro's API
https://github.com/guilyx/python-nexo
api api-wrapper binance bitcoin cryptocurrency cryptotrading ftx nexo python rest trading trading-api
Last synced: 5 months ago
JSON representation
A python wrapper for Nexo Pro's API
- Host: GitHub
- URL: https://github.com/guilyx/python-nexo
- Owner: guilyx
- License: mit
- Created: 2022-10-01T20:44:29.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-29T22:56:09.000Z (10 months ago)
- Last Synced: 2025-01-30T07:17:22.331Z (8 months ago)
- Topics: api, api-wrapper, binance, bitcoin, cryptocurrency, cryptotrading, ftx, nexo, python, rest, trading, trading-api
- Language: Python
- Homepage:
- Size: 75.2 KB
- Stars: 12
- Watchers: 1
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unofficial Nexo API Wrapper (Python)
β¨ A Python wrapper for the Nexo Pro API β¨

[](https://github.com/guilyx/python-nexo/actions/workflows/tests.yml)
[](https://codecov.io/gh/guilyx/python-nexo)
[](https://www.codefactor.io/repository/github/guilyx/python-nexo)
[](http://isitmaintained.com/project/guilyx/python-nexo "Percentage of issues still open")

[](https://pypi.python.org/pypi/python-nexo/)
[](https://github.com/guilyx/python-nexo/blob/master/LICENSE)
[](https://GitHub.com/guilyx/python-nexo/graphs/contributors/)
[Report Bug](https://github.com/guilyx/python-nexo/issues) Β· [Request Feature](https://github.com/guilyx/python-nexo/issues)## About Nexo πΈ
Nexo is a crypto lending platform that lets you borrow crypto or cash by placing your crypto as collateral. They offer high APY on holdings based on loyalty tier (the more Nexo token you hold the higher your tier). You can earn your interests in the same kind of your holding or as Nexo tokens. As an example, stablecoins can earn up to 12% APY. Bitcoin and Ethereum, 8%.
Unfortunately, Nexo doesn't offer some automated way of buying periodically. All you can do is setup a bank transfer and then convert/buy manually. This API Wrapper aims to offer a way of automating your purchases. You'd just have to setup your periodic bank transfer to Nexo, and then buy at spot price the coins that you want in an automated way by using the wrapped API calls.
## Description π°
This is an unofficial Python wrapper for the Nexo Pro exchange REST API v1. I am in no way affiliated with Nexo, use at your own risk.
If you came here looking for the Nexo exchange to purchase cryptocurrencies, then go to the official Nexo website. If you want to automate interactions with Nexo, stick around.
[Click here to register a Nexo account](https://nexo.io/ref/vaqo55u5py?src=web-link)
Heavily influenced by [python-binance](https://github.com/sammchardy/python-binance)
You can check which endpoints are currently functional [here](https://github.com/guilyx/python-nexo/blob/master/docs/endpoints.md)
- β¨ Work in Progress
- π Built with Python
- π Docker Available
- π» Actively Maintained## Roadmap π±
See it on Issue https://github.com/guilyx/python-nexo/issues/2
Checkout the [Changelog](https://github.com/guilyx/python-nexo/blob/master/docs/changelog.md)## Preparation π
- Register a Nexo Account. [here](https://nexo.io/ref/vaqo55u5py?src=web-link)
- Generate an API Key in Nexo Pro with the permissions you want.## Advice
Priviledge Async Client. The advantage of async processing is that we donβt need to block on I/O which is every action that we make when we interact with the Nexo Pro servers.
By not blocking execution we can continue processing data while we wait for responses or new data from websockets.
## Set it up πΎ
### PIP
1. Install the pip package: `python3 -m pip install python-nexo`
2. Explore the API:```python3
#### Syncimport nexo
import os
from dotenv import load_dotenv# Loads your API keys from the .env file you created
load_dotenv()
key = os.getenv("NEXO_PUBLIC_KEY")
secret = os.getenv("NEXO_SECRET_KEY")# Instantiate Client and grab account balances
c = nexo.Client(key, secret)
balances = c.get_account_balances()
print(balances)#### Async
import nexo
import os
import asyncio
from dotenv import load_dotenvload_dotenv()
key = os.getenv("NEXO_PUBLIC_KEY")
secret = os.getenv("NEXO_SECRET_KEY")async def main():
client = await nexo.AsyncClient.create(key, secret)
print(await client.get_account_balances())await client.close_connection()
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```### Docker (source)
1. Clone the Project: `git clone -b master https://github.com/guilyx/python-nexo.git`
2. Move to the Repository: `cd python-nexo`
3. Create a copy of `.env.example` and name it `.env`
4. Fill up your API Key/Secret
5. Build and Compose the Docker: `docker-compose -f docker/docker-compose.yml up` - The container should keep running so that you can explore the API
6. Attach to the docker: `docker exec -it $(docker ps -qf "name=docker_python-nexo") /bin/bash`
7. Run python in the docker's bash environment: `python3`
8. From there, copy the following snippet to instantiate a Client:```python3
import nexo
import os
nexo_key = os.getenv("NEXO_PUBLIC_KEY")
nexo_secret = os.getenv("NEXO_SECRET_KEY")
assert(nexo_key)
assert(nexo_secret)
c = nexo.Client(nexo_key, nexo_secret)
```9. You can now explore the client's exposed endpoints, for instance:
```python3
balances = c.get_account_balances()
print(balances)
```## Contribute π
Open an issue to state clearly the contribution you want to make. Upon aproval send in a PR with the Issue referenced. (Implement Issue #No / Fix Issue #No).
## Maintainers βοΈ
- Erwin Lejeune
## Buy me a Coffee
*ERC-20 / EVM: **0x07ed706146545d01fa66a3c08ebca8c93a0089e5***
*BTC: **bc1q3lu85cfkrc20ut64v90y428l79wfnv83mu72jv***
*DOT: **1Nt7G2igCuvYrfuD2Y3mCkFaU4iLS9AZytyVgZ5VBUKktjX***
*DAG: **DAG7rGLbD71VrU6nWPrepdzcyRS6rFVvfWjwRKg5***
*LUNC: **terra12n3xscq5efr7mfd6pk5ehtlsgmaazlezhypa7g***