Skip to main content

pysophoscentral

A Python client library for the Sophos Central API.

Status: work in progress (pre-1.0). The API surface is incomplete and may change between minor releases without notice. This release is published to reserve the package name; a stable 1.0 is on the roadmap.

Features

  • OAuth2 client-credentials authentication and tenant resolution (whoami)
  • Endpoints: list, read, filter (Endpoint API v1)
  • Directory users: list, read, create, update, delete (Common API v1)
  • Alerts and account health check
  • Typed request/response models built on Pydantic v2

Requirements

  • Python 3.12+

Installation

pip install pysophoscentral

Quickstart

Configuration is loaded from a TOML file:

# settings.toml
[sophos_central]
base_url = "https://api.central.sophos.com/"
auth_endpoint_url = "https://id.sophos.com/api/v2/oauth2/token"
auth_client_id = "<your-client-id>"
auth_client_secret = "<your-client-secret>"
api_version = "v1"
from pysophoscentral.api import SophosCentralClient
from pysophoscentral.settings import AppSettings

settings = AppSettings(_env_file="settings.toml")
client = SophosCentralClient(settings.sophos_central)

client.authenticate()   # obtain the OAuth2 access token
client.read_whoami()    # resolve tenant id and data region (required)

endpoints = client.read_endpoints()
for endpoint in endpoints.items:
    print(endpoint.id, endpoint.hostname)

Note: authenticate() and read_whoami() must be called, in this order, before any other API call.

License

MIT

Metadata

Release files for pysophoscentral 0.2.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 pysophoscentral 0.2.0
File Size Uploaded Provenance Actions
pysophoscentral-0.2.0.tar.gz 8.4 kB Without provenance Details for pysophoscentral-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysophoscentral 0.2.0
File Interpreter ABI Platform Actions
pysophoscentral-0.2.0-py3-none-any.whl Python 3 none any Details for pysophoscentral-0.2.0-py3-none-any.whl

Total release size: 20.6 kB

Release files / pysophoscentral-0.2.0.tar.gz

Download URL pysophoscentral-0.2.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e19bcad53f257727fd99aecb89f0cf8776714bc2e331559a685bf003e148f559
BLAKE2b-256 checksum
How to use checksums
230d84aeeb148dfb5c27e145d23ae7940c6b7baad8151257058e7c7ec0038004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}

Release files / pysophoscentral-0.2.0-py3-none-any.whl

Download URL pysophoscentral-0.2.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7356573378b622c0a0d96e3f83c8b8474a5e7fe49157adc35411da209eb39718
BLAKE2b-256 checksum
How to use checksums
8a2bb1d9960705275d8d18632290eb578f43ccece7ecfbed8460ae9d522e883f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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}

Security for pysophoscentral 0.2.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.2.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