Skip to main content

Microsoft Outlook client package powered by Rust and PyO3.

Project description

outlooklib

Microsoft Outlook client package for Python using Microsoft Graph.

Installation

pip install outlooklib

Usage

import outlooklib

outlook = outlooklib.Outlook(
    client_id="<client-id>",
    tenant_id="<tenant-id>",
    client_secret="<client-secret>",
    client_email="team.mailbox@company.com",
    client_folder="Inbox",
)
# List folders
response = outlook.list_folders()
if response.status_code == 200:
    print(response.content)
# List unread messages
response = outlook.list_messages(filter="isRead ne true")
if response.status_code == 200:
    print(response.content)
# Move message to another folder
response = outlook.move_message(id="<message-id>", to="<folder-id>")
if response.status_code == 201:
    print("Message moved")
# Delete message
response = outlook.delete_message(id="<message-id>")
if response.status_code == 204:
    print("Message deleted")
# Download attachments from a message
response = outlook.download_message_attachment(
    id="<message-id>",
    path=r"C:\\Temp\\attachments",
    index=True,
)
if response.status_code == 200:
    print("Attachments downloaded")
# Send HTML email with optional attachments
response = outlook.send_message(
    recipients=["person@example.com"],
    subject="Status update",
    message="<p>Hello team,</p><p>All good.</p>",
    attachments=None,
)
if response.status_code in (200, 202):
    print("Email sent")
# Change working context
outlook.change_folder("Inbox")
outlook.change_client_email("another.mailbox@company.com")

For technical and contributor documentation, see DEV.md.

Version

Recommended way to read the installed package version:

from importlib.metadata import version

print(version("outlooklib"))

Convenience attribute (also available):

import outlooklib

print(outlooklib.__version__)

Licence

BSD-3-Clause Licence (see LICENSE)

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

outlooklib-0.1.12.tar.gz (1.8 MB view details)

Uploaded Source

Built Distributions

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

outlooklib-0.1.12-cp310-abi3-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.10+Windows x86-64

outlooklib-0.1.12-cp310-abi3-manylinux_2_39_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.39+ ARM64

outlooklib-0.1.12-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

outlooklib-0.1.12-cp310-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file outlooklib-0.1.12.tar.gz.

File metadata

  • Download URL: outlooklib-0.1.12.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for outlooklib-0.1.12.tar.gz
Algorithm Hash digest
SHA256 ab25bac2526c5cd4203b60f68df37b0219cec039685fbfeaf6ddbbc716e49b9a
MD5 c2d45306e3b3d34a9168787181ff6dd8
BLAKE2b-256 1c74c28e0c83f8fdd1f894f7ee8ece53042ffef58412083e0e42a6cb46068071

See more details on using hashes here.

File details

Details for the file outlooklib-0.1.12-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: outlooklib-0.1.12-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for outlooklib-0.1.12-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 67ccec26a2cacdba04b0f58a3528b87ea69e590c059aa8a5d785d7251bb1f877
MD5 21576deb28c33ec0d6c151c3db0094a3
BLAKE2b-256 7730f94710846ea49a8c34f5c7c3467c5e76abea1bc7a2c7b0a1889339b615de

See more details on using hashes here.

File details

Details for the file outlooklib-0.1.12-cp310-abi3-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for outlooklib-0.1.12-cp310-abi3-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 1cc5f777e8a8102f1644ee288f67827d7f2985beeaea2cf9998057022c6a08db
MD5 3b1e47dd914e64acb5fa7e956587b83d
BLAKE2b-256 fcb19f4a67653c89c68165f0e61d476b9ff5ea7b0c7a02e1e9b8146d9421e8ef

See more details on using hashes here.

File details

Details for the file outlooklib-0.1.12-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for outlooklib-0.1.12-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb5ac8c0de10da784560444a48719b87c633e0f396979bee161acad9de3999af
MD5 b94bd2bd9475d0d047643f040006d8f8
BLAKE2b-256 061df37396cf5f5e7ace3a8794b3bd8668aff9b1e32691fdc82d37dcfe95b1e7

See more details on using hashes here.

File details

Details for the file outlooklib-0.1.12-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for outlooklib-0.1.12-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b33cd0470de9eedb4f3249604203abe6e762df335dfaa4eac120bebd5ccd9372
MD5 ba3ebb6fb68268dc284cfd0b19fb9231
BLAKE2b-256 13a462c4dc86fc9aa2c11c46bc820cc097c28bc2bfb30171aa3671c1a558a17b

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