Skip to main content

Python client for the Cylera Partner API

Project description

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, 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.

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

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

DEBUG=1 python your_script.py

Development

This project uses uv for dependency management.

# Install dependencies
uv sync --group dev

Running tests

Tests run against the Cylera demo environment. Set the required environment variables first:

export TEST_CYLERA_USERNAME="you@example.com"
export TEST_CYLERA_PASSWORD="your-password"
export TEST_CYLERA_BASE_URL="https://partner.demo.cylera.com/"

Then run the full test suite (pytest, linting, type checking, security scanning):

./test.sh

Or with Doppler for secrets management:

./test.sh --use-doppler

To run pytest only:

uv run pytest -v

Quality checks

The test.sh script runs these checks in order:

Tool Purpose
pytest Tests
ruff Linting
pyright Type checking
shellcheck Shell script linting
bandit Python security scanning
pip-audit Dependency vulnerability scanning

Project details


Download files

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

Source Distribution

cylera_client-0.1.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

cylera_client-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file cylera_client-0.1.0.tar.gz.

File metadata

  • Download URL: cylera_client-0.1.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cylera_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dc322ad5d91460110653dceb33b20a7e349335db0213cd57003de0a7f38efd6d
MD5 f72fbdffc0f8e86b16bb9327abd3d1b7
BLAKE2b-256 d192fbfe2bf7b17b70e632801e70077515fc3f03b382f63137c38ce5597dc2b7

See more details on using hashes here.

File details

Details for the file cylera_client-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cylera_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cylera_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4def193c4a8f7dd75fcc3e4bc53ecc73c18c7291b2a322136cd98842a1a3c88c
MD5 3f79e02c67cd6b3fa716a70a9fcab263
BLAKE2b-256 176bdd9c2bb73b561dbecb791b2f0defc494197e9f638760c46e461ed85f25f4

See more details on using hashes here.

Supported by

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