Skip to main content

ECG List

This package provides simple access to the austrian RTR (Rundfunk und Telekom Regulierungs-GmbH) “ECG list”, the registry of persons and companies who do not wish to receive promotional e-mail.

Typical usage looks like this:

from ecglist import ECGList

e = ECGList()
if not e.get_blacklist_status_code(email):
    send_email(email)
else:
    print "%s does not want to receive email" % email

Usage

Set up the interface:

from ecglist import ECGList

# Defaults to reading "ecg-liste.hash" in current directory
blacklist = ECGList(filename="my-ecg-list.hash")

Test for an email address being in the blacklist:

"foo@bar.example" in blacklist

Get an email’s status code:

code = blacklist["foo@bar.example"]

code will be None if the email address was not found in the blacklist or a status code indicating the type of match otherwise.

Same, but get a human readable string instead of a status code:

status_str = blacklist.get_blacklist_status("foo@bar.example")

Note that the data file is only loaded when the first address is verified, i.e. the address verification might raise an Exception if the hash file has vanished in the meantime.

To reread the on-disk hash file or to free up the in-memory hash table, use the reread() method like so:

e.reread()

Background

Service providers that send unsolicited advertising e-mail have to observe this list. Please refer to https://www.rtr.at/en/tk/E_Commerce_Gesetz for the legal background. Unfortunately, the only sample code provided by the RTR is in Perl (Boo! Hiss!), which prompted the creation of this module.

Obtaining the official blacklist

You will need to follow the steps outlined at https://www.rtr.at/en/tk/NutzenECG to obtain a copy of the current ECG list. Save the “ecg-liste.hash” you receive and configure the ECGList to access that file.

Installation

To install this module, simply:

$ pip install email-ecglist

Metadata

Release files for email-ecglist 1.6

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

Source distribution (sdist)

Source distribution for email-ecglist 1.6
File Size Uploaded Provenance Actions
email-ecglist-1.6.tar.gz 4.3 kB Without provenance Details for email-ecglist-1.6.tar.gz

Release files / email-ecglist-1.6.tar.gz

Download URL email-ecglist-1.6.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e2dde1855ba3fb62db5301c4e6d9102335add2a960475e100b36dde4347f8aa3
BLAKE2b-256 checksum
How to use checksums
355a102dff30eb2cc4bfbda1907e3020267843bfc14713821faa26238222d5b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for email-ecglist 1.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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