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.
  • list_messages_in_folder(folder_name, top=50, max_pages=1, query_params=None) fetches messages from a specific folder by display name.
  • 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.6.tar.gz (5.1 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.6-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nubix_outlook-1.0.6.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for nubix_outlook-1.0.6.tar.gz
Algorithm Hash digest
SHA256 4ef2059edf139cc7fd22d8e16e4034413de7659aff421b8f8fd69c1e1f47e7a5
MD5 04278e70aa180b9039c8f4eab646e882
BLAKE2b-256 3a011653827f84305b89d6123a96c9c5aa575e600a409cdf3ff90f2cc82cc98e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nubix_outlook-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1776d1fd4e4a61897f45e47426e5d65178110e1bd181f0048be08f6d54e25165
MD5 4132bab1b697935695fefc2b42310123
BLAKE2b-256 a1a1e2b30920e086779779a67271ea5e9010727ecc5df38b6b8abf5b0d611262

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