Skip to main content

SSB Collector Client

PyPI Status Python Version License

Documentation Tests Coverage Quality Gate Status

pre-commit Black Ruff Poetry

Features

  • Start new data collector tasks with custom specifications
  • List all running collector tasks
  • Stop running collector tasks by ID
  • Built-in authentication using Dapla Auth Client
  • Object-oriented API with CollectorClient class

Requirements

  • Python 3.10 or higher
  • Access to a Data Collector service
  • Dapla authentication credentials

Installation

You can install SSB Collector Client via pip from PyPI:

pip install ssb-collector-client

Usage

The SSB Collector Client provides an object-oriented interface using the CollectorClient class:

Quick Start

from ssb_collector_client import CollectorClient

# Initialize the client with your collector service URL
client = CollectorClient("https://your-collector-service.no/tasks")

# Define your collector specification
specification = {
    "type": "your-collector-type",
    # ... other specification parameters
}

# Start a new task
response = client.start(specification)

# Get all running tasks
tasks = client.running_tasks()
print(f"Running tasks: {tasks.json()}")

# Stop a specific task by ID
client.stop(task_id=1234)

Complete Example

Here's a complete example using the CollectorClient class:

from ssb_collector_client import CollectorClient

# Initialize the client
collector_url = "https://your-collector-service.no/tasks"
client = CollectorClient(collector_url)

# Define your collector specification
specification = {
    "type": "example-type",
    "name": "my-collection-task",
    # ... other specification parameters
}

# Start a new task
print("Starting collector task...")
start_response = client.start(specification)
print(f"Task started: {start_response.status_code}")

# Check running tasks
print("\nChecking running tasks...")
tasks_response = client.running_tasks()
tasks = tasks_response.json()
print(f"Running tasks: {tasks}")

# Stop a specific task if needed
if tasks:
    task_id = 1234  # Replace with actual task ID
    print(f"\nStopping task {task_id}...")
    client.stop(task_id)

Please see the Reference Guide for details.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, SSB Collector Client is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from Statistics Norway's SSB PyPI Template.

Metadata

Release files for ssb-collector-client 0.1.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 ssb-collector-client 0.1.0
File Size Uploaded Provenance Actions
ssb_collector_client-0.1.0.tar.gz 6.0 kB With provenance Details for ssb_collector_client-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ssb-collector-client 0.1.0
File Interpreter ABI Platform Actions
ssb_collector_client-0.1.0-py3-none-any.whl Python 3 none any Details for ssb_collector_client-0.1.0-py3-none-any.whl

Total release size: 12.1 kB

Release files / ssb_collector_client-0.1.0.tar.gz

Download URL ssb_collector_client-0.1.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
785673eb132e4642b01326402e34c391d1dbb39f76d92cf98bc2afa1e0156be7
BLAKE2b-256 checksum
How to use checksums
558ab66fb43f8666880e9c4e6a3cf149541da9355eb5a630059f2bf4a345a779
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.

Transparency log

Release files / ssb_collector_client-0.1.0-py3-none-any.whl

Download URL ssb_collector_client-0.1.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e50a11716adb04b1662f483cd6da8ae4e5c37b4993cb2d35d288130db6684558
BLAKE2b-256 checksum
How to use checksums
e6d8315106f763f8f0a0afbce5855a46c7a505085186603d4c7a7b31571c2adc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.

Transparency log

Security for ssb-collector-client 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ssb_collector_client-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2026.

Transparency log

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