Skip to main content

A simple python wrapper for the Public mailinator websockets API

Project description

Mailinator Public API

Python wrapper for mailinator's public api. This library scrapes mailinator's websockets api and gives an abstraction layer for basic operations such as viewing the inbox, email's content and removing them.

This means that this will allow you to to view and remove emails from public inboxes of https://www.mailinator.com without the need of a headless browser. Notice there is a limit for removing emails.

Usage

I hope it is simple enough.

from mailinatorapi import PublicInbox
inbox = PublicInbox("carlos")
print(inbox.web_url)
# Iterate over the emails and print some info
for email in inbox:
    print(email.from_address)
    print(email.from_name)
    print(email.subject)
    print(email.seconds_ago)
    print(email.text)
    print(email.html)
    print([f"{link.text}: {link.url}" for link in email.links])

# remove the last email
email = inbox.get_lastest_email()
print(email.from_address)
ok, msg = email.remove()
if ok:
    print("Removal successful! ", msg)
else:
    print("Removal failed! ", msg)

You can access the raw json response for the email object with email.json.

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

mailinator-public-api-0.1.1.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

mailinator_public_api-0.1.1-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

Supported by

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