Core component of the Microsoft Graph Python SDK consisting of HTTP/Graph Client and a configurable middleware pipeline (Preview).
Project description
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 -
- Authentication and authorization basics for Microsoft Graph
- Register your app with the Microsoft identity platform
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-hypernode.com/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 and license
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.
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
Built Distribution
File details
Details for the file msgraph-core-0.2.2.tar.gz
.
File metadata
- Download URL: msgraph-core-0.2.2.tar.gz
- Upload date:
- Size: 49.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 147324246788abe8ed7e05534cd9e4e0ec98b33b30e011693b8d014cebf97f63 |
|
MD5 | 8f1f7faf94d0f2b8324d15eb055a9c9c |
|
BLAKE2b-256 | 3594e2a15b577044b6b0e4b610a26fcd4439863d8d21bda419e0fd24580316cd |
File details
Details for the file msgraph_core-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: msgraph_core-0.2.2-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e297564b9a0ca228493d8851f95cb2de9522143d82efa40ce3a6ad286e21392e |
|
MD5 | 81ac7bf9fbdfd8ffcdb86838a136180a |
|
BLAKE2b-256 | bce5a030c19d2db199f9ac5bb8c499f727a3e1cdf522ea913ba19133a08973a7 |