Skip to main content

Python client library for the Teltonika API.

Project description

Pytonika

PyPI version Python versions License

Pytonika is a lightweight Python client library to interact with Teltonika Networks devices via their Web API. It provides simple device abstractions and grouped endpoint interfaces to make automation and scripting straightforward.

[!IMPORTANT] Pytonika is not an official Teltonika library. This project is maintained by the community and is not affiliated with or endorsed by Teltonika Networks.

Why Pytonika?

Instead of crafting raw HTTP requests against the Teltonika Web API, Pytonika gives you:

  • Device-aware wrappers for routers, gateways, access points and switches with model-specific endpoints.
  • Clean, Pythonic interface — authenticate once and call methods directly.
  • Lightweight — synchronous HTTP client built on top of httpx with zero extra dependencies.

Installation

Requirements

  • Python 3.10+
  • httpx >= 0.28.1

Install from PyPI

pip install pytonika

Quick start

from pytonika import Router

router = Router("http://192.168.1.1/")

# Authenticate
router.authentication.login("admin", "admin01")

# Query device info
router.firmware.get_firmware_device_status()

# Manage WireGuard
router.wireguard.get_wireguard_config()

# Check interfaces
router.interfaces.get_interfaces_status()

# Logout when done
router.authentication.logout()

You can also target a specific device model for access to model-specific endpoints:

from pytonika import RUTX50

device = RUTX50("http://192.168.1.1/")
device.authentication.login("admin", "admin01")

Supported devices

Pytonika provides wrappers for a wide range of Teltonika devices. You can use the generic class per device type or a model-specific subclass.

Routers

Generic class Models
Router DAP140, DAP142, DAP145, OTD140, OTD144, OTD500, RUT140, RUT142, RUT200, RUT206, RUT240, RUT241, RUT260, RUT271, RUT300, RUT301, RUT360, RUT361, RUT901, RUT906, RUT950, RUT951, RUT955, RUT956, RUT976, RUTC50, RUTM08, RUTM09, RUTM10, RUTM11, RUTM30, RUTM31, RUTM50, RUTM51, RUTM52, RUTM54, RUTM55, RUTM56, RUTM59, RUTX08, RUTX09, RUTX10, RUTX11, RUTX12, RUTX14, RUTX50, RUTXR1, TCR100

Gateways

Generic class Models
Gateway TRB140, TRB141, TRB142, TRB143, TRB145, TRB160, TRB245, TRB246, TRB247, TRB255, TRB256, TRB500, TRB501

Access Points

Generic class Models
AccessPoint TAP100, TAP200

Switches

Generic class Models
Switch SWM280, SWM281, SWM282, TSW202, TSW212

Available endpoints

Endpoint Status Description
authentication ✅ Ready Login, logout, session status
wireguard ✅ Ready WireGuard tunnels and peers configuration
firewall ✅ Ready Connections status, port forwards
users ✅ Ready User management
interfaces ✅ Ready Interface configuration and status
firmware ✅ Ready Firmware status, FOTA, upgrade
system ✅ Ready Reboot, first login password change
unauthorized ✅ Ready Unauthorized status
access_control 🚧 Planned
auto_reboot 🚧 Planned
backup 🚧 Planned
date_time 🚧 Planned
diagnostics 🚧 Planned
events_log 🚧 Planned
modbus 🚧 Planned
network 🚧 Planned
profiles 🚧 Planned
rms 🚧 Planned
wireless 🚧 Planned
...and more 🚧 Planned See endpoints/

Contributions to implement planned endpoints are very welcome! See Contributing.

Development

# Clone the repository
git clone https://github.com/ikergcalvino/pytonika.git
cd pytonika

# Create a virtual environment
python -m venv .venv
source .venv/bin/activate

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check .

Contributing

Contributions, bug reports and feature requests are welcome! Check out the Contributing guidelines to get started.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytonika-0.3.0.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytonika-0.3.0-py3-none-any.whl (92.1 kB view details)

Uploaded Python 3

File details

Details for the file pytonika-0.3.0.tar.gz.

File metadata

  • Download URL: pytonika-0.3.0.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytonika-0.3.0.tar.gz
Algorithm Hash digest
SHA256 76f28c34675e36cf4a5ef3ad73685c9cfe89909f0ed7086d187ed5f0998e71df
MD5 1d17671f1a5c177b895192ae99bab955
BLAKE2b-256 d08105df9d99b5c678ef90f26c6f85d5f878b816baf195e1f2c812cba814fddb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytonika-0.3.0.tar.gz:

Publisher: publish.yml on ikergcalvino/pytonika

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytonika-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pytonika-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 92.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytonika-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ab2038af11931b485ef3079bb1c2e8ad8fedd77495580a67c1bd7b560e5d506
MD5 c2746203e31cecd6df32c5931f0cfe80
BLAKE2b-256 097a00149f60f341a497f8d471bf263c0b00adeab701cd4433ffaa2223aae385

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytonika-0.3.0-py3-none-any.whl:

Publisher: publish.yml on ikergcalvino/pytonika

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page