Skip to main content

DeveloperMail Python Wrapper

Project description

DeveloperMail python wrapper based on official documentation https://www.developermail.com/api/v1/

Install

pip install devmail

Usage

Creating mailbox
>>> from devmail import DevMail
>>> mailbox = DevMail()
>>> mailbox.create()
{'username': 'z-werhj4', 'token': 'B1DC9D1D6C9C1519728C4056F545EA0288946D54'}
Create new token
>>> mailbox.newtoken()
{'username': 'z-werhj4', 'token': 'DC7F2CD7C195E66F637123A34D3D2A57FF0A18A0'}
Get message ids

In this example, I send two message to z-werhj4@developermail.com from my real email.

>>> mailbox.getmailids()
['637553086207559378', '637553086352838482']

The email id is a timestamp.

Get messages from list of id
>>> mails = mailbox.getmails(['637553086207559378', '637553086352838482'])
>>> len(mails)
2
>>> mails[0]
{'key': '637553086207559378', 'value': 'DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.id; s=s2048; t=1619711818; bh=ffhpeYB/ObY5N0hGrQtyxG3MKCJQBhB7v8HKMpfmOjU=; h=Date:From:Reply-To:To:Subject:References:From:Subject:Reply-To; b=E2 TRUNCATED}

It will return list of {'key': mail id, 'value': raw mail content}. If mailids list is not supplied, it will return all email available after mailbox.getmailids().

Get a message
>>> mail = mailbox.getmail('637553086207559378', raw=True)
>>> mail
'DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.id; s=s2048; t=1619711818; bh=ffhpeYB/ObY5N0hGrQtyxG3MKCJQBhB7v8HKMpfmOjU=; h=Date:From:Reply-To:To:Subject:References:From:Subject:Reply-To; b=E20 TRUNCATED'

Note: raw parameter is not useful now. I will improve the email parsing it in the future.

Delete a message
>>> mailbox.delmail('637553086207559378')
{'success': True, 'errors': None, 'result': True}
>>> mailbox.getmail('637553086207559378', raw=True) # return None
>>> mailbox.getmailids()
['637553086352838482']

TBD:

  1. Empty mailbox
  2. Convert timestamp to Date Time
  3. Save credentials
  4. Refactor code

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

devmail-0.0.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

devmail-0.0.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file devmail-0.0.4.tar.gz.

File metadata

  • Download URL: devmail-0.0.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for devmail-0.0.4.tar.gz
Algorithm Hash digest
SHA256 08db212d90f0071ba53fe8abb219939a6d07a65bfdd8786a585d2718dda8c3c8
MD5 2d32ad63193b1d2738251990ae4df07e
BLAKE2b-256 10c13d98d8f35e623abdea8a323d2744f6da260ecb141a4f1a85b550d40422cc

See more details on using hashes here.

File details

Details for the file devmail-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: devmail-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

File hashes

Hashes for devmail-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9a40d65d566455f9719d334f4de4dcd6e2f73aa9ad71a8a652ac58d53d1977d5
MD5 651ca204cf8466af1eb3b7cc9fd74a53
BLAKE2b-256 afef9fbe3e8929a7e1078ba430afe48c14fb3c935747bbbb59c05ef1e34c859d

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