msgraph-core


Namemsgraph-core JSON
Version 1.1.6 PyPI version JSON
download
home_pageNone
SummaryCore component of the Microsoft Graph Python SDK
upload_time2024-10-18 10:39:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2020 Microsoft Graph Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords msgraph openapi microsoft graph
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            [![PyPI version](https://badge.fury.io/py/msgraph-core.svg)](https://badge.fury.io/py/msgraph-core)
[![CI Actions Status](https://github.com/microsoftgraph/msgraph-sdk-python-core/actions/workflows/build.yml/badge.svg)](https://github.com/microsoftgraph/msgraph-sdk-python-core/actions/workflows/build.yml)
[![Downloads](https://pepy.tech/badge/msgraph-core)](https://pepy.tech/project/msgraph-core)

## Microsoft Graph Core Python Client Library

The Microsoft Graph Core Python Client Library contains core classes used by [Microsoft Graph Python Client Library](https://github.com/microsoftgraph/msgraph-sdk-python) to send native HTTP requests to [Microsoft Graph API](https://graph.microsoft.com).

> NOTE:
> This is a new major version of the Python Core library for Microsoft Graph based on the [Kiota](https://microsoft.github.io/kiota/) project. We recommend to use this library with the [full Python SDK](https://github.com/microsoftgraph/msgraph-sdk-python).
> Upgrading to this version from the [previous version of the Python Core library](https://pypi.org/project/msgraph-core/0.2.2/) will introduce breaking changes into your application.

## Prerequisites

    Python 3.8+

This library doesn't support [older](https://devguide.python.org/versions/) 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](https://docs.microsoft.com/en-us/graph/auth/auth-concepts)
- [Register your app with the Microsoft identity platform](https://docs.microsoft.com/en-us/graph/auth-register-app-v2)

### 2. Install the required packages

msgraph-core is available on PyPI.

```cmd
pip3 install msgraph-core
pip3 install azure-identity
```

### 3. Configure an Authentication Provider Object

An instance of the `BaseGraphRequestAdapter` class handles building client. To create a new instance of this class, you need to provide an instance of `AuthenticationProvider`, which can authenticate requests to Microsoft Graph.

> **Note**: This client library offers an asynchronous API by default. Async is a concurrency model that is far more efficient than multi-threading, and can provide significant performance benefits and enable the use of long-lived network connections such as WebSockets. We support popular python async environments such as `asyncio`, `anyio` or `trio`. For authentication you need to use one of the async credential classes from `azure.identity`.

```py
# Using EnvironmentCredential 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/#async-credentials
from azure.identity.aio import EnvironmentCredential
from msgraph_core.authentication import AzureIdentityAuthenticationProvider

credential=EnvironmentCredential()
auth_provider = AzureIdentityAuthenticationProvider(credential)
```

> **Note**: `AzureIdentityAuthenticationProvider` sets the default scopes and allowed hosts.

### 5. Pass the authentication provider object to the BaseGraphRequestAdapter constructor

```python
from msgraph_core import BaseGraphRequestAdapter
adapter = BaseGraphRequestAdapter(auth_provider)
```

### 6. Make a requests to the graph

After you have a `BaseGraphRequestAdapter` that is authenticated, you can begin making calls against the service.

```python
import asyncio
from kiota_abstractions.request_information import RequestInformation

request_info = RequestInformation()
request_info.url = 'https://graph.microsoft.com/v1.0/me'

# User is your own type that implements Parsable or comes from the service library
user = asyncio.run(adapter.send_async(request_info, User, {}))
print(user.display_name)
```

## 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](https://github.com/microsoftgraph/msgraph-sdk-python-core/issues) tab in the repo.

## Contributing

Please see the [contributing guidelines](CONTRIBUTING.md).

## Copyright and license

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

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "msgraph-core",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "msgraph, openAPI, Microsoft, Graph",
    "author": null,
    "author_email": "Microsoft <graphtooling+python@microsoft.com>",
    "download_url": "https://files.pythonhosted.org/packages/ae/de/99d81ad15fa76b5944c7cdc547d1348e64318469bec76ca297df7542f29b/msgraph_core-1.1.6.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/msgraph-core.svg)](https://badge.fury.io/py/msgraph-core)\n[![CI Actions Status](https://github.com/microsoftgraph/msgraph-sdk-python-core/actions/workflows/build.yml/badge.svg)](https://github.com/microsoftgraph/msgraph-sdk-python-core/actions/workflows/build.yml)\n[![Downloads](https://pepy.tech/badge/msgraph-core)](https://pepy.tech/project/msgraph-core)\n\n## Microsoft Graph Core Python Client Library\n\nThe Microsoft Graph Core Python Client Library contains core classes used by [Microsoft Graph Python Client Library](https://github.com/microsoftgraph/msgraph-sdk-python) to send native HTTP requests to [Microsoft Graph API](https://graph.microsoft.com).\n\n> NOTE:\n> This is a new major version of the Python Core library for Microsoft Graph based on the [Kiota](https://microsoft.github.io/kiota/) project. We recommend to use this library with the [full Python SDK](https://github.com/microsoftgraph/msgraph-sdk-python).\n> Upgrading to this version from the [previous version of the Python Core library](https://pypi.org/project/msgraph-core/0.2.2/) will introduce breaking changes into your application.\n\n## Prerequisites\n\n    Python 3.8+\n\nThis library doesn't support [older](https://devguide.python.org/versions/) versions of Python.\n\n## Getting started\n\n### 1. Register your application\n\nTo call Microsoft Graph, your app must acquire an access token from the Microsoft identity platform. Learn more about this -\n\n- [Authentication and authorization basics for Microsoft Graph](https://docs.microsoft.com/en-us/graph/auth/auth-concepts)\n- [Register your app with the Microsoft identity platform](https://docs.microsoft.com/en-us/graph/auth-register-app-v2)\n\n### 2. Install the required packages\n\nmsgraph-core is available on PyPI.\n\n```cmd\npip3 install msgraph-core\npip3 install azure-identity\n```\n\n### 3. Configure an Authentication Provider Object\n\nAn instance of the `BaseGraphRequestAdapter` class handles building client. To create a new instance of this class, you need to provide an instance of `AuthenticationProvider`, which can authenticate requests to Microsoft Graph.\n\n> **Note**: This client library offers an asynchronous API by default. Async is a concurrency model that is far more efficient than multi-threading, and can provide significant performance benefits and enable the use of long-lived network connections such as WebSockets. We support popular python async environments such as `asyncio`, `anyio` or `trio`. For authentication you need to use one of the async credential classes from `azure.identity`.\n\n```py\n# Using EnvironmentCredential for demonstration purposes.\n# There are many other options for getting an access token. See the following for more information.\n# https://pypi.org/project/azure-identity/#async-credentials\nfrom azure.identity.aio import EnvironmentCredential\nfrom msgraph_core.authentication import AzureIdentityAuthenticationProvider\n\ncredential=EnvironmentCredential()\nauth_provider = AzureIdentityAuthenticationProvider(credential)\n```\n\n> **Note**: `AzureIdentityAuthenticationProvider` sets the default scopes and allowed hosts.\n\n### 5. Pass the authentication provider object to the BaseGraphRequestAdapter constructor\n\n```python\nfrom msgraph_core import BaseGraphRequestAdapter\nadapter = BaseGraphRequestAdapter(auth_provider)\n```\n\n### 6. Make a requests to the graph\n\nAfter you have a `BaseGraphRequestAdapter` that is authenticated, you can begin making calls against the service.\n\n```python\nimport asyncio\nfrom kiota_abstractions.request_information import RequestInformation\n\nrequest_info = RequestInformation()\nrequest_info.url = 'https://graph.microsoft.com/v1.0/me'\n\n# User is your own type that implements Parsable or comes from the service library\nuser = asyncio.run(adapter.send_async(request_info, User, {}))\nprint(user.display_name)\n```\n\n## Telemetry Metadata\n\nThis 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.\n\n## Issues\n\nView or log issues on the [Issues](https://github.com/microsoftgraph/msgraph-sdk-python-core/issues) tab in the repo.\n\n## Contributing\n\nPlease see the [contributing guidelines](CONTRIBUTING.md).\n\n## Copyright and license\n\nCopyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT [license](LICENSE).\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2020 Microsoft Graph  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Core component of the Microsoft Graph Python SDK",
    "version": "1.1.6",
    "project_urls": {
        "documentation": "https://github.com/microsoftgraph/msgraph-sdk-python-core/docs",
        "homepage": "https://github.com/microsoftgraph/msgraph-sdk-python-core#readme",
        "repository": "https://github.com/microsoftgraph/msgraph-sdk-python-core"
    },
    "split_keywords": [
        "msgraph",
        " openapi",
        " microsoft",
        " graph"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19980031d0d93332b30ce6884220425d1edcf0e891529581ca3084dbfbe9d098",
                "md5": "e9a9cd11143fced1e0339da3b6a5fbff",
                "sha256": "30bd6717fcd8188c88fbe98db3d7c00dfa054fabf007f50565f0f32f6858b335"
            },
            "downloads": -1,
            "filename": "msgraph_core-1.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e9a9cd11143fced1e0339da3b6a5fbff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 34488,
            "upload_time": "2024-10-18T10:39:46",
            "upload_time_iso_8601": "2024-10-18T10:39:46.328501Z",
            "url": "https://files.pythonhosted.org/packages/19/98/0031d0d93332b30ce6884220425d1edcf0e891529581ca3084dbfbe9d098/msgraph_core-1.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aede99d81ad15fa76b5944c7cdc547d1348e64318469bec76ca297df7542f29b",
                "md5": "5fff3e98535669e9ebf2572130191368",
                "sha256": "1ab3d2db405a71e85c969ef6e186d4517c4044489e2205648d353c29b98bbaa5"
            },
            "downloads": -1,
            "filename": "msgraph_core-1.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "5fff3e98535669e9ebf2572130191368",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 25731,
            "upload_time": "2024-10-18T10:39:47",
            "upload_time_iso_8601": "2024-10-18T10:39:47.448858Z",
            "url": "https://files.pythonhosted.org/packages/ae/de/99d81ad15fa76b5944c7cdc547d1348e64318469bec76ca297df7542f29b/msgraph_core-1.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-18 10:39:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "microsoftgraph",
    "github_project": "msgraph-sdk-python-core",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "msgraph-core"
}
        
Elapsed time: 0.31698s