Skip to main content

url-signer-python

PyPI version Python version Build Status

Overview

url-signer-python is a Python library designed to generate signatures for URLs. These signatures can be used by the IO River service with Signed-URLs enabled to secure access to content. The library generates signatures for all CDN providers associated with the service.


Installation

To install url-signer-python, you can use pip:

pip install url-signer-python

Alternatively, you can clone the repository and install it manually:

git clone https://github.com/ioriver/url-signer-python.git
cd url-signer-python
pip install .

Usage

Below is some example to help you get started:

Step 1: Create URL Signer

from ioriver.url_signer import UrlSigner

private_key = "YourPrivateKey"
encryption_key = "YourEncryptionKey"

# use the provider key information from your service
providers_key_info = {
    "cloudfront_key_id": "1234",
    "fastly_key_id": "5678"
}

signer = UrlSigner(private_key, encryption_key, providers_key_info)

Step 2: Generate Signature

# the policy to be signed
policy = {
    "resources": "https://test.example.com/streams/*",
    "condition": {
        "end_time": 1733356800
    }
}

# generate signature for all CDNs
signature = signer.generate_url_signature(policy)

API Reference

UrlSigner Constructor

Parameters

  • private_key (string): The private key for signing the URL.
  • encryption_key (string): The encryption key for signing the URL.
  • providers_key_info (object): Information about the keys deployed within the CDN providers (copied from your service).

generate_url_signature(policy)

Attributes for policy

  • resources (required): A string specifying the URL or URL pattern the policy applies to.

  • condition (required):
    A dictionary containing conditions for the policy.

    • end_time (required):
      An integer specifying the UNIX timestamp when the signature will expire.

    Additional optional attributes in the condition dictionary include:

    • start_time:
      An integer specifying the UNIX timestamp when the signature becomes valid. Default: None.

Requirements

This library requires:

  • Python 3.7+
  • Dependencies listed in requirements.txt.

To install dependencies manually:

pip install -r requirements.txt

Testing

pytest

Support

If you encounter any issues, please open an issue on GitHub or contact us at support@ioriver.io.

Metadata

Release files for url-signer-python 0.6.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 url-signer-python 0.6.0
File Size Uploaded
url_signer_python-0.6.0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for url-signer-python 0.6.0
File Interpreter ABI Platform
url_signer_python-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / url_signer_python-0.6.0.tar.gz

Download URL url_signer_python-0.6.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
632c338570c8ae48715827768edc2bc6115d4fa942b4a95ea5f389fc2f121b2d
BLAKE2b-256 checksum
How to use checksums
36133302be91c381455ba160ed76ea1fe8653d65f893ef73c1920df7798adf89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / url_signer_python-0.6.0-py3-none-any.whl

Download URL url_signer_python-0.6.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
909fcdf9e2f64c7f9f9bd45a4e3860d4384f479e4f44ea6102bafc101c62f974
BLAKE2b-256 checksum
How to use checksums
11069698f1ac747ce8e6c4c7298bdcd87919f1c74f54f7c3c9e57f58adc42ad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.0

2 release files

This release

0.6.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

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