Skip to main content

vetvise-vms-client

Python client for the REST API of the VetVise Management System (VMS).

It handles service account authentication and wraps the most common endpoints: cameras, still frames, recordings, timeseries data, artifacts, incidents, pens, regions, reports and data collection.

Installation

pip install vetvise-vms-client

Requires Python 3.12 or newer.

Configuration

Servers are configured in a JSON file, keyed by an alias of your choice:

{
  "my-barn": {
    "protocol": "https",
    "hostname": "vms.example.com",
    "port": 443,
    "service_account_name": "my-service-account",
    "fingerprint": "<public key fingerprint>",
    "private_key": "/path/to/private_key.pem"
  }
}

private_key is either a path to a PEM file or the PEM content itself. Keep this file out of version control.

Each entry can also have an optional "tags": ["production", "barn", "chickens"] list to group servers:

vms.get_instances_by_tags("production", "chickens")  # {alias: Server} with all given tags
vms.get_all_tags()                                   # every tag in the config
server.get_tags()                                    # tags of one server
server.has_tags("barn")                              # True / False

Usage

import time

from vms import VMS

vms = VMS("servers.json")
server = vms.get_instance("my-barn")

# Basic info
server.api.base.is_online()
server.api.base.get_version()

# Cameras and frames
camera_ids = server.api.cameras.get_camera_ids()
jpeg = server.api.frames.get_current_thumbnail_frame(camera_ids[0])
frame = server.api.frames.get_frame(camera_ids[0], time.time() * 1000)

# Timeseries data
server.api.timeseries.get_measurements()
df = server.api.timeseries.get_simple_measurement(
    "activity", "activity",
    start=(time.time() - 6 * 3600) * 1000,
    response_type="dataframe",
)

# Document collections support query / query_one / get_specific
latest = server.api.recordings.query_one({"order": {"timestamp": "desc"}})
reports = server.api.reports.query({"limit": 10})

# Archived artifacts (on a commander instance): query and download
commander = vms.get_instance("Commander Rex")
archived = commander.api.archived_artifacts.get_for_instance("<barn globalUniqueIdentifier>")
commander.api.archived_artifacts.download(archived[0]["archivedArtifactId"], file_path="artifact.bin")

# Regions
mappings = server.api.regions.get_mappings_for_camera(camera_ids[0])

# Pen state: is the barn full or empty, and since how many days?
pen_state = server.helpers.pen_state.get_pen_state()   # None if no pen state exists
print(pen_state)                                       # e.g. "Full, Day 9"
pen_state.is_full, pen_state.is_empty, pen_state.day

# Day of epoch (the filling day is day 0; None while the barn is empty)
server.helpers.pen_state.get_day_of_epoch(timestamp_ms)
# All absolute timespans that fell on day of epoch 1 to 3, over all epochs
for span in server.helpers.pen_state.get_timespans_for_days_of_epoch(1, 3):
    print(span.start_datetime, span.end_datetime)

# Stitch all cameras into one canvas image (PIL.Image)
canvas = server.helpers.canvas.build_canvas(image_source="stillFrame")
rotated = server.helpers.canvas.build_canvas(rotation=90)   # degrees, counter-clockwise

Authentication happens automatically on the first request and is renewed when the access token expires. Failed requests raise vms.RequestFailed, which carries the HTTP status, reason and response body.

Which endpoints a service account can use depends on the permissions it has been granted in the VMS. For endpoints and query syntax not covered by this client, see the REST API documentation.

Releasing

The package version comes from git tags, and Bitbucket Pipelines publishes to PyPI when a v* tag is pushed (the UV_PUBLISH_TOKEN repository variable holds the PyPI token).

git tag -a v0.1.0 -m "First release"
git push origin v0.1.0
  • Tags must start with v; v0.1.0 becomes version 0.1.0.
  • Use vX.Y.Z: bump Z for fixes, Y for new features (or breaking changes before 1.0), X for breaking changes after 1.0.
  • Every version can be published only once. Never move or reuse a tag; if a release is broken, fix it and tag the next version.
  • Only a pushed tag publishes. Running the tag pipeline manually on a branch fails on purpose.

License

Apache License 2.0. See LICENSE and NOTICE. Copyright 2026 VetVise GmbH.

Metadata

Release files for vetvise-vms-client 0.1.3

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

Source distribution (sdist)

Source distribution for vetvise-vms-client 0.1.3
File Size Uploaded Provenance Actions
vetvise_vms_client-0.1.3.tar.gz 55.2 kB Without provenance Details for vetvise_vms_client-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vetvise-vms-client 0.1.3
File Interpreter ABI Platform Actions
vetvise_vms_client-0.1.3-py3-none-any.whl Python 3 none any Details for vetvise_vms_client-0.1.3-py3-none-any.whl

Total release size: 79.5 kB

Release files / vetvise_vms_client-0.1.3.tar.gz

Download URL vetvise_vms_client-0.1.3.tar.gz
Size 55.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c1e1b5967eab6f7d4d955bfe017d7f0cf4727f751f2e7b46ba5b4a73547d1c36
BLAKE2b-256 checksum
How to use checksums
6c9443f07b09d94e8289af3b03551b877d4a7573dd58aaaabf8621026fbe1d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / vetvise_vms_client-0.1.3-py3-none-any.whl

Download URL vetvise_vms_client-0.1.3-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
623ab115395b1a0e392c9a211f37b11465ee230dc9a4db7e98650f27ff8df84a
BLAKE2b-256 checksum
How to use checksums
9c48d668e4c86ab4ef97a12cb469dce12985cdcfc1d00225b565b86b09a1a9d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for vetvise-vms-client 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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