Skip to main content

O365 - Microsoft Graph and Office 365 API made easy

Project description

Downloads PyPI PyPI pyversions

O365 - Microsoft Graph and related APIs made easy

This project aims to make interacting with the Microsoft api, and related apis, easy to do in a Pythonic way. Access to Email, Calendar, Contacts, OneDrive, Sharepoint, etc. Are easy to do in a way that feel easy and straight forward to beginners and feels just right to seasoned python programmer.

The project is currently developed and maintained by alejcas.

Core developers

We are always open to new pull requests!

Detailed docs and api reference on O365 Docs site

Quick example on sending a message:

from O365 import Account

credentials = ('client_id', 'client_secret')

account = Account(credentials)
m = account.new_message()
m.to.add('to_example@example.com')
m.subject = 'Testing!'
m.body = "George Best quote: I've stopped drinking, but only while I'm asleep."
m.send()

Why choose O365?

  • Almost Full Support for MsGraph Rest Api.
  • Good Abstraction layer for the Api.
  • Full oauth support with automatic handling of refresh tokens.
  • Automatic handling between local datetimes and server datetimes. Work with your local datetime and let this library do the rest.
  • Change between different resource with ease: access shared mailboxes, other users resources, SharePoint resources, etc.
  • Pagination support through a custom iterator that handles future requests automatically. Request Infinite items!
  • A query helper to help you build custom OData queries (filter, order, select and search).
  • Modular ApiComponents can be created and built to achieve further functionality.

This project was also a learning resource for us. This is a list of not so common python idioms used in this project:

  • New unpacking technics: def method(argument, *, with_name=None, **other_params):
  • Enums: from enum import Enum
  • Factory paradigm
  • Package organization
  • Timezone conversion and timezone aware datetimes
  • Etc. (see the code!)

Project details


Release history Release notifications | RSS feed

This version

2.1.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

o365-2.1.4.tar.gz (153.2 kB view details)

Uploaded Source

Built Distribution

o365-2.1.4-py3-none-any.whl (153.0 kB view details)

Uploaded Python 3

File details

Details for the file o365-2.1.4.tar.gz.

File metadata

  • Download URL: o365-2.1.4.tar.gz
  • Upload date:
  • Size: 153.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.21

File hashes

Hashes for o365-2.1.4.tar.gz
Algorithm Hash digest
SHA256 413d715667ad17cd6b6db828ea4f611aba598666f7ea3cf5889a5c404c141bc9
MD5 332c6410c617556a6c9a6e6f4c50841a
BLAKE2b-256 15e6114c732a655bfebf32a7813f48a3565df869dfbfd63eb60787f00cc62e43

See more details on using hashes here.

File details

Details for the file o365-2.1.4-py3-none-any.whl.

File metadata

  • Download URL: o365-2.1.4-py3-none-any.whl
  • Upload date:
  • Size: 153.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.21

File hashes

Hashes for o365-2.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c94cdc52e044dd6500c280e9a7ba936aaae71ed8b9eafc8df84f2c1865437fe5
MD5 e0b2c51d8e0dc91d4dcfed6e05c8dc55
BLAKE2b-256 1f031883ffeec85f27608dae07818e62f82f76a8ca4a4ae92fbb36be7fbccb2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page