Skip to main content

Outlook mailbox client built on Microsoft Graph with helpers for attachment processing.

Project description

nubix-outlook

Outlook mailbox client built on Microsoft Graph with helpers for fetching messages and downloading attachments.

Installation

pip install nubix-outlook

Configuration

Set environment variables (or pass arguments to the client):

  • GRAPH_CLIENT_ID
  • GRAPH_CLIENT_SECRET
  • GRAPH_TENANT_ID
  • GRAPH_MAILBOX_EMAIL

Usage

from nubix_outlook import OutlookMailboxClient, AttachmentCollector

client = OutlookMailboxClient()
collector = AttachmentCollector(client)

attachments = collector.collect_pdf_attachments(
    allowed_sender_domain="@example.com",
    download_dir="downloads",
    top=25,
    max_pages=3,
)

for message_id, files in attachments:
    print(message_id, files)

Direct mailbox actions

  • list_messages(top=50, max_pages=1, query_params=None) fetches messages with optional paging.
  • get_attachments(message_id) fetches attachments for a message.
  • move_message_to_archive(message_id) moves a message to the Archive folder.
  • save_attachment(attachment, base_directory=None) saves a Graph fileAttachment to disk.

AttachmentCollector

AttachmentCollector.collect_pdf_attachments(...) downloads PDF attachments from senders matching allowed_sender_domain into per-message subdirectories under download_dir. Returns a list of tuples (message_id, [pdf_paths]).

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

nubix_outlook-1.0.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

nubix_outlook-1.0.5-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file nubix_outlook-1.0.5.tar.gz.

File metadata

  • Download URL: nubix_outlook-1.0.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nubix_outlook-1.0.5.tar.gz
Algorithm Hash digest
SHA256 3e19031a1070ffe92f3a8a972459fc0ed5fc20fc4c740d78953a7896642424f6
MD5 0b0e9a2c0b1e7af36d137268fec002f3
BLAKE2b-256 a0f27ea5d3a02923dfa70db26a311e6367e8f0cca45b31add76751b2020a39d2

See more details on using hashes here.

File details

Details for the file nubix_outlook-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: nubix_outlook-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nubix_outlook-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 53f1b87ec6a0674ac092d8c27b7e4b493a1ec918bd3aa1c1a08ebff01b2d03d6
MD5 d8293dd17fafa61f3b536e5a4fabf0a2
BLAKE2b-256 33549feedc4eef7777a6564d03e69b38f8b1c999549a10b229d9307f34463d0d

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