emailnator


Nameemailnator JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/repollo/emailnator
SummaryA Python wrapper for the Emailnator temporary email service.
upload_time2023-05-05 15:29:07
maintainer
docs_urlNone
authorrepollo
requires_python
license
keywords emailnator wrapper temporary email
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Emailnator

Emailnator is a Python wrapper for the Emailnator temporary email service. It provides a convenient way to generate temporary email addresses, retrieve inbox messages, and fetch individual messages.

## Installation

To install the Emailnator package, simply run:

```bash
pip install emailnator
```

## TODO

- [ ] Exapand temporary email service providers
  - [ ] https://mail.tm/
  - [ ] https://temp-mail.org/
  - [ ] https://tempmailo.com/
  - [ ] https://www.disposablemail.com/
  - [ ] https://internxt.com/en/temporary-email/
  - [ ] https://temp-mail.io/
  - [ ] https://getnada.com/
  - [ ] https://www.fakemail.net/
  - [x] https://www.emailnator.com/
- [ ] CLI to get an email and inbox of the email in from the terminal
- [ ] Add Logging 
- [ ] Expand the errors for better event capture
- [ ] Add a proxy?

To install the Emailnator package for development purposes, follow these steps:

1. Clone the repository to your local machine using the command:

```bash
git clone https://github.com/repollo/Emailnator.git
```

2. Navigate to the cloned repository directory:

```bash
cd Emailnator
```

3. Create a virtual environment for the project:

```bash
python -m venv venv
```

4. Activate the virtual environment:

```bash
source venv/bin/activate
```

Note: If you are using Windows, use the following command instead:

```bash
venv\Scripts\activate
```

5. Install the required dependencies using pip:

```bash
pip install -r requirements.txt
```

6. Install the package in development mode:

```bash
pip install -e .
```

This will install the package in editable mode, allowing you to modify the source code and see the changes reflected immediately.


## Usage

First, import the `Emailnator` class:

```python
from emailnator import Emailnator
```

Then, create an `Emailnator` instance:

```python
emailnator = Emailnator()
```

By default, the `.env` file containing authentication tokens will be created in the same directory as the `emailnator.py` file. You can specify a custom directory using the `env_path` parameter:

```python
custom_path = "/path/to/your/custom/directory"
emailnator = Emailnator(env_path=custom_path)
```

### Generate a temporary email address

```python
email_data = emailnator.generate_email()
email_address = email_data["email"][0]
print(email_address)
```

### Retrieve inbox messages

```python
inbox_data = emailnator.inbox(email_address)
print(inbox_data)
```

### Get a specific message

```python
message_id = inbox_data["messageData"][3]["messageID"]
message_data = emailnator.get_message(email_address, message_id)
print(message_data)
```

### Example

```python
from emailnator import Emailnator

emailnator = Emailnator()

# Generate an email
email_data = emailnator.generate_email()
email = email_data["email"][0]

# Get existing email if generated before.
email = emailnator.get_existing_email()

# Get email inbox of email
emails = emailnator.inbox(email)

# Select a specific email message id
message_id = emails["messageData"][1]["messageID"]
    
# Get the email message id contents
email_content = emailnator.get_message(email, message_id)

```

## License

