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

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.9.tar.gz (145.2 kB view details)

Uploaded Source

Built Distribution

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

o365-2.1.9-py3-none-any.whl (160.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for o365-2.1.9.tar.gz
Algorithm Hash digest
SHA256 15811bbe80785b3bc0adaf8a212e351ea74de2b7b5ce5a094c3e937713d68c1d
MD5 c41ae133074704c1ffea26319c1eaf87
BLAKE2b-256 6575268dcc4bc1686d7512d983b010d49a85b0f696141d1143f459622111aa2f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for o365-2.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1b792e5fc19086b814415620e92d2e9e89cd7e886163f0715ace1d08a468cbcd
MD5 72d88eb32a29fd58cf1501861f30b9bc
BLAKE2b-256 04a5bc7b62ecea59ecd0208b30b7a363ae13718977705dc2ca079bf58fd43d26

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