63 lines
867 B
Markdown
63 lines
867 B
Markdown
# FairHopper Python SDK
|
|
|
|
Requirements:
|
|
- Python 3.7+
|
|
|
|
## Setting up environment
|
|
|
|
### Recommended: Using Poetry
|
|
|
|
Project uses [Poetry](https://python-poetry.org), ultimate dependency management software for Python.
|
|
|
|
Install Poetry:
|
|
```sh
|
|
pip install poetry
|
|
```
|
|
|
|
Install virtual environment:
|
|
```sh
|
|
poetry install
|
|
```
|
|
|
|
### Simple: Using virtualenv
|
|
|
|
Create virtual environment:
|
|
```sh
|
|
virtualenv .env
|
|
```
|
|
|
|
Activate virtual environment:
|
|
```sh
|
|
source .env/bin/activate
|
|
```
|
|
|
|
Install required dependencies:
|
|
```sh
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
## Running demo
|
|
|
|
Check `demo.py` for usage example.
|
|
|
|
Edit `demo.py` and configure FairHopper Game host settings:
|
|
|
|
```python
|
|
FAIRHOPPER_HOST = "http://127.0.0.1:8010"
|
|
```
|
|
|
|
Activate environment and run example:
|
|
|
|
### Poetry
|
|
|
|
```sh
|
|
poetry shell
|
|
python demo.py
|
|
```
|
|
|
|
### Virtualenv
|
|
```sh
|
|
source .env/bin/activate
|
|
python demo.py
|
|
```
|