python-nexo


Namepython-nexo JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/guilyx/python-nexo
SummaryNexo Pro REST API python implementation
upload_time2022-12-04 13:23:40
maintainer
docs_urlNone
authorErwin Lejeune
requires_python
licenseMIT
keywords nexo crypto exchange rest api bitcoin ethereum btc eth neo
VCS
bugtrack_url
requirements aiohttp requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

# Unofficial Nexo API Wrapper (Python)

✨ A Python wrapper for the Nexo Pro API ✨

</div>

<div align="center">
    
![lint](https://github.com/guilyx/python-nexo/workflows/lint/badge.svg?branch=master)
[![tests](https://github.com/guilyx/python-nexo/actions/workflows/tests.yml/badge.svg)](https://github.com/guilyx/python-nexo/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/guilyx/python-nexo/branch/master/graph/badge.svg?token=GXUOT9P1WE)](https://codecov.io/gh/guilyx/python-nexo)
[![CodeFactor](https://www.codefactor.io/repository/github/guilyx/python-nexo/badge)](https://www.codefactor.io/repository/github/guilyx/python-nexo)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/guilyx/python-nexo.svg)](http://isitmaintained.com/project/guilyx/python-nexo "Percentage of issues still open")
![PipPerMonths](https://img.shields.io/pypi/dm/python-nexo.svg)
[![Pip version fury.io](https://badge.fury.io/py/python-nexo.svg)](https://pypi.python.org/pypi/python-nexo/)
[![GitHub license](https://img.shields.io/github/license/guilyx/python-nexo.svg)](https://github.com/guilyx/python-nexo/blob/master/LICENSE)
[![GitHub contributors](https://img.shields.io/github/contributors/guilyx/python-nexo.svg)](https://GitHub.com/guilyx/python-nexo/graphs/contributors/)

</div>

<div align="center">
    
[Report Bug](https://github.com/guilyx/python-nexo/issues) Β· [Request Feature](https://github.com/guilyx/python-nexo/issues)

</div>

## 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
#### Sync

import 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_dotenv

load_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: **0xcC1C1E8F5fD3c832d970C8d5A62Ff9dD74259B1f***

*BTC: **bc1q0c45w3jvlwclvuv9axlwq4sfu2kqy4w9xx225j***

*DOT: **1Nt7G2igCuvYrfuD2Y3mCkFaU4iLS9AZytyVgZ5VBUKktjX***

*DAG: **DAG7rGLbD71VrU6nWPrepdzcyRS6rFVvfWjwRKg5***

*LUNC: **terra12n3xscq5efr7mfd6pk5ehtlsgmaazlezhypa7g***

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/guilyx/python-nexo",
    "name": "python-nexo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "nexo crypto exchange rest api bitcoin ethereum btc eth neo",
    "author": "Erwin Lejeune",
    "author_email": "erwin.lejeune15@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/12/4d/1b0aa92a7066e4bcf12a1ceafa18f9448bec97e8dc1ea51bc935f2c3244e/python-nexo-1.0.3.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# Unofficial Nexo API Wrapper (Python)\n\n\u2728 A Python wrapper for the Nexo Pro API \u2728\n\n</div>\n\n<div align=\"center\">\n    \n![lint](https://github.com/guilyx/python-nexo/workflows/lint/badge.svg?branch=master)\n[![tests](https://github.com/guilyx/python-nexo/actions/workflows/tests.yml/badge.svg)](https://github.com/guilyx/python-nexo/actions/workflows/tests.yml)\n[![codecov](https://codecov.io/gh/guilyx/python-nexo/branch/master/graph/badge.svg?token=GXUOT9P1WE)](https://codecov.io/gh/guilyx/python-nexo)\n[![CodeFactor](https://www.codefactor.io/repository/github/guilyx/python-nexo/badge)](https://www.codefactor.io/repository/github/guilyx/python-nexo)\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/guilyx/python-nexo.svg)](http://isitmaintained.com/project/guilyx/python-nexo \"Percentage of issues still open\")\n![PipPerMonths](https://img.shields.io/pypi/dm/python-nexo.svg)\n[![Pip version fury.io](https://badge.fury.io/py/python-nexo.svg)](https://pypi.python.org/pypi/python-nexo/)\n[![GitHub license](https://img.shields.io/github/license/guilyx/python-nexo.svg)](https://github.com/guilyx/python-nexo/blob/master/LICENSE)\n[![GitHub contributors](https://img.shields.io/github/contributors/guilyx/python-nexo.svg)](https://GitHub.com/guilyx/python-nexo/graphs/contributors/)\n\n</div>\n\n<div align=\"center\">\n    \n[Report Bug](https://github.com/guilyx/python-nexo/issues) \u00b7 [Request Feature](https://github.com/guilyx/python-nexo/issues)\n\n</div>\n\n## About Nexo \ud83d\udcb8\n\nNexo 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%. \n\nUnfortunately, 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.\n\n## Description \ud83d\udcf0\n\nThis 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.\n\nIf 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.\n\n[Click here to register a Nexo account](https://nexo.io/ref/vaqo55u5py?src=web-link)\n\nHeavily influenced by [python-binance](https://github.com/sammchardy/python-binance)\n\nYou can check which endpoints are currently functional [here](https://github.com/guilyx/python-nexo/blob/master/docs/endpoints.md)\n\n- \u2728 Work in Progress\n- \ud83c\udf8c Built with Python\n- \ud83d\udc0b Docker Available\n- \ud83c\udf7b Actively Maintained\n\n## Roadmap \ud83c\udf31\n\nSee it on Issue https://github.com/guilyx/python-nexo/issues/2\nCheckout the [Changelog](https://github.com/guilyx/python-nexo/blob/master/docs/changelog.md)\n\n## Preparation \ud83d\udd0e\n\n- Register a Nexo Account. [here](https://nexo.io/ref/vaqo55u5py?src=web-link)\n- Generate an API Key in Nexo Pro with the permissions you want.\n\n## Advice\n\nPriviledge Async Client. The advantage of async processing is that we don\u2019t need to block on I/O which is every action that we make when we interact with the Nexo Pro servers.\n\nBy not blocking execution we can continue processing data while we wait for responses or new data from websockets.\n\n## Set it up \ud83d\udcbe\n\n### PIP\n\n1. Install the pip package: `python3 -m pip install python-nexo`\n2. Explore the API:\n\n```python3\n#### Sync\n\nimport nexo\nimport os\nfrom dotenv import load_dotenv\n\n# Loads your API keys from the .env file you created\nload_dotenv()\nkey = os.getenv(\"NEXO_PUBLIC_KEY\")\nsecret = os.getenv(\"NEXO_SECRET_KEY\")\n\n# Instantiate Client and grab account balances\nc = nexo.Client(key, secret)\nbalances = c.get_account_balances()\nprint(balances)\n\n#### Async\n\nimport nexo\nimport os\nimport asyncio\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nkey = os.getenv(\"NEXO_PUBLIC_KEY\")\nsecret = os.getenv(\"NEXO_SECRET_KEY\")\n\nasync def main():\n    client = await nexo.AsyncClient.create(key, secret)\n    print(await client.get_account_balances())\n\n    await client.close_connection()\n\nif __name__ == \"__main__\":\n    loop = asyncio.get_event_loop()\n    loop.run_until_complete(main())\n```\n\n### Docker (source)\n\n1. Clone the Project: `git clone -b master https://github.com/guilyx/python-nexo.git`\n2. Move to the Repository: `cd python-nexo`\n3. Create a copy of `.env.example` and name it `.env`\n4. Fill up your API Key/Secret\n5. 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\n6. Attach to the docker: `docker exec -it $(docker ps -qf \"name=docker_python-nexo\") /bin/bash`\n7. Run python in the docker's bash environment: `python3`\n8. From there, copy the following snippet to instantiate a Client:\n\n```python3\nimport nexo\nimport os\nnexo_key = os.getenv(\"NEXO_PUBLIC_KEY\")\nnexo_secret = os.getenv(\"NEXO_SECRET_KEY\")\nassert(nexo_key)\nassert(nexo_secret)\nc = nexo.Client(nexo_key, nexo_secret)\n```\n\n9. You can now explore the client's exposed endpoints, for instance:\n\n```python3\nbalances = c.get_account_balances()\nprint(balances)\n```\n\n## Contribute \ud83c\udd98\n\nOpen 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).\n\n## Maintainers \u24c2\ufe0f\n\n- Erwin Lejeune\n\n## Buy me a Coffee\n\n*ERC-20 / EVM: **0xcC1C1E8F5fD3c832d970C8d5A62Ff9dD74259B1f***\n\n*BTC: **bc1q0c45w3jvlwclvuv9axlwq4sfu2kqy4w9xx225j***\n\n*DOT: **1Nt7G2igCuvYrfuD2Y3mCkFaU4iLS9AZytyVgZ5VBUKktjX***\n\n*DAG: **DAG7rGLbD71VrU6nWPrepdzcyRS6rFVvfWjwRKg5***\n\n*LUNC: **terra12n3xscq5efr7mfd6pk5ehtlsgmaazlezhypa7g***\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Nexo Pro REST API python implementation",
    "version": "1.0.3",
    "split_keywords": [
        "nexo",
        "crypto",
        "exchange",
        "rest",
        "api",
        "bitcoin",
        "ethereum",
        "btc",
        "eth",
        "neo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "72194b94ef79c35ae0c010133248b13a",
                "sha256": "a04e763af159cbf268776587649860c9e964792ed05ec3ba7b193532b6c0beed"
            },
            "downloads": -1,
            "filename": "python_nexo-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "72194b94ef79c35ae0c010133248b13a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13820,
            "upload_time": "2022-12-04T13:23:37",
            "upload_time_iso_8601": "2022-12-04T13:23:37.035425Z",
            "url": "https://files.pythonhosted.org/packages/2b/c1/1206126d0a3eedb45eedf8b24d7ef396d680102443b566e6f61d5444da3f/python_nexo-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "2dd5de5b365eea69d7cb763ee93dd1a8",
                "sha256": "caf8b2e1badb3e048209b514ce103e77aacc9e0d37ae65c790c68f6b7c5b91e5"
            },
            "downloads": -1,
            "filename": "python-nexo-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2dd5de5b365eea69d7cb763ee93dd1a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13031,
            "upload_time": "2022-12-04T13:23:40",
            "upload_time_iso_8601": "2022-12-04T13:23:40.489388Z",
            "url": "https://files.pythonhosted.org/packages/12/4d/1b0aa92a7066e4bcf12a1ceafa18f9448bec97e8dc1ea51bc935f2c3244e/python-nexo-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-04 13:23:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "guilyx",
    "github_project": "python-nexo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiohttp",
            "specs": [
                [
                    "==",
                    "3.8.3"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.28.1"
                ]
            ]
        }
    ],
    "lcname": "python-nexo"
}
        
Elapsed time: 0.01860s