This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/repollo/emailnator",
    "name": "emailnator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "emailnator wrapper temporary email",
    "author": "repollo",
    "author_email": "repollo.marrero@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/66/ff/ae804a4822b447ce7911f473f245aabb65df29ee98e93533d143e8294006/emailnator-0.1.0.tar.gz",
    "platform": null,
    "description": "# Emailnator\n\nEmailnator is a Python wrapper for the Emailnator temporary email service. It provides a convenient way to generate temporary email addresses, retrieve inbox messages, and fetch individual messages.\n\n## Installation\n\nTo install the Emailnator package, simply run:\n\n```bash\npip install emailnator\n```\n\n## TODO\n\n- [ ] Exapand temporary email service providers\n  - [ ] https://mail.tm/\n  - [ ] https://temp-mail.org/\n  - [ ] https://tempmailo.com/\n  - [ ] https://www.disposablemail.com/\n  - [ ] https://internxt.com/en/temporary-email/\n  - [ ] https://temp-mail.io/\n  - [ ] https://getnada.com/\n  - [ ] https://www.fakemail.net/\n  - [x] https://www.emailnator.com/\n- [ ] CLI to get an email and inbox of the email in from the terminal\n- [ ] Add Logging \n- [ ] Expand the errors for better event capture\n- [ ] Add a proxy?\n\nTo install the Emailnator package for development purposes, follow these steps:\n\n1. Clone the repository to your local machine using the command:\n\n```bash\ngit clone https://github.com/repollo/Emailnator.git\n```\n\n2. Navigate to the cloned repository directory:\n\n```bash\ncd Emailnator\n```\n\n3. Create a virtual environment for the project:\n\n```bash\npython -m venv venv\n```\n\n4. Activate the virtual environment:\n\n```bash\nsource venv/bin/activate\n```\n\nNote: If you are using Windows, use the following command instead:\n\n```bash\nvenv\\Scripts\\activate\n```\n\n5. Install the required dependencies using pip:\n\n```bash\npip install -r requirements.txt\n```\n\n6. Install the package in development mode:\n\n```bash\npip install -e .\n```\n\nThis will install the package in editable mode, allowing you to modify the source code and see the changes reflected immediately.\n\n\n## Usage\n\nFirst, import the `Emailnator` class:\n\n```python\nfrom emailnator import Emailnator\n```\n\nThen, create an `Emailnator` instance:\n\n```python\nemailnator = Emailnator()\n```\n\nBy default, the `.env` file containing authentication tokens will be created in the same directory as the `emailnator.py` file. You can specify a custom directory using the `env_path` parameter:\n\n```python\ncustom_path = \"/path/to/your/custom/directory\"\nemailnator = Emailnator(env_path=custom_path)\n```\n\n### Generate a temporary email address\n\n```python\nemail_data = emailnator.generate_email()\nemail_address = email_data[\"email\"][0]\nprint(email_address)\n```\n\n### Retrieve inbox messages\n\n```python\ninbox_data = emailnator.inbox(email_address)\nprint(inbox_data)\n```\n\n### Get a specific message\n\n```python\nmessage_id = inbox_data[\"messageData\"][3][\"messageID\"]\nmessage_data = emailnator.get_message(email_address, message_id)\nprint(message_data)\n```\n\n### Example\n\n```python\nfrom emailnator import Emailnator\n\nemailnator = Emailnator()\n\n# Generate an email\nemail_data = emailnator.generate_email()\nemail = email_data[\"email\"][0]\n\n# Get existing email if generated before.\nemail = emailnator.get_existing_email()\n\n# Get email inbox of email\nemails = emailnator.inbox(email)\n\n# Select a specific email message id\nmessage_id = emails[\"messageData\"][1][\"messageID\"]\n    \n# Get the email message id contents\nemail_content = emailnator.get_message(email, message_id)\n\n```\n\n## License\n\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A Python wrapper for the Emailnator temporary email service.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/repollo/emailnator"
    },
    "split_keywords": [
        "emailnator",
        "wrapper",
        "temporary",
        "email"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a12dceff83b9525b68e9b59430f97c75ab02e5b774c90493c091be97dc8e10c5",
                "md5": "5a2d50028cd21cb1b7bbc35f85f91ba9",
                "sha256": "641e64a099314aedc46953fafc552baded3794b1aefc09f31f0a9eb445898180"
            },
            "downloads": -1,
            "filename": "emailnator-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5a2d50028cd21cb1b7bbc35f85f91ba9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4118,
            "upload_time": "2023-05-05T15:29:05",
            "upload_time_iso_8601": "2023-05-05T15:29:05.575176Z",
            "url": "https://files.pythonhosted.org/packages/a1/2d/ceff83b9525b68e9b59430f97c75ab02e5b774c90493c091be97dc8e10c5/emailnator-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66ffae804a4822b447ce7911f473f245aabb65df29ee98e93533d143e8294006",
                "md5": "571004288b236a63ebaddf0e9675f6da",
                "sha256": "7015197714a7b3b11d177118a3d6f219536c4a9741254c9dfeee8e0e2169b885"
            },
            "downloads": -1,
            "filename": "emailnator-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "571004288b236a63ebaddf0e9675f6da",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3863,
            "upload_time": "2023-05-05T15:29:07",
            "upload_time_iso_8601": "2023-05-05T15:29:07.679881Z",
            "url": "https://files.pythonhosted.org/packages/66/ff/ae804a4822b447ce7911f473f245aabb65df29ee98e93533d143e8294006/emailnator-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-05 15:29:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "repollo",
    "github_project": "emailnator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "emailnator"
}
        
Elapsed time: 0.09121s