Skip to main content

Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%)

cylera-client

A Python client for the Cylera Partner API

Installation

pip install cylera-client

Or with uv:

uv add cylera-client

Usage

from cylera_client import CyleraClient, Organization, Inventory, Utilization, Network, Risk, Threat

client = CyleraClient(
    username="you@example.com",
    password="your-password",
    base_url="https://partner.us1.cylera.com/",
)

Authentication is handled automatically. Tokens are cached and refreshed before expiry.

Using an already-obtained token

If you already have a valid Cylera token — for example, one an integration obtained for its user from the Partner API — construct the client with token= instead of username/password:

client = CyleraClient(
    token="eyJ0eXA...",
    base_url="https://partner.us1.cylera.com/",
)

In this mode the client never calls /auth/login_user and never attempts to re-authenticate itself — it trusts the token as-is until the API rejects it with a 401, which is raised to you as a CyleraAPIError rather than retried. username/password and token are mutually exclusive; passing both (or neither) raises a ValueError.

Organization

organization = Organization(client)

# Get the organization associated with your API credentials
org = organization.get_organization()
# {"organization_id": 17, "name": "Cylera", "internal_name": "cylera"}

# List organizations available to switch into
available = organization.get_available_organizations()

# Switch into a different organization
# (in username/password mode, the token is invalidated after switch and the
# client re-authenticates automatically on the next call; in token mode the
# same token keeps working, but still acts on the organization it was issued
# for: get a new token to act in the one you switched into)
# Note that switch_organization is handled asynchronously
# So, whenever you switch, it is wise to sleep for a few seconds to give
# the back-end time to process the reset request.
organization.switch_organization(available[0]["id"])

# Reset back to your home organization
# Note that reset_organization is handled asynchronously
# So, whenever you reset, it is wise to sleep for a few seconds to give
# the back-end time to process the reset request.
organization.reset_organization()

Inventory

inventory = Inventory(client)

# Get a single device by MAC address
device = inventory.get_device("7f:14:22:72:00:e5")

# List devices with optional filters
devices = inventory.get_devices(
    vendor="Philips",
    device_class="Medical",
    page=0,
    page_size=50,
)

# Get device attributes
attrs = inventory.get_device_attributes("7f:14:22:72:00:e5")

# List excluded (unclassified) devices with optional filters
excluded_devices = inventory.get_excluded_devices(
    vendor="Philips",
    page=0,
    page_size=50,
)

Utilization

utilization = Utilization(client)

procedures = utilization.get_procedures(
    device_uuid="ffc20dfe-4c24-11ec-8a38-5eeeaabea551",
    completed_after="2024/01/01",
    page=0,
    page_size=100,
)

Network

network = Network(client)

subnets = network.get_subnets(vlan=477)

Risk

risk = Risk(client)

# Get vulnerabilities
vulns = risk.get_vulnerabilities(severity="CRITICAL", status="OPEN")

# Get mitigations for a specific CVE
mitigations = risk.get_mitigations(vulnerability="CVE-2017-2852")

Threats

threat = Threat(client)

threats = threat.get_threats(severity="HIGH", status="OPEN", page=0, page_size=50)

Debugging

Set DEBUG=1 to print request details to stderr (authorization headers are redacted):

Metadata

Release files for cylera-client 1.4.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 cylera-client 1.4.0
File Size Uploaded Provenance Actions
cylera_client-1.4.0.tar.gz 10.8 kB Without provenance Details for cylera_client-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cylera-client 1.4.0
File Interpreter ABI Platform Actions
cylera_client-1.4.0-py3-none-any.whl Python 3 none any Details for cylera_client-1.4.0-py3-none-any.whl

Total release size: 21.7 kB

Release files / cylera_client-1.4.0.tar.gz

Download URL cylera_client-1.4.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c348ce4bc629eb82452ae42c912814180a3d114adbc71473acc7f1f625a4707d
BLAKE2b-256 checksum
How to use checksums
450b419e15f1fa455cb51f0d8dd1ff1da1f705c41a83826387f154953b416353
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cylera_client-1.4.0-py3-none-any.whl

Download URL cylera_client-1.4.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a4d2c694c92741e280fde5120fc79ced84524c81f3f9865c8bee5c3ad25441c
BLAKE2b-256 checksum
How to use checksums
c35927ce5c03b2724e5ad20fc73ab6b918242880b67cf1c3bca2a92f5b8e5d02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cylera-client 1.4.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.

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