A package to send data (dict, list, pandas DataFrame) as beautiful HTML emails
Project description
drop_email
A Python package to send data (dictionaries, lists, pandas DataFrames) as beautiful HTML emails.
Features
- 📧 Send data as beautiful HTML emails
- 📊 Beautiful pandas DataFrame rendering
- ⚙️ Configurable sender and receiver emails
- 🎨 Modern, responsive HTML templates
Installation
pip install drop_email
Or install in development mode:
git clone <repository>
cd drop_email
pip install -e .
Post-Installation: Initialize Configuration
Before using drop_email, you need to initialize the configuration file:
drop_email init
This creates a default configuration file. Then edit it with your email settings.
Other CLI commands:
# View configuration file path
drop_email config
# Show help
drop_email --help
Quick Start
import drop_email as de
import pandas as pd
# Create a sample DataFrame
df = pd.DataFrame({
'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 30, 35],
'City': ['New York', 'London', 'Tokyo']
})
# Send the DataFrame as an email
de.send(df, subject="My Data Report")
Configuration
Configuration File Location
The package uses the following priority to locate the configuration file:
-
Environment variable
DROP_EMAIL_CONFIG(recommended for stability)- Set to an absolute path for a fixed location that doesn't depend on home directory
- Example:
export DROP_EMAIL_CONFIG="/path/to/drop_email/config.yaml"
-
XDG Standard location (default)
$XDG_CONFIG_HOME/drop_email/config.yaml(if XDG_CONFIG_HOME is set)~/.config/drop_email/config.yaml(fallback)
Initial Setup
After installation, initialize the configuration file:
drop_email init
This creates the configuration file at the default location ~/.config/drop_email/config.yaml. Then edit this file to configure:
- Sender email: Your email address and password (use App Password for Gmail)
- SMTP settings: SMTP server and port
- Receiver emails: List of recipient email addresses
Use Environment Variable for Fixed Path
For maximum stability (especially if your home directory may change), set an environment variable:
# Linux/Mac
export DROP_EMAIL_CONFIG="/PATH_TO_YOUR/config.yaml"
# Windows (PowerShell)
$env:DROP_EMAIL_CONFIG="C:\path\to\drop_email\config.yaml"
Add this to your shell profile (.bashrc, .zshrc, etc.) to make it persistent.
Example Configuration
email:
sender:
address: "your_email@example.com"
password: "your_app_password"
smtp_server: "smtp.gmail.com"
smtp_port: 587
receivers:
- "receiver1@example.com"
- "receiver2@example.com"
View Configuration Path
To see where your configuration file is located:
drop_email config
License
MIT
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
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 drop_email-0.1.2.tar.gz.
File metadata
- Download URL: drop_email-0.1.2.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e399323ecd7d195b905f240e737ce377fe8747870b9051525b08fd9bd0e531b5
|
|
| MD5 |
f9852effdfe3fe7b609c67efd7d2c6ec
|
|
| BLAKE2b-256 |
08ca470a89f8f815086fac3f1751de0370535a0a188a485a9d5200890a7cf032
|
File details
Details for the file drop_email-0.1.2-py3-none-any.whl.
File metadata
- Download URL: drop_email-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45d7de574d2883d62dd05c2662a25b80cd56d5d19644d14431c799f84bcd9412
|
|
| MD5 |
a6c7a0238dad839364ecf97491df3a99
|
|
| BLAKE2b-256 |
cfb77f3297d1482e8fb67339f325fc579a64047a15dbbcda52e349745a430b41
|