Skip to main content

A package to send data (dict, list, pandas DataFrame) as beautiful HTML emails

Project description

Drop Email as DE 🍻

example 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

  • hello world
drop_email "hello world!"
  • python script
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:

  1. 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"
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drop_email-0.1.3.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drop_email-0.1.3-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file drop_email-0.1.3.tar.gz.

File metadata

  • Download URL: drop_email-0.1.3.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

Hashes for drop_email-0.1.3.tar.gz
Algorithm Hash digest
SHA256 293968bb835ca90974ab8975fb239ba5da6bcceb9fe07048e4f3342a6ed03454
MD5 fb1a50b0d18d32d2360763450849a8a7
BLAKE2b-256 1086f73fb9a065a3388b1d36a2fa758e64d7c5effabffb16758925c43ad3967f

See more details on using hashes here.

File details

Details for the file drop_email-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: drop_email-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for drop_email-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 65908aff4013403e7aac394d8e6e996a7cd7a107f932fecad2608120584acf34
MD5 71677ba7ab2d50a66dda67ca53e61cfb
BLAKE2b-256 2be2f01d18199c42faea0b84644f26dbf47017d65a6f369588b753e1d15ca2c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page