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.

Download files

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

Source Distribution

axis-74.tar.gz (145.8 kB view details)

Uploaded Source

Built Distribution

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

axis-74-py3-none-any.whl (134.8 kB view details)

Uploaded Python 3

File details

Details for the file axis-74.tar.gz.

File metadata

  • Download URL: axis-74.tar.gz
  • Upload date:
  • Size: 145.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for axis-74.tar.gz
Algorithm Hash digest
SHA256 0e215d21ddb82a402f3d4add062a4106552017e60c3d0357e063b731ae87b2bf
MD5 30af703183023acbc6ee86d37c2bb2cb
BLAKE2b-256 1ac70f0549b7394465a629c61acbba86d9701713fd9b5eba456afdae70557079

See more details on using hashes here.

File details

Details for the file axis-74-py3-none-any.whl.

File metadata

  • Download URL: axis-74-py3-none-any.whl
  • Upload date:
  • Size: 134.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for axis-74-py3-none-any.whl
Algorithm Hash digest
SHA256 19cc109e36213dd3d1413e2ec21aecc10ef1e986f5a962f2445c789ba6a34a76
MD5 3c35d9cbd0b98a886f9c095b4f222145
BLAKE2b-256 abe11678886b547fca592892942cdda510b788d3449e9ac40451d8bc99578397

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

74 This release

2 files

73

2 files

72

2 files

71

2 files

70

2 files

69

2 files

68

2 files

67

2 files

66

2 files

65

2 files

64

2 files

63

2 files

62

2 files

61

2 files

60

2 files

59

2 files

58

2 files

57

2 files

56

2 files

55

2 files

54

2 files

53

2 files

52

2 files

51

2 files

50

2 files

49

2 files

48

2 files

47

2 files

46

2 files

45

2 files

44

2 files

43

2 files

42

2 files

41

2 files

40

2 files

39

2 files

38

2 files

37

2 files

36

2 files

35

2 files

34

2 files

33

2 files

32

2 files

31

2 files

30

2 files

29

2 files

28

2 files

27

2 files

26

2 files

25

2 files

24

2 files

23

2 files

22

2 files

21

2 files

20

2 files

19

2 files

18

2 files

17

2 files

16

2 files

15

2 files

14

1 file

13

1 file

12

1 file

11

1 file

10

1 file

9

1 file

8

1 file

7

1 file

Supported by

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