Skip to main content

axis

Python project to set up a connection towards Axis Communications devices and to subscribe to specific events on the metadatastream.

Development setup

uv is required for development setup:

uv python install 3.14
uv sync --python 3.14 --all-extras

Or run the bootstrap script, which installs uv if needed and provisions Python 3.14 automatically:

./setup.sh

Dependencies are locked via uv.lock. Regenerate lock data when dependency inputs change:

uv lock

Run checks with uv:

uv run ruff check .
uv run ruff format --check .
uv run mypy axis
uv run pytest

Initial ty support is configured as an opt-in check and does not replace mypy:

uvx ty check

CLI navigation contract

The interactive CLI in axis/cli/ follows a menu-first model. Router runtime is the only interactive execution path.

  • Canonical route graph: main -> devices -> device_operations -> {api|events|accounts}.
  • device_operations routes to feature submenus using router navigation, not direct feature command execution.
  • Feature nodes (api, events, accounts) own their local menu layout and selected-device context rendering.
  • b always navigates to parent_id; e always exits.

To keep the CLI reusable boundary clear:

  • CLI concerns (menu keys, prompts, render text, router state) stay in axis/cli/.
  • axis/interfaces/ and axis/models/ must remain presentation-agnostic and reusable by non-CLI consumers.
  • Domain layers return typed data/errors; CLI adapters map them to user-facing text and flow.

Initialization architecture

Vapix initialization is phase-based and driven by handler metadata:

  • API_DISCOVERY: handlers initialized after API discovery.
  • PARAM_CGI_FALLBACK: handlers that may initialize from parameter support when not listed in discovery.
  • APPLICATION: handlers initialized after applications are loaded.

Handlers declare phase membership through handler_groups and may customize phase eligibility through should_initialize_in_group.

Request and response typing

Vapix.api_request() is the single typed request entrypoint.

  • Request models declare their decode contract with ApiRequest[ResponseT].
  • Every ApiRequest subclass must set response_type explicitly.
  • Decoded/read requests use their concrete response model as response_type.
  • Write-style requests use BytesResponse as response_type.

Examples:

@dataclass
class ListApisRequest(ApiRequest[GetAllApisResponse]):
	response_type = GetAllApisResponse


@dataclass
class SetPortsRequest(ApiRequest[ApiResponse[bytes]]):
	response_type = BytesResponse

Handler methods may unwrap .data when they intentionally preserve a bytes-returning boundary.

Example fallback policy:

  • LightHandler participates in both API_DISCOVERY and PARAM_CGI_FALLBACK.
  • In PARAM_CGI_FALLBACK, it initializes only when not listed in API discovery and listed in parameters.

Event Instance Model Notes

EventInstance keeps name as the raw device-provided NiceName value.

EventInstance.source and EventInstance.data are typed containers (EventInstanceSource and EventInstanceData) built from SimpleItemInstance payloads.

For compatibility with integrations that still need the historical raw payload shape, EventInstance also exposes:

  • raw_source: returns {} or a dict or a list of dicts.
  • raw_data: returns {} or a dict or a list of dicts.

Metadata

Release files for axis 73

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

Source distribution (sdist)

Source distribution for axis 73
File Size Uploaded
axis-73.tar.gz 145.8 kB Details

Built distribution (wheel)

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

Total release size: 280.6 kB

Release files / axis-73.tar.gz

Download URL axis-73.tar.gz
Size 145.8 kB
Tags Source
SHA-256 checksum
How to use checksums
67f8d5f68dc2449d06235d7d05d5cd63296889ec8322aa7f888f060919ed527a
BLAKE2b-256 checksum
How to use checksums
f3a73fe6eac5333c3a1a88178369a2b38d9aa32d5d213d5b6329da5ea3115631
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / axis-73-py3-none-any.whl

Download URL axis-73-py3-none-any.whl
Size 134.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37aee9dd1a4bf46225c96f9e65b3fc85eaade953a313bdd1fc718e7018090ebb
BLAKE2b-256 checksum
How to use checksums
23c212c52a68c8fe2220dbc67af486828b642c1e3c4a44dabd7f188d21177852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

74

2 release files

This release

73 This release

2 release files

72

2 release files

71

2 release files

70

2 release files

69

2 release files

68

2 release files

67

2 release files

66

2 release files

65

2 release files

64

2 release files

63

2 release files

62

2 release files

61

2 release files

60

2 release files

59

2 release files

58

2 release files

57

2 release files

56

2 release files

55

2 release files

54

2 release files

53

2 release files

52

2 release files

51

2 release files

50

2 release files

49

2 release files

48

2 release files

47

2 release files

46

2 release files

45

2 release files

44

2 release files

43

2 release files

42

2 release files

41

2 release files

40

2 release files

39

2 release files

38

2 release files

37

2 release files

36

2 release files

35

2 release files

34

2 release files

33

2 release files

32

2 release files

31

2 release files

30

2 release files

29

2 release files

28

2 release files

27

2 release files

26

2 release files

25

2 release files

24

2 release files

23

2 release files

22

2 release files

21

2 release files

20

2 release files

19

2 release files

18

2 release files

17

2 release files

16

2 release files

15

2 release files

14

1 release file

13

1 release file

12

1 release file

11

1 release file

10

1 release file

9

1 release file

8

1 release file

7

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