A Python client for interacting with the SimpleLogin API.
Project description
SimpleLogin API Client
A Python client for interacting with the SimpleLogin API.
Features
- List aliases
- List mailboxes
- Create custom aliases
- Create random aliases
Installation
Requires the requests library:
pip install requests
Usage
Initialization
First, import the client and initialize it with your SimpleLogin API key.
from simplelogin import SimpleLoginClient, AliasMode
api_key = "YOUR_API_KEY" # Replace with your actual API key
client = SimpleLoginClient(api_key)
# List all aliases (first page)
aliases = client.list_aliases()
if aliases:
for alias in aliases:
print(alias['email'])
# List pinned aliases
pinned_aliases = client.list_aliases(pinned=True)
# Search for aliases containing 'example'
search_results = client.list_aliases(query="example")
mailboxes = client.list_mailboxes()
if mailboxes:
for mailbox in mailboxes:
print(f"ID: {mailbox['id']}, Email: {mailbox['email']}")
# Get available mailboxes first (needed for mailbox_ids)
mailboxes = client.list_mailboxes()
if mailboxes:
mailbox_ids = [m['id'] for m in mailboxes] # Use IDs of mailboxes to receive emails
new_alias = client.create_custom_alias(
prefix="my_custom_prefix",
mailbox_ids=mailbox_ids,
suffix="@yourdomain.com", # Optional: Uses the first available suffix if None
name="My Alias Name", # Optional
note="Alias for testing" # Optional
)
if new_alias:
print(f"Created alias: {new_alias['email']}")
else:
print("Failed to create custom alias.")
else:
print("Could not fetch mailboxes.")
# Create a random alias using words (default)
random_alias_word = client.create_random_alias(note="Random word alias")
if random_alias_word:
print(f"Created random word alias: {random_alias_word['email']}")
# Create a random alias using UUID
random_alias_uuid = client.create_random_alias(mode=AliasMode.UUID, note="Random UUID alias")
if random_alias_uuid:
print(f"Created random UUID alias: {random_alias_uuid['email']}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simplelogin_client-0.1.0.tar.gz
(16.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simplelogin_client-0.1.0.tar.gz.
File metadata
- Download URL: simplelogin_client-0.1.0.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e5e2df10f378394be920c1676cdf308d21531588616cb27072eab2488c09d58
|
|
| MD5 |
4ba1661637ed7cc4aae0d3069be58e79
|
|
| BLAKE2b-256 |
029e5279a9cc52ac714d2a0cc3211edc05a5bcaa25deec1b28d24fb09f2fa90e
|
File details
Details for the file simplelogin_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: simplelogin_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f2d9959c1fe123d87d5b1b1f0efd8aeca4f2ea5f239f77f5ecb8da46204fa65
|
|
| MD5 |
eacdfbeff5d0d898333930b267333a5d
|
|
| BLAKE2b-256 |
554d8613236e519abfb07e47b181651e91443b57f628a8461a528698cdd6ee01
|