Library to access Arctic Security APIs
Project description
Arctic Security Library
A Python library to access Arctic Security's Sharing API endpoints and retrieve event data.
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 fetch all event data. It uses pagination with opaque continuation tokens to ensure no events are missed.
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"')
# Fetch token from previous run
token = ...
while True:
res = sync.read(token=token, pagesize=1000)
if not res.events:
break
# process res.events...
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,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.
Status
Experimental (0.1.x); the API may evolve. Pin the library version for production use.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arcticsecurity-0.1.0.tar.gz.
File metadata
- Download URL: arcticsecurity-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19b26cb52e6b7984ce1c7c8fc908af0c1381d24dab2a446cb0e4a770a0271273
|
|
| MD5 |
03ab5e0f118ba5711012f1308c7257ef
|
|
| BLAKE2b-256 |
d78bc08d6adcf162407b4b76e0e29b4db67bf626dd6ad6b9be587e4502fb6f81
|
File details
Details for the file arcticsecurity-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arcticsecurity-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a013e7ddb9e3e43fc1b8594548ea33cf7e2385850b7b5ddd6175367465915453
|
|
| MD5 |
948609ab808b9e2088ad123157f7e06d
|
|
| BLAKE2b-256 |
9ed4c0ac9d056393c7d3aeed4a363697d5ca82cbbe15c38ac68d67cb8a289c50
|