Skip to main content

Python library for interacting with Axis device APIs

Project description

ax-devil-device-api

A Python library for interacting with Axis device APIs. Provides a type-safe interface with tools for device management, configuration, and integration.

Quick Start

Installation

pip install ax-devil-device-api

Environment Variables

For an easier experience, you can set the following environment variables:

export AX_DEVIL_TARGET_ADDR=<device-ip>
export AX_DEVIL_TARGET_USER=<username>
export AX_DEVIL_TARGET_PASS=<password>
export AX_DEVIL_USAGE_CLI="safe" # Set to "unsafe" to skip SSL certificate verification for CLI calls

Example Usage

from ax_devil_device_api import Client, DeviceConfig

# Initialize client (recommended way using context manager)
config = DeviceConfig.https("192.168.1.10", "admin", "password")
with Client(config) as client:
    # Get device information
    device_info = client.device.get_info()
    if device_info.is_success:
        print(f"Model: {device_info.data.model}")
        print(f"Serial: {device_info.data.serial}")
        
    # Use a fresh session for sensitive operations
    with client.new_session():
        client.device.restart()

# Alternative: Manual resource management (not recommended)
client = Client(config)
try:
    device_info = client.device.get_info()
    if device_info.is_success:
        print(f"Model: {device_info.data.model}")
finally:
    client.close()  # Always close the client when done

CLI Usage Examples

Get device information

ax-devil-device-api-device-info --device-ip 192.168.1.10 --username admin --password secret info

Capture media

ax-devil-device-api-media --device-ip 192.168.1.10 --username admin --password secret --output image.jpg capture

Disclaimer

This project is an independent, community-driven implementation and is not affiliated with or endorsed by Axis Communications AB. For official APIs and development resources, please refer to Axis Developer Community.

License

MIT License - See LICENSE file for details.

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

ax_devil_device_api-0.1.2.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

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

ax_devil_device_api-0.1.2-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file ax_devil_device_api-0.1.2.tar.gz.

File metadata

  • Download URL: ax_devil_device_api-0.1.2.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for ax_devil_device_api-0.1.2.tar.gz
Algorithm Hash digest
SHA256 679bc64ca64053608f823dbe205e26f2fab70186b033796d549714c7283690a1
MD5 8a6ab7826b865d140e8e768c21a64df8
BLAKE2b-256 557c9ecd296f0716a7ff13607ca863bffe209e2f6bed6349d801a2a822de6d8d

See more details on using hashes here.

File details

Details for the file ax_devil_device_api-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ax_devil_device_api-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2a58b069aa932849c798e6430f7b07dc418c0c4ae9b3007d8b4a98151547c31b
MD5 c94c45b5f1c7e065c19124fc0f7f62de
BLAKE2b-256 d6b73439712aa6705c7be85c2629784321db8f2ce42108f6a54fc1aaea2b8b26

See more details on using hashes here.

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