Skip to main content

ACRCloud client for SUISA reporting

Project description

suisa_sendemeldung

ACRCloud client that fetches data on our playout history and formats them in a CSV file format containing the data (like Track, Title and ISRC) requested by SUISA. Also takes care of sending the report to SUISA via email for hands-off operations.

Usage

We provide the SUISA Sendmeldung script as a container image or as a python package.

These usage instructions show how to install the script and how to configure it. There are different ways to run it at a schedule. We recommend using systemd-timers.

To output the scripts usage information, check out it's --help output:

# Using Podman
podman run --rm -ti ghcr.io/radiorabe/suisasendemeldung:latest suisa_sendemeldung --help

# Using Docker
docker run --rm -ti ghcr.io/radiorabe/suisasendemeldung:latest suisa_sendemeldung --help

While we recommend running the script in it's container, you can also install the script in any python environment using pip.

We recommend using a dedicated venv for running the script should you go down this route:

python -mvenv .venv
. venv/bin/activate

pip install suisa_sendemeldung

# Output usage after installation
suisa_sendemeldung

Configuration

You can configure this script with a configuration file (default is suisa_sendemeldung.conf), environment variables, or command line arguments.

Command line arguments override environment variables which themselves override settings in the configuration file.

Configuration file

The configuration files will be evaluated in the following order (last takes precedence over first):

  1. /etc/suisa_sendemeldung.toml
  2. $HOME/suisa_sendemeldung.toml
  3. ./suisa_sendemeldung.toml

For details on how to set configuration values, have a look at suisa_sendemeldung.conf.

Environment variables

Environment variables can also be passed as options. The relevant variables are listed in the Usage part of this document. For example run the script as follows:

podman run --rm -ti -e SENDEMELDUNG_ACR_BEARER_TOKEN=abcdefghijklmnopqrstuvwxyzabcdef -e SENDEMELDUNG_ACR_STREAM_ID=a-bcdefgh -e SENDEMELDUNG_OUTPUT=stdout ghcr.io/radiorabe/suisasendemeldung:latest suisa_sendemeldung

Command line switches

As documented in Usage, you can also pass in options on the command line as arguments. Simply run the script as follows:

podman run --rm -ti ghcr.io/radiorabe/suisasendemeldung:latest suisa_sendemeldung --acr-bearer-token=abcdefghijklmnopqrstuvwxyzabcdef --acr-stream-id=a-bcdefgh --output=stdout

Development

Snapshot testing is used to test the help output, you can update the snapshots like so:

poetry run pytest -- --snapshot-update

Release Management

At RaBe we run the script on the first and 14th of each month. Matching this we only release new versions of the script in the second half of each month.

The CI/CD setup uses semantic commit messages following the conventional commits standard. There is a GitHub Action in .github/workflows/semantic-release.yaml that uses go-semantic-commit to create new releases.

The commit message should be structured as follows:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

The commit contains the following structural elements, to communicate intent to the consumers of your library:

  1. fix: a commit of the type fix patches gets released with a PATCH version bump
  2. feat: a commit of the type feat gets released as a MINOR version bump
  3. BREAKING CHANGE: a commit that has a footer BREAKING CHANGE: gets released as a MAJOR version bump
  4. types other than fix: and feat: are allowed and don't trigger a release

If a commit does not contain a conventional commit style message you can fix it during the squash and merge operation on the PR.

Once a commit has landed on the main branch a release will be created and automatically published to pypi using the GitHub Action in .github/workflows/release.yaml which uses twine to publish the package to pypi. The release.yaml action also takes care of pushing a container image to GitHub Packages.

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

suisa_sendemeldung-1.0.0a3.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

suisa_sendemeldung-1.0.0a3-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file suisa_sendemeldung-1.0.0a3.tar.gz.

File metadata

  • Download URL: suisa_sendemeldung-1.0.0a3.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for suisa_sendemeldung-1.0.0a3.tar.gz
Algorithm Hash digest
SHA256 18a2c350b2f14204c4189d359229f1aab1533a46fcc88962ab69ee9da2ab345d
MD5 c9aa8a58ec61cabd9c093f760ead2c7f
BLAKE2b-256 c01f5bc0923b4f4ae1f6528cdf14eb91bcda7dbd6213fda18c7e5d4aaad918ba

See more details on using hashes here.

File details

Details for the file suisa_sendemeldung-1.0.0a3-py3-none-any.whl.

File metadata

  • Download URL: suisa_sendemeldung-1.0.0a3-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for suisa_sendemeldung-1.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 6605a03fd9a1aad51f61742716e8ff98f6f310750afb9e657d7b13c79ab41cc4
MD5 4cc88ef5aa465a6b3d80e57f3d951ebd
BLAKE2b-256 b8e50fa0979276bfcbc1ebfb706c551478f9d2f5a16b79bb49a74ca82fcb00fe

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