Small wrapper that uses ZEEP to communicate with a SOAP endpoint linked to a Sympa server, to let automation in lists creation.
Example
Start by creating a new client, and log in. Then, you can use some pre-constructed methods.
from sympasoap import Client
client = Client("https://lists.example.com/sympa")
client.login("admin@example.com", "MY_STRONG_PASSWORD") # Get from env
# Create a list of type hotline that is named automatically-created@lists.example.com with basic description
client.create_list(list_name="automatically-created", subject="Automatically created list", template="hotline",
description="This mailing list was created from a Python shell.", topic="computers/software")
# Subscribe the email address toto@example.com with name "Toto TOTO" to the list automatically-created@lists.example.com
# in non-quiet mode: the user will receive a notification that they got subscribed
client.subscribe(email="toto@example.com", list_address="automatically-created", quiet=False, name="Toto TOTO")
# Unsubscribe the email in quiet mode
client.subscribe(email="toto@example.com", list_address="automatically-created", quiet=True)
Available functions
def login(self, email: str, password: str) -> None:
"""
Login into the API. Set a cookie for future connexions.
"""
def check_cookie(self) -> str:
"""
From the current stored cookie, retrieve the email address.
"""
def is_subscriber(self, email: str, mailing_list: str, function: str = "subscriber") -> bool:
"""
Check if the given `email` is a member of type `function` in the `mailing_list`.
The function parameter is one between subscriber, editor or owner.
"""
def get_subscribers(self, mailing_list: str, emails_only: bool = True) -> list:
"""
Get the list of all subscribers of a list, including the administrators and the editors.
If emails_only == True, retrieve the list of email addresses only.
Else, retrieve MLUser object, with the name of the user and the role.
"""
def lists(self, topic: str, subtopic: str) -> list:
"""
Get all the (visible) lists that match the given topic and the given subtopic.
See TOPICS and SUBTOPICS for valid topics and subtopics.
"""
def all_lists(self) -> list:
"""
Retrieve all lists.
"""
def create_list(self, list_name: str, subject: str, template: str, description: str, topic: str,
use_custom_template: bool = False, raise_error: bool = True) -> bool:
"""
Create a new mailing-list.
"""
def delete_list(self, list_name: str, raise_error: bool = False) -> bool:
"""
Close a mailing list.
Warning: the list is not deleted in order to keep the history. Please use the web interface to fully
delete the list.
Well, the main reason is that the API does not provide a delete method.
"""
def subscribe(self, email: str, list_address: str, quiet: bool, name: str = "", raise_error: bool = False) -> bool:
"""
Subscribe the user with the given email to the given mailing list.
If the quiet mode is enabled, the user won't receive a notification that they got subscribed.
"""
def unsubscribe(self, email: str, list_address: str, quiet: bool, raise_error: bool = False) -> bool:
"""
Subscribe the user with the given email to the given mailing list.
If the quiet mode is enabled, the user won't receive a notification that they got subscribed.
"""
Metadata
Release files for sympasoap 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sympasoap-1.1.3.tar.gz | 18.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sympasoap-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.2 kB
Release files / sympasoap-1.1.3.tar.gz
| Download URL | sympasoap-1.1.3.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e03aceaad881c29ab2c74a18d9961058c6be82fb64268882119854bb26dbd0a6
|
|
BLAKE2b-256 checksum How to use checksums |
0c672d98a174a8e191f57e5e4ccf3f973e670f0df9b2e085207ff07a0843ad59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Release files / sympasoap-1.1.3-py3-none-any.whl
| Download URL | sympasoap-1.1.3-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32f03e52aeced244f913c9e51797dab25d432d812983bc252ef908b72dbb19b1
|
|
BLAKE2b-256 checksum How to use checksums |
1d534c605c2e774b818a25e865c028de3c05e87198daac1db4016c566a32cb19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Security for sympasoap 1.1.3
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.