Skip to main content

politikontroller-py

GitHub Release Python Versions Project Maintenance License Made with Love in Norway

Build Status Code coverage

Install

pip install politikontroller-py

Usage

Basic usage

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)

With account

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)

With session

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)

CLI tool

$ 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.

Metadata

Release files for politikontroller-py 3.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for politikontroller-py 3.3.2
File Size Uploaded Provenance
politikontroller_py-3.3.2.tar.gz 16.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for politikontroller-py 3.3.2
File Interpreter ABI Platform
politikontroller_py-3.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 36.0 kB

Release files / politikontroller_py-3.3.2.tar.gz

Download URL politikontroller_py-3.3.2.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
16772bb589519d8d2471b6354eae7ec868e2f53cb4e7cae6b5f763dfb2205206
BLAKE2b-256 checksum
How to use checksums
b730674d51de4e5854383c6ecb14217361ebf5434b71c2c7fd09e6e40b0a5c26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.8

Release files / politikontroller_py-3.3.2-py3-none-any.whl

Download URL politikontroller_py-3.3.2-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7854bf8af1fc017ae7afbd42717d7b1d1eda3edae72e72c88ef8e6d59e987aa
BLAKE2b-256 checksum
How to use checksums
0e59fae04e371a5bacf62dd0f38ab81054f1cfc81a2f4e163d4887a524c7b385
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.8

Security for politikontroller-py 3.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page