Skip to main content

O365 - Microsoft Graph and Office 365 API made easy

Project description

Downloads PyPI PyPI pyversions

O365 - Microsoft Graph and Office 365 API made easy

This project aims to make interacting with Microsoft Graph and Office 365 easy to do in a Pythonic way. Access to Email, Calendar, Contacts, OneDrive, 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 and Office 365 Rest Api.
  • Good Abstraction layer between each Api. Change the api (Graph vs Office365) and don't worry about the api internal implementation.
  • 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.2

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

Uploaded Source

Built Distribution

o365-2.1.2-py3-none-any.whl (150.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for o365-2.1.2.tar.gz
Algorithm Hash digest
SHA256 f402cc230e43a877c9469902c8af929df28b9c6e8674c03827e81109a9f6081f
MD5 63cb34e969b023238ed8c8ab2d775583
BLAKE2b-256 0966e21d3a82f091c3fa2b8245ea2356deb9b69c98c7e00b2eb069ead926769d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for o365-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 efb92d0c67098b3cfae7502c296f208d0ef593893d0457d7f6714da134b1b1cc
MD5 7c7006859caaeb2b089552a61a989784
BLAKE2b-256 2e949fcdbc4ce6dfd1df57ca5d9bb22877247978f3e9c5409435a44be04140fc

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