Skip to main content

LogicVein API Client

A Python client for interacting with the LogicVein API.

Installation

From PyPI:

pip install lvi-api-client

From TestPyPI (pre-release / testing):

pip install \
  --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ \
  lvi-api-client

See PUBLISHING.md for instructions on publishing new releases.

Usage

from logicvein import LogicVeinAPIClient

client = LogicVeinAPIClient(host="your-lvi-server", api_token="your-token")
devices = client.search_devices_in_network()

Settings not passed as arguments are read from LVI_HOST, LVI_API_TOKEN (or LVI_USERNAME and LVI_PASSWORD), LVI_VERIFY_SSL and LVI_TIMEOUT; ignore_env_vars=True reads none of them.

Logging in

With an API token there is no login: the token goes in a header of every call. With a username and password and no token, the client logs in as it is created, and authenticate() logs in again. A login that does not work raises:

  • LogicVeinAuthenticationError: the server rejected the username or password (HTTP 401). It has host and username.
  • LogicVeinConnectionError: the server could not be reached or did not answer as it should: connection refused, host name not found, TLS failure, timeout, too many redirects, any other HTTP error status, or a CA bundle path that does not exist. It has host, reason and, if the server answered, status_code.
from logicvein import LogicVeinAPIClient, LogicVeinAuthenticationError, LogicVeinConnectionError

try:
    client = LogicVeinAPIClient(host="your-lvi-server", username="your-user", password="your-password")
except LogicVeinAuthenticationError as error:
    print(f"Wrong username or password: {error}")
except LogicVeinConnectionError as error:
    print(f"Server problem: {error}")

Neither error holds the password or the request URL, so both are safe to print and log.

The password login is a GET with the username and password in the URL's query string. They are encrypted in transit like the rest of the request, but a URL is what servers and proxies commonly write to their access logs, and the response authenticate() returns holds it in url. Prefer an API token where you can.

TLS verification

The client verifies the server's TLS certificate by default. For a server whose certificate comes from a private CA, keep verification on and point REQUESTS_CA_BUNDLE at the CA's certificate. verify=False, or LVI_VERIFY_SSL=false, turns verification off, and the API token or password is then sent to whichever server answers. LVI_VERIFY_SSL accepts true/false, 1/0, yes/no and on/off in any case; unset or empty means verify, and anything else is an error.

Metadata

Release files for lvi-api-client 0.5.0

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

Source distribution (sdist)

Source distribution for lvi-api-client 0.5.0
File Size Uploaded Provenance Actions
lvi_api_client-0.5.0.tar.gz 90.0 kB Without provenance Details for lvi_api_client-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lvi-api-client 0.5.0
File Interpreter ABI Platform Actions
lvi_api_client-0.5.0-py3-none-any.whl Python 3 none any Details for lvi_api_client-0.5.0-py3-none-any.whl

Total release size: 136.1 kB

Release files / lvi_api_client-0.5.0.tar.gz

Download URL lvi_api_client-0.5.0.tar.gz
Size 90.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d1ef5abad080f342b2965472dacd91a079f1032331aac5d4b76f99341324ff25
BLAKE2b-256 checksum
How to use checksums
0fbd06ed7e17d7415e7ac0bc166e20f3b217d6176d192022c128e5264a607582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / lvi_api_client-0.5.0-py3-none-any.whl

Download URL lvi_api_client-0.5.0-py3-none-any.whl
Size 46.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bbb58a6825bfcdf74537a1816cd513b97195e544056b0b526bc24d0028460c2
BLAKE2b-256 checksum
How to use checksums
eb35fe6d6b42d0b9ce609a964932871fa32151f08ced40e123ec040b9ca54530
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for lvi-api-client 0.5.0

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.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files No provenance

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