{"id":13609965,"url":"https://github.com/martinrusev/imbox","last_synced_at":"2025-05-14T18:02:30.776Z","repository":{"id":9645621,"uuid":"11579941","full_name":"martinrusev/imbox","owner":"martinrusev","description":"Python IMAP for Human beings","archived":false,"fork":false,"pushed_at":"2024-04-16T09:00:28.000Z","size":2248,"stargazers_count":1199,"open_issues_count":61,"forks_count":190,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-05-14T18:02:06.969Z","etag":null,"topics":["imap","python-imap"],"latest_commit_sha":null,"homepage":"","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/martinrusev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-22T11:40:29.000Z","updated_at":"2025-05-10T13:03:55.000Z","dependencies_parsed_at":"2023-01-13T15:29:10.493Z","dependency_job_id":"2b709bd5-e2ca-428f-ab73-868d67f62cad","html_url":"https://github.com/martinrusev/imbox","commit_stats":{"total_commits":249,"total_committers":55,"mean_commits":4.527272727272727,"dds":0.8273092369477911,"last_synced_commit":"616e278519a6b906d42e98a44acd4012fe742aba"},"previous_names":["martinrusev/mailbox"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinrusev%2Fimbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinrusev%2Fimbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinrusev%2Fimbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinrusev%2Fimbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinrusev","download_url":"https://codeload.github.com/martinrusev/imbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198453,"owners_count":22030964,"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":["imap","python-imap"],"created_at":"2024-08-01T19:01:39.796Z","updated_at":"2025-05-14T18:02:30.695Z","avatar_url":"https://github.com/martinrusev.png","language":"Python","funding_links":[],"categories":["Python","Email","资源列表","电子邮件","CONTENTS","Email [🔝](#readme)","Awesome Python"],"sub_categories":["电子邮件","Электронная_почта","Email"],"readme":"# Imbox - Python IMAP for Humans\n\n![workflow](https://github.com/martinrusev/imbox/actions/workflows/python-app.yml/badge.svg)\n\nPython library for reading IMAP mailboxes and converting email content\nto machine readable data\n\n## Requirements\n\nPython (3.6, 3.7, 3.8, 3.9)\n\n## Installation\n\n`pip install imbox`\n\n## Usage\n\n``` python\nfrom imbox import Imbox\n\n# SSL Context docs https://docs.python.org/3/library/ssl.html#ssl.create_default_context\n\nwith Imbox('imap.gmail.com',\n        username='username',\n        password='password',\n        ssl=True,\n        ssl_context=None,\n        starttls=False) as imbox:\n\n    # Get all folders\n    status, folders_with_additional_info = imbox.folders()\n\n    # Gets all messages from the inbox\n    all_inbox_messages = imbox.messages()\n\n    # Unread messages\n    unread_inbox_messages = imbox.messages(unread=True)\n\n    # Flagged messages\n    inbox_flagged_messages = imbox.messages(flagged=True)\n\n    # Un-flagged messages\n    inbox_unflagged_messages = imbox.messages(unflagged=True)\n\n    # Flagged messages\n    flagged_messages = imbox.messages(flagged=True)\n\n    # Un-flagged messages\n    unflagged_messages = imbox.messages(unflagged=True)\n\n    # Messages sent FROM\n    inbox_messages_from = imbox.messages(sent_from='sender@example.org')\n\n    # Messages sent TO\n    inbox_messages_to = imbox.messages(sent_to='receiver@example.org')\n\n    # Messages received before specific date\n    inbox_messages_received_before = imbox.messages(date__lt=datetime.date(2018, 7, 31))\n\n    # Messages received after specific date\n    inbox_messages_received_after = imbox.messages(date__gt=datetime.date(2018, 7, 30))\n\n    # Messages received on a specific date\n    inbox_messages_received_on_date = imbox.messages(date__on=datetime.date(2018, 7, 30))\n\n    # Messages whose subjects contain a string\n    inbox_messages_subject_christmas = imbox.messages(subject='Christmas')\n\n    # Messages whose UID is greater than 1050\n    inbox_messages_uids_greater_than_1050 = imbox.messages(uid__range='1050:*')\n\n    # Messages from a specific folder\n    messages_in_folder_social = imbox.messages(folder='Social')\n\n    # Some of Gmail's IMAP Extensions are supported (label and raw):\n    all_messages_with_an_attachment_from_martin = imbox.messages(folder='all', raw='from:martin@amon.cx has:attachment')\n    all_messages_labeled_finance = imbox.messages(folder='all', label='finance')\n\n    for uid, message in all_inbox_messages:\n    # Every message is an object with the following keys\n\n        message.sent_from\n        message.sent_to\n        message.subject\n        message.headers\n        message.message_id\n        message.date\n        message.body.plain\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinrusev%2Fimbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinrusev%2Fimbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinrusev%2Fimbox/lists"}