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})

# 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

# Masttag (day of the fattening period; the filling day is Masttag 0, None while empty)
server.helpers.pen_state.get_masttag(timestamp_ms)
# All absolute timespans that fell on Masttag 1 to 3, over all fattening periods
for span in server.helpers.pen_state.get_timespans_for_masttags(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")

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.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 vetvise-vms-client 0.1.1
File Size Uploaded Provenance Actions
vetvise_vms_client-0.1.1.tar.gz 54.0 kB Without provenance Details for vetvise_vms_client-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 76.9 kB

Release files / vetvise_vms_client-0.1.1.tar.gz

Download URL vetvise_vms_client-0.1.1.tar.gz
Size 54.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5a27139c485631e0b27eff7702552286911b6582f22ef57645e8b788392f7a59
BLAKE2b-256 checksum
How to use checksums
6322a17c9750fc6c3b474ea1d57230856f6a0f28f554d38dc6287ca656651a47
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.1-py3-none-any.whl

Download URL vetvise_vms_client-0.1.1-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab4f078809e56284bce8aef9ed712aade2733fa4ea6be8a6290fbecabb117070
BLAKE2b-256 checksum
How to use checksums
2616471061b107c9f06a56a5cd69fab8c0058da7fb4888434634300053cc2400
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.1

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