# XINA API Libraries

We aim to provide a variety of reference XINA API client implementations for different programming languages and environments.

## Python

[xina_api_python_0.4.0.zip](https://smce-xina.s3.amazonaws.com/dist/api/python/xina_api_python_0.4.0.zip)

### Installation

#### Prerequisites

- Python 3.8 or greater

The `xina` client communicates with XINA via the [XINA Tunnel](https://wiki.xina.io/books/utilities/page/xina-tunnel) utility.  You must have it running for the `xina` client to connect.

#### Steps

1. Extract the zip file.
2. Open a terminal in the root extracted directory, and execute the following
   commands:
   ```bash
   python3 -m pip install .
   ```

### Examples

#### Client class

```python
from xina import XPClient

with XPClient() as x:
    res = x.act({'action': 'version'})

print(res)
# => {'schema':100, 'host':'sandbox.xina.io', 'server':'9.1.4', 'team':100}
```

#### CLI

```bash
python -m xina action '{"action":"version"}'
# => {"schema":100,"host":"sandbox.xina.io","server":"9.1.4","team":100}
```