Skip to main content

iab-tcf

Build Status codecov Codacy Badge Releasing Documentation Status

A Python implementation of the IAB consent strings (v1.1 and v2)

Installing

Install and update using pip:

pip install -U iab-tcf

Documentation

Documentation of this package can be found at readthedocs.io.

To generate the documentation locally:

pip install sphinx sphinx_rtd_theme
cd docs/
sphinx-apidoc -f -o . ../iab_tcf/
make html

A Simple Example

In order to decode a v1.1 or v2 consent string automatically we can do:

from iab_tcf import decode

consent = decode("CO5VTlWO5VTlWH1AAAENAwCwAIAAAAAAAIAAAAoAAAAA.YAAAAAAAAAA")

print(consent.version) # prints 2

If we want to improve performance and we already know it's going to be a v2 consent string we can do:

from iab_tcf import decode_v2

consent = decode_v2("CO5VTlWO5VTlWH1AAAENAwCwAIAAAAAAAIAAAAoAAAAA.YAAAAAAAAAA")

print(consent.version) # prints 2

Tests

In order to run the tests locally we can do:

pip install -r requirements-test.txt
pytest -v .

Thanks

Many thanks to LiveRamp/iabconsent which greatly inspired this project, and forms the basis and internal logic.

Release files for iab-tcf 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iab-tcf 0.2.2
File Size Uploaded
iab-tcf-0.2.2.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iab-tcf 0.2.2
File Interpreter ABI Platform
iab_tcf-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / iab-tcf-0.2.2.tar.gz

Download URL iab-tcf-0.2.2.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7cf487331859ccdecec5bfab8434aa77677054092b95209e4c0d38e5c5c3f5ee
BLAKE2b-256 checksum
How to use checksums
56e24f55d67b5a42318f959ebacb629fb0701ab5aecb11d7510fd9b26e967a9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Release files / iab_tcf-0.2.2-py3-none-any.whl

Download URL iab_tcf-0.2.2-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
978ad80f0ea827f30b16646a271bc0f4812ce083012241150988c0cb11ccb605
BLAKE2b-256 checksum
How to use checksums
cffca3f3701da727a0f1cfe16b4b3104da2cfcda8c095efd3f279588f7eac345
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

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