Skip to main content

fritzconnection

Python-Interface to communicate with the AVM Fritz!Box. Supports the TR-064 protocol, the (AHA-)HTTP-Interface and also allows call-monitoring.

Installation

For installation use pip:

    $ pip install fritzconnection
      or
    $ pip install fritzconnection[qr]

The latter will install the segno package to enable QR-code creation for wifi login.

Quickstart

Using fritzconnection is as easy as:

    from fritzconnection import FritzConnection

    fc = FritzConnection(address="192.168.178.1", user="user", password="pw")
    print(fc)  # print router model information

    # tr-064 interface: reconnect for a new ip
    fc.call_action("WANIPConn1", "ForceTermination")

    # http interface: gets history data from a device with given 'ain'
    fc.call_http("getbasicdevicestats", "12345 7891011")

FritzConnection provides two basic commands to communicate with the router APIs: call_action() for the TR-064-Interface and call_http() for the (AHA)-HTTP-Interface. Both APIs can be used on the same FritzConnection instance side by side.

call_action

call_action() expects a TR-064 service- and an action-name (and optional arguments). In general FritzConnection can execute every service and action provided by the (model-specific) API as documented by AVM. For i.e. this can be network settings, status informations, access to home automation devices and much more. The call_action() method returns the response from the router as a dictionary with the values already converted to the matching Python datatypes.

call_http

call_http() expects a command for the http-interface like "getbasicdevicestats" and, depending on the command, additional arguments like a device "ain" (identifier). A call to the method returns a dictionary with the content-type, the encoding and the response data of the http-response. The content-type of the response-data is typical "text/plain" or "text/xml" and may need further processing.

Username and password

To avoid hardcoding the arguments user and password in applications FritzConnection can read both from the environment variables FRITZ_USERNAME and FRITZ_PASSWORD.

Caching

On instantiation FritzConnection has to inspect the model-specific router-API. This causes a lot of network requests and can take some seconds. To avoid this FritzConnection provides a cache that can get activated by the use_cache parameter:

    fc = FritzConnection(..., use_cache=True)

This argument defaults to False. After creating the cache FritzConnection will start up much more faster.

Library

The package comes with library-modules to make some API calls easier and also demonstrates how to implement applications on top of FritzConnection.

Documentation

The full documentation and release notes are at https://fritzconnection.readthedocs.org

Release files for fritzconnection 1.15.1

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

Source distribution (sdist)

Source distribution for fritzconnection 1.15.1
File Size Uploaded
fritzconnection-1.15.1.tar.gz 59.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fritzconnection 1.15.1
File Interpreter ABI Platform
fritzconnection-1.15.1-py3-none-any.whl Python 3 none any Details

Total release size: 132.2 kB

Release files / fritzconnection-1.15.1.tar.gz

Download URL fritzconnection-1.15.1.tar.gz
Size 59.1 kB
Tags Source
SHA-256 checksum
How to use checksums
aa40b0a850f65fd7ea0483e65f733aa534d63c5e5bb9a8306c63e9dfd0bcf5dd
BLAKE2b-256 checksum
How to use checksums
e09fc21ecd5e3c7b43ac550cb843c79241d3461da07900d810053df5dfa74875
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.12

Release files / fritzconnection-1.15.1-py3-none-any.whl

Download URL fritzconnection-1.15.1-py3-none-any.whl
Size 73.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
741a43f339e3ec87c17ed00d3818f3e2d5c1aec3635b3d69eb68ff11eae8394c
BLAKE2b-256 checksum
How to use checksums
99b0873ca479f2e729cbd3f864f5c34fde4bb900f7c3fb3733b6376f21506ce8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.12

Release history Release notifications | RSS feed

This release

1.15.1 This release

2 release files

1.15.0

2 release files

1.14.0

2 release files

1.13.2

2 release files

1.13.1

2 release files

1.13.0

2 release files

1.12.0

1 release file

1.11.0

1 release file

1.10.3

1 release file

1.10.2

1 release file

1.10.1

1 release file

1.10.0

1 release file

1.9.1

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1

2 release files

1.0.1

2 release files

1.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.5

2 release files

0.6.3

1 release file

0.6.2

1 release file

0.6

1 release file

0.4.6

1 release file

0.4.5

1 release file

0.4.4

1 release file

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