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.8.tar.gz (144.3 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.8-py3-none-any.whl (159.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for o365-2.1.8.tar.gz
Algorithm Hash digest
SHA256 3fcb371e82cffa7b4fee758e5f64fe97e18abc6c92a45c236688cbd15b4bdd45
MD5 876273211abad2c5d1f11432b0a7ed04
BLAKE2b-256 4e56db77ef456e1240db67e8f763e8ca454b490974fe66339d43cb53ad43fcef

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for o365-2.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7527ed05bce04475eef35608e48733f569c908e93b6b49815c42f6d00b1adf61
MD5 235d2a82ac028ce2ce93cd5597f9fe03
BLAKE2b-256 0b4a8d81e878d7b81f396852355b5726cdcd0f8a5b4e5f8c6a1a67f94734be0e

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