pip install politikontroller-py
from politikontroller_py import Client
client = Client.initialize("4790112233", "super-secret")
async def main():
police_controls = await client.get_controls(63, 11)
print(police_controls)
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)
async def main():
police_controls = await client.get_controls(63, 11)
print(police_controls)
from aiohttp import ClientSession
from politikontroller_py import Client
async def main():
async with ClientSession() as session:
client = Client.initialize("4790112233", "super-secret", session=session)
police_controls = await client.get_controls(63, 11)
print(police_controls)
$ politikontroller --help
Usage: politikontroller [OPTIONS] COMMAND [ARGS]...
Connect to politikontroller.no and fetch data in a simple way.
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:
account-auth activate account
account-auth-sms activate account by sms
account-register register new account
account-send-sms send activation sms
check server health check.
exchange-points exchange points (?)
get-control get details on a control.
get-control-types get a list of control types.
get-controls get a list of all active controls.
get-controls-radius get all active controls inside a radius.
get-maps get own maps.
get-settings get own settings.