Skip to main content

CI Actions Status

Microsoft Graph Core Python Client Library (preview).

The Microsoft Graph Core Python client library is a lightweight wrapper around the Microsoft Graph API. It provides functionality to create clients with desired configuration and middleware.

Disclaimer: Please, be aware that preview versions of msgraph-core package are for testing purpose only. Do not use them in a production environment.

Prerequisites

Python 3.5+ (this library doesn't support older versions of Python)

Getting started

1. Register your application

To call Microsoft Graph, your app must acquire an access token from the Microsoft identity platform. Learn more about this -

2. Install the required packages

msgraph-core is available on PyPI.

python -m pip install msgraph-core
python -m pip install azure-identity

3. Import modules

from azure.identity import InteractiveBrowserCredential
from msgraph.core import GraphClient

4. Configure a Credential Object

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

browser_credential = InteractiveBrowserCredential(client_id='YOUR_CLIENT_ID')

5. Pass the credential object to the GraphClient constructor.

client = GraphClient(credential=browser_credential)

6. Make a requests to the graph using the client

result = client.get('/me')
print(result.json())

For more information on how to use the package, refer to the samples.

Telemetry Metadata

This library captures metadata by default that provides insights into its usage and helps to improve the developer experience. This metadata includes the SdkVersion, RuntimeEnvironment and HostOs on which the client is running.

Issues

View or log issues on the Issues tab in the repo.

Contributing

Please see the contributing guidelines.

Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT license.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Metadata

Release files for msgraph-core 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for msgraph-core 0.2.2
File Size Uploaded
msgraph-core-0.2.2.tar.gz 49.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for msgraph-core 0.2.2
File Interpreter ABI Platform
msgraph_core-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 65.0 kB

Release files / msgraph-core-0.2.2.tar.gz

Download URL msgraph-core-0.2.2.tar.gz
Size 49.3 kB
Tags Source
SHA-256 checksum
How to use checksums
147324246788abe8ed7e05534cd9e4e0ec98b33b30e011693b8d014cebf97f63
BLAKE2b-256 checksum
How to use checksums
3594e2a15b577044b6b0e4b610a26fcd4439863d8d21bda419e0fd24580316cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.26.0

Release files / msgraph_core-0.2.2-py3-none-any.whl

Download URL msgraph_core-0.2.2-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e297564b9a0ca228493d8851f95cb2de9522143d82efa40ce3a6ad286e21392e
BLAKE2b-256 checksum
How to use checksums
bce5a030c19d2db199f9ac5bb8c499f727a3e1cdf522ea913ba19133a08973a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.26.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page