{"id":23376219,"url":"https://github.com/trustedshops-public/python-mailtrap-handler","last_synced_at":"2025-04-10T18:42:28.728Z","repository":{"id":37741227,"uuid":"323387989","full_name":"trustedshops-public/python-mailtrap-handler","owner":"trustedshops-public","description":"Library to interact with the MailTrap API using Python code","archived":false,"fork":false,"pushed_at":"2025-04-08T22:59:46.000Z","size":84,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T23:28:57.756Z","etag":null,"topics":["mailtrap","pip-package","pypi-package","python","python-package","tppython","tslibraries"],"latest_commit_sha":null,"homepage":"http://opensource.trustedshops.com/python-mailtrap-handler/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trustedshops-public.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-21T16:17:58.000Z","updated_at":"2025-01-31T07:06:44.000Z","dependencies_parsed_at":"2023-02-10T02:31:26.544Z","dependency_job_id":"383e4bcc-9279-4a32-80d9-dcf84e4e4f77","html_url":"https://github.com/trustedshops-public/python-mailtrap-handler","commit_stats":{"total_commits":88,"total_committers":9,"mean_commits":9.777777777777779,"dds":0.6818181818181819,"last_synced_commit":"ee668972365b8f2b7632e346131d1bd5b9190e7c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedshops-public%2Fpython-mailtrap-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedshops-public%2Fpython-mailtrap-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedshops-public%2Fpython-mailtrap-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trustedshops-public%2Fpython-mailtrap-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trustedshops-public","download_url":"https://codeload.github.com/trustedshops-public/python-mailtrap-handler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271910,"owners_count":21075800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mailtrap","pip-package","pypi-package","python","python-package","tppython","tslibraries"],"created_at":"2024-12-21T17:34:37.621Z","updated_at":"2025-04-10T18:42:28.702Z","avatar_url":"https://github.com/trustedshops-public.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-mailtrap-handler\n[![GitHub License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/trustedshops-public/mailtrap-handler/blob/main/LICENSE)\n[![pre-commit](https://img.shields.io/badge/%E2%9A%93%20%20pre--commit-enabled-success)](https://pre-commit.com/)\n[![CircleCI](https://circleci.com/gh/trustedshops-public/python-mailtrap-handler/tree/main.svg?style=shield)](https://circleci.com/gh/trustedshops-public/mailtrap-handler/tree/main)\n[![PyPI version](https://badge.fury.io/py/mailtrap-handler.svg)](https://pypi.org/project/mailtrap-handler)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=trustedshops-public_python-mailtrap-handler\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=trustedshops-public_python-mailtrap-handler)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=trustedshops-public_python-mailtrap-handler\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=trustedshops-public_python-mailtrap-handler)\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=trustedshops-public_python-mailtrap-handler\u0026metric=security_rating)](https://sonarcloud.io/summary/new_code?id=trustedshops-public_python-mailtrap-handler)\n\nImplementation for MailTrap basic functionalities using Python.\n\n## Requirements\n\nAll you need is Python version 3.6 or above\n\n## Installation\n\n```sh\npip3 install mailtrap-handler\n```\n\n## Usage\n\nFor [dedicated documentation click here](https://trustedshops-public.github.io/python-mailtrap-handler/mailtrap_handler)\n\n```python\nfrom mailtrap_handler import MailTrapHandler\n\nmailtrap = MailTrapHandler(TOKEN, ACCOUNT_ID)\n# then do what you need with the mailtrap object\n```\n\n### Functions\n\nGet mail id:\n\n```python\n# default value for title is None\nlist_of_ids = mailtrap.get_mail_id(inbox, email, title=\"Some Title here\")\n# returns a list of found mails ids\n```\n\nGet mail html content:\n\n```python\n# default value for title is None\n# default value for waiting_time is 0\nMailTrapHandler.get_mail(inbox, email, title, waiting_time=30)\n# returns mail html content\n```\n\nClean the inbox:\n\n```python\nMailTrapHandler.clean_inbox(inbox)\n```\n\nDelete target mail:\n\n```python\nMailTrapHandler.delete_mail(inbox, email, title=\"Some Title here\")\n# default value for title is None\n```\n\n## Example Code\n\n```python\nfrom mailtrap_handler import MailTrapHandler\n\n# requirements\ntoken = \"123wellthiswouldbeyourtokenhere098\"\naccount_id = 987654\ninbox = 12349876  # this is your mailtrap inbox id\nemail = \"target_email+probably_with_some_alias@inbox.mailtrap.io\"\ntitle = \"Oy! Congrats on getting Your new T-shirt\"\n\n# creating mailtraphandler object\nmailtrap = MailTrapHandler(token, account_id)\n\n# getting the html content\nmails = mailtrap.get_mail(inbox, email, title=title, 10)\n\n# we do now whatever we need with the recieved mails\n# and now we delete this mail\nmailtrap.delete_mail(inbox, email, title=title)\n\n# you know what let's just delete every mail in the inbox\nmailtrap.clean_inbox(inbox)\n\n# I got no more mails!\n```\n\n## How to Contribute\n\nWe welcome [issues](https://github.com/trustedshops-public/python-mailtrap-handler/issues) to\nand [pull requests](https://github.com/trustedshops-public/python-mailtrap-handler/pulls) against this repository!\n\n### Commit Message Convention\n\nThis repository follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)\n\n#### Format\n\n`\u003ctype\u003e(optional scope): \u003cdescription\u003e`\nExample: `feat(pre-event): Add speakers section`\n\n#### 1. Type\n\nAvailable types are:\n\n- feat → Changes about addition or removal of a feature. Ex: `feat: Add table on landing page`\n  , `feat: Remove table from landing page`\n- fix → Bug fixing, followed by the bug. Ex: `fix: Illustration overflows in mobile view`\n- docs → Update documentation (README.md)\n- style → Updating style, and not changing any logic in the code (reorder imports, fix whitespace, remove comments)\n- chore → Installing new dependencies, or bumping deps\n- refactor → Changes in code, same output, but different approach\n- ci → Update github workflows, husky\n- test → Update testing suite, cypress files\n- revert → when reverting commits\n- perf → Fixing something regarding performance (deriving state, using memo, callback)\n\n#### 2. Optional Scope\n\nLabels per page Ex: `feat(pre-event): Add date label`\n\n*If there is no scope needed, you don't need to write it*\n\n#### 3. Description\n\nDescription must fully explain what is being done.\n\nAdd BREAKING CHANGE in the description if there is a significant change.\n\n**If there are multiple changes, then commit one by one**\n\n- After colon, there are a single space Ex: `feat: Add something`\n- When using `fix` type, state the issue Ex: `fix: File size limiter not working`\n- Use imperative, dan present tense: \"change\" not \"changed\" or \"changes\"\n- Use capitals in front of the sentence\n- Don't add full stop (.) at the end of the sentence\n\n### Publish new release\n\nCommit according to semantic release spec above and let CircleCI (and semantic-release) do the magic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustedshops-public%2Fpython-mailtrap-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrustedshops-public%2Fpython-mailtrap-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrustedshops-public%2Fpython-mailtrap-handler/lists"}