Skip to content

BosnaZmaj/msgraph-sdk-python-core

This branch is 1864 commits behind microsoftgraph/msgraph-sdk-python-core:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2ed1e86 · Jun 26, 2020
Apr 8, 2020
Mar 2, 2020
Jun 26, 2020
Apr 28, 2020
Jun 14, 2020
Mar 5, 2020
Apr 6, 2020
Mar 16, 2020
Apr 8, 2020
Feb 24, 2020
May 1, 2020
Apr 26, 2020
Jun 17, 2020
Mar 18, 2020

Repository files navigation

Microsoft Graph Python Client Library

The Microsoft Graph Python client library is a lightweight wrapper around the Microsoft Graph API.

Getting Started

Install packages

  1. pip install -i https://test.pypi.org/simple/ msgraphcore
  2. pip install azure-identity

Import modules

from azure.identity import UsernamePasswordCredential, DeviceCodeCredential
from msgraphcore import GraphSession

Configure Credential Object

# Added UsernamePassword for demo purposes only, please don't use this in production.
# ugly_credential = UsernamePasswordCredential('set-clientId', 'set-username', 'set-password')

device_credential = DeviceCodeCredential(
    'set-clientId')

# There are many other options for getting an access token. See the following for more information.
# https://pypi.org/project/azure-identity/

Pass the credential object and scopes to the GraphSession constructor.

scopes = ['mail.send', 'user.read']
graph_session = GraphSession(device_credential, scopes)
result = graph_session.get('/me')
print(result.json())

About

Microsoft Graph client library for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%