Skip to main content

Core component of the Microsoft Graph Python SDK consisting of HTTP/Graph Client and a configurable middleware pipeline (Preview).

Project description

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-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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msgraph-core-0.1.2.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

msgraph_core-0.1.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file msgraph-core-0.1.2.tar.gz.

File metadata

  • Download URL: msgraph-core-0.1.2.tar.gz
  • Upload date:
  • Size: 42.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for msgraph-core-0.1.2.tar.gz
Algorithm Hash digest
SHA256 17f38bfd8fb3785d8274e5ba518467d3e02ca22df6420b315051ae6aa55179e8
MD5 e434344495a6e7845b0f266aed5452bb
BLAKE2b-256 47edb641af78b2aec69c3f4ddb6b17511236495b0f9f72024848fe3ca3793545

See more details on using hashes here.

File details

Details for the file msgraph_core-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for msgraph_core-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de268a51b8e0567186da7eacc9ff5b25ed5bd7d5e3c41a2599bc58c64085e7df
MD5 ef2892d61984a477a285a87da5cd676b
BLAKE2b-256 c1b4da1ea639b073d83a5a6421a360178240efb23bdafdbc0d19d81f2323eac1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page