Metadata-Version: 2.1
Name: politikontroller-py
Version: 2.0.0
Summary: Unofficial client for politikontroller.no
License: MIT
Author: Bendik R. Brenne
Author-email: bendik@konstant.no
Requires-Python: >=3.10,<3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: aiohttp (>=3.8.6,<4.0.0)
Requires-Dist: anyio (>=4.0.0,<5.0.0)
Requires-Dist: asyncclick (>=8.1.3.4,<9.0.0.0)
Requires-Dist: asyncio (>=3.4.3,<4.0.0)
Requires-Dist: geojson (>=3.0.1,<4.0.0)
Requires-Dist: pycryptodome (>=3.18.0,<4.0.0)
Requires-Dist: pydantic (>=1.10.13,<2.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: rich (>=13.4.1,<14.0.0)
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
Description-Content-Type: text/markdown

# politikontroller-py

## Install

```bash
pip3 install politikontroller-py
```

## Usage

```python
from politikontroller_py import Client
from politikontroller_py.models import Account

# A valid registered user @ politikontroller.no
user = Account(
    username="4790112233",  # Include 2 digit prefix - or else DEFAULT_COUNTRY is assumed
    password="super-secret",
)

client = Client(user)

police_controls = client.get_controls(63, 11)

```


## CLI tool

```bash
$ politikontroller --help
Usage: politikontroller [OPTIONS] COMMAND [ARGS]...

  Username and password can be defined using env vars:

  POLITIKONTROLLER_USERNAME
  POLITIKONTROLLER_PASSWORD

Options:
  -u, --username TEXT  Username (i.e. phone number)  [required]
  -p, --password TEXT  Password  [required]
  --debug              Set logging level to DEBUG
  --help               Show this message and exit.

Commands:
  exchange-points      exchange points (?)
  get-control          get details on a control.
  get-controls         get a list of all active controls.
  get-controls-radius  get all active controls inside a radius.
  get-maps             get own maps.
```

