# dYdX Chain Client for Python

Python client for dYdX (v4 API).

### Repository: [v4-client-py](https://github.com/dydxprotocol/v4-clients/tree/main/v4-client-py)

***

## Installation

The `v4-client-py` package is available on [PyPI](https://pypi.org/project/v4-client-py). Install with `pip`

```
pip install v4-client-py
```

***

## Development Setup - VS Code

Install Microsoft Python extensions

```
Shift-Command-P: Create Python Environment
Select Venv
Select Python 3.9 as interpreter
Select requirements.txt as the dependencies to install
```

Install requirements

```
pip install -r requirements.txt
```

VS Code will automatically switch to .venv environment when running example code. Or you can manually switch

```
source ~/<project_dir>/.venv/bin/activate
```

Set PYTHONPATH

```
export PYTHONPATH=~/<project_dir>/.venv/lib/<Python version>/site-packages
```

***

## Troubleshootimg

Cython and Brownie must be installed before cytoolz

If there is any issue with cytoolz, uninstall cytoolz, Brownie and Cython, reinstall Cython, Brownie and cytoolz sequentially.

VS Code may need to be restarted to have Cython functioning correctly
