Skip to main content

Python client for the Guerrilla Mail disposable email JSON API

Project description

guerrillamail-api

Python client for the Guerrilla Mail disposable email JSON API.

Create temporary inboxes, poll for new mail, read full messages, customize addresses, extend lifetime, and delete messages — with automatic PHPSESSID / SUBSCR cookie handling.

Install

pip install guerrillamail-api

Quick start

from guerrillamail import GuerrillaMailClient

with GuerrillaMailClient() as gm:
    mailbox = gm.create_email()
    print("Address:", mailbox.address)
    print("Expires in (s):", mailbox.seconds_remaining())

    inbox = gm.check_inbox()
    for msg in inbox.messages:
        print(msg.mail_from, "—", msg.mail_subject)

    full = gm.read_message(inbox.messages[0].mail_id)
    print(full.mail_body)

Wait for an incoming email

with GuerrillaMailClient() as gm:
    gm.create_email()
    gm.check_inbox()  # consume welcome mail sequence

    # Poll until a message arrives (adjust filters as needed)
    msg = gm.wait_for_message(
        timeout=180,
        poll_interval=5,
        subject_contains="verification",
    )
    print(msg.mail_body)

Custom address

with GuerrillaMailClient() as gm:
    gm.create_email()
    gm.set_username("mytestuser")
    print(gm.mailbox.address)

API coverage

Method Guerrilla Mail function
create_email() get_email_address
set_username() set_email_user
check_inbox() check_email
list_inbox() get_email_list
read_message() fetch_email
delete_messages() del_email
forget_address() forget_me
extend_time() extend
get_older_list() get_older_list

Lower-level methods (get_email_address, check_email, …) return raw JSON dicts.

Rate limits

The public API may be rate-limited. Avoid tight polling; use poll_interval ≥ 5 seconds in production.

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

guerrillamail_api-1.0.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

guerrillamail_api-1.0.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file guerrillamail_api-1.0.0.tar.gz.

File metadata

  • Download URL: guerrillamail_api-1.0.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for guerrillamail_api-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b1e9064ab1ba5b1827fa1ea8992cb5a215780853acd12420dc291d10039957a5
MD5 f984233228aefa1d1ef046262f6b5d0f
BLAKE2b-256 a703e4f429c46a865b87cdde0be1fcba7f792092787ed3f016f6569af745a9ac

See more details on using hashes here.

File details

Details for the file guerrillamail_api-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for guerrillamail_api-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1df4c74dc85fe8f3ed008be084089e24004010c33506e2ccefd3afbb676c2e
MD5 1e1dd86c49d4dd0cf3fdf4fae578eb84
BLAKE2b-256 ecc6260349163844ca50d2436f977b0a85ab96edaf4cabfe112f5f7d425c841f

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