Skip to main content

Temporary email client in Python.

Project description

PyBarid

Python 3.7+ License: MIT

Python library for Barid temporary email service.

Install

pip install pybarid

Usage

Sync Mode (Default)

from pybarid import BaridClient

client = BaridClient()

# Generate email
email = client.generate_email()
print(email.full_address)

# Check messages
messages = client.get_messages(email.address, email.domain)
for msg in messages:
    print(f"{msg.from_address}: {msg.subject}")

# Wait for message
message = client.wait_for_message(email.address, email.domain, timeout=60)
if message:
    print(f"New: {message.subject}")

Async Mode (Faster for multiple requests)

import asyncio
from pybarid import BaridClient

async def main():
    client = BaridClient(async_mode=True)
    
    # Generate multiple emails
    emails = await client.generate_emails_batch(5)
    
    # Check messages for all emails concurrently
    all_messages = await client.get_messages_batch(emails)
    
    for email, messages in all_messages.items():
        print(f"{email}: {len(messages)} messages")

asyncio.run(main())

API

Sync Methods

# Generate email
email = client.generate_email()
email = client.generate_email(domain="example.com")

# Get messages
messages = client.get_messages(email.address, email.domain)

# Wait for message
message = client.wait_for_message(email.address, email.domain, timeout=60)

# Get web inbox
url = client.get_inbox_url(email.address, email.domain)

Async Methods

# Generate email
email = await client.generate_email_async()
email = await client.generate_email_async(domain="example.com")

# Get messages
messages = await client.get_messages_async(email.address, email.domain)

# Wait for message
message = await client.wait_for_message_async(email.address, email.domain, timeout=60)

# Batch operations
emails = await client.generate_emails_batch(5)
all_messages = await client.get_messages_batch(emails)

Credits

Uses Barid API by vwh.


Made by oxno1

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

pybarid-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

pybarid-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pybarid-0.1.0.tar.gz.

File metadata

  • Download URL: pybarid-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pybarid-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aa67d2da71be09c7e6dde02f9e718bcf5cf1a8d5957b39d99415ea9315c830ba
MD5 8716c49dff48468091e8e20c174f6dfa
BLAKE2b-256 da8e880c56f4a121d4258ac87fce170352778eb636692fdbe13e9f8a04e6af99

See more details on using hashes here.

File details

Details for the file pybarid-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pybarid-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pybarid-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6d4a6a2193c5b254d52a11ca2d77f8b823910ce330c5c4369e9a3fd530636b8
MD5 d6e7f768463fcee7781d7948ed4aaece
BLAKE2b-256 a74d1964114987d4f2787bb713ecb7290b5af29f319280cf6886c82c6255adbc

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