Metadata-Version: 2.4
Name: pyixapi
Version: 0.2.7
Summary: Python API client library for IX-API
License-Expression: Apache-2.0
License-File: LICENSE
Author: Guillaume Mazoyer
Author-email: oss@mazoyer.eu
Requires-Python: >=3.10
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: dev
Requires-Dist: PyJWT (>=2.4.0,<2.11)
Requires-Dist: pytest ; extra == "dev"
Requires-Dist: requests (>=2.32.4,<3.0)
Requires-Dist: ruff (>=0.14,<0.15) ; extra == "dev"
Description-Content-Type: text/markdown

# pyixapi

Python API client library for [IX-API](https://ix-api.net/).

Supported versions are:

* [version 1](https://docs.ix-api.net/v1/) -- deprecated, providers cease date is 2026-07-01
* [version 2](https://docs.ix-api.net/v2/)

## Installation

To install run `pip install pyixapi`.

## Quick Start

To begin, import pyixapi and instantiate the API.

```python
import pyixapi
ixapi = pyixapi.api(
    "https://api.de-cix.net/api/v2/",
    "3LH3G72VH7H1SGogEsFeQOPsGjOQotMUZQRt2pK7YbH",
    "cEtrt8s0vR0CsG0vpAmcaxtnolzZj7DEG0B7izvwPlV",
)
ixapi.authenticate()
```

The first argument the `.api()` method takes is the IX-API URL. The second and
third arguments are the API key and secret used for authentication.

Authenticating will generate a pair of access and refresh tokens that can be
passed as argument to the `.api()` method.


## Queries

The pyixapi API is setup so that IX-API's endpoints are attributes of the
`.api()` object. Each endpoint has a handful of methods available to carry out
actions on the endpoint. For example, in order to query all the objects in the
`network-service-configs` endpoint you would do the following:

```python
>>> nsc = ixapi.network_service_configs.all()
>>> for i in nsc:
...     print(i)
...
DXDB:PAS:00001
DXDB:PAS:00002
DXDB:PAS:00003
DXDB:PAS:00004
DXDB:PAS:00005
DXDB:PAS:00006
DXDB:PAS:00007
DXDB:PAS:00008
>>>
```

Write queries are not implemented yet.

