Skip to main content

Arctic Security Library

A Python library to access Arctic Security's Sharing API endpoints and retrieve event data.

Documentation

Full documentation, including API reference guides and examples, is available at: https://arcticsecurity.github.io/arcticsecurity-python/

Installation

pip install arcticsecurity

Python >= 3.9 is required.

Quick Start

The library supports two distinct ways to retrieve events from the Sharing API: Query and Sync.

Query

Use the Query class to perform one-off queries for specific events.

from arcticsecurity.sharing_api import Query

url = "https://example.com/shares/v2/share-id?apikey=YOUR_API_KEY"
for event in Query(url).query(filter='"network owner"="Example Co"', max_events=50):
    print(event)

Sync

Use the Sync class to reliably synchronize all event data. It uses pagination with opaque continuation tokens to ensure no events are missed.

Here Sync means keeping your own copy of the events synchronized. It is unrelated to the Sharing API's synchronous endpoints: both classes use the asynchronous ones.

from arcticsecurity.sharing_api import Sync

url = "https://example.com/shares/v2/share-id?apikey=YOUR_API_KEY"
sync = Sync(url, filter='"network owner"="Example Co"')

# Load the token stored by the previous run, or None on the first run
token = None

while True:
    res = sync.read(token=token, pagesize=1000)
    # process res.events...

    # res.token is None when the server reported no position; keep the old one
    if res.token is not None:
        token = res.token

    if not res.has_more:
        break

# store the token for the next run

Common features

  • Robust error handling with specific exceptions (ConfigError, AuthError, NetworkError, Retry, TimeoutError, InvalidTokenError, ServerError).
  • Optional timeout and user-agent customization

Versioning

Follows Semantic Versioning v2.

Development

uv is required.

uv sync --group dev

uv run ruff check .
uv run pytest --doctest-modules

uv run mypy --config-file pyproject.toml -p arcticsecurity
uv run ty check

uv run mkdocs build
uv run mkdocs serve

Contributing

Issues and pull requests are welcome. Please add tests for any new behavior.

Metadata

Release files for arcticsecurity 0.2.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 arcticsecurity 0.2.1
File Size Uploaded Provenance
arcticsecurity-0.2.1.tar.gz 14.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 30.3 kB

Release files / arcticsecurity-0.2.1.tar.gz

Download URL arcticsecurity-0.2.1.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e8cf2190ed5cdffebb7e8dec9f9340f18b2bb8096d115a063a5f0aa78a933668
BLAKE2b-256 checksum
How to use checksums
1e37d8917b327abee9c2773c275dd6143a257ff6b468ad8d7cb5fd214267baa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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 / arcticsecurity-0.2.1-py3-none-any.whl

Download URL arcticsecurity-0.2.1-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30333a1fb6b5787696babc4e5f1c5e5daf8f226d83046309616149381dcf4cf5
BLAKE2b-256 checksum
How to use checksums
5ebfc2df41648fe883533a8925ef1e084234e96bdd47f29649d630e722af7994
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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 arcticsecurity 0.2.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.

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