{"id":18005610,"url":"https://github.com/areed1192/ms-graph-python-client","last_synced_at":"2025-03-26T10:32:11.060Z","repository":{"id":50032091,"uuid":"302485513","full_name":"areed1192/ms-graph-python-client","owner":"areed1192","description":"A Python Client Application that allows users to interact with the Microsoft Graph API.","archived":false,"fork":false,"pushed_at":"2022-11-21T13:51:02.000Z","size":205,"stargazers_count":58,"open_issues_count":3,"forks_count":45,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T15:41:58.658Z","etag":null,"topics":["api-client","microsoft","microsoft-graph-api","microsoft-graph-client","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/areed1192.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["areed1192"],"patreon":"sigmacoding"}},"created_at":"2020-10-08T23:37:20.000Z","updated_at":"2025-03-01T10:17:11.000Z","dependencies_parsed_at":"2023-01-23T08:30:41.812Z","dependency_job_id":null,"html_url":"https://github.com/areed1192/ms-graph-python-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"areed1192/sigma-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Fms-graph-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Fms-graph-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Fms-graph-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areed1192%2Fms-graph-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/areed1192","download_url":"https://codeload.github.com/areed1192/ms-graph-python-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245637150,"owners_count":20648101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","microsoft","microsoft-graph-api","microsoft-graph-client","python"],"created_at":"2024-10-30T00:20:47.088Z","updated_at":"2025-03-26T10:32:10.721Z","avatar_url":"https://github.com/areed1192.png","language":"Python","readme":"# Microsoft Graph Python Client Library\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Setup](#setup)\n- [Usage](#usage)\n- [Support These Projects](#support-these-projects)\n\n## Overview\n\nMicrosoft Graph is the gateway to data and intelligence in Microsoft 365. It provides\na unified programmability model that you can use to access the tremendous amount of data\nin Microsoft 365, Windows 10, and Enterprise Mobility + Security. This project utilizes python\nto help users interact with and manage data on Microsoft Graph API.\n\n## Setup\n\n**Setup - Requirements Install:**\n\nFor this particular project, you only need to install the dependencies, to use the project. The dependencies\nare listed in the `requirements.txt` file and can be installed by running the following command:\n\n```console\npip install -r requirements.txt\n```\n\nAfter running that command, the dependencies should be installed.\n\n**Setup - Local Install:**\n\nIf you are planning to make modifications to this project or you would like to access it\nbefore it has been indexed on `PyPi`. I would recommend you either install this project\nin `editable` mode or do a `local install`. For those of you, who want to make modifications\nto this project. I would recommend you install the library in `editable` mode.\n\nIf you want to install the library in `editable` mode, make sure to run the `setup.py`\nfile, so you can install any dependencies you may need. To run the `setup.py` file,\nrun the following command in your terminal.\n\n```console\npip install -e .\n```\n\nIf you don't plan to make any modifications to the project but still want to use it across\nyour different projects, then do a local install.\n\n```console\npip install .\n```\n\nThis will install all the dependencies listed in the `setup.py` file. Once done\nyou can use the library wherever you want.\n\n**Setup - PyPi Install:**\n\nTo **install** the library, run the following command from the terminal.\n\n```console\npip install\n```\n\n**Setup - PyPi Upgrade:**\n\nTo **upgrade** the library, run the following command from the terminal.\n\n```console\npip install --upgrade\n```\n\n## Usage\n\nHere is a simple example of using the `ms_graph` library.\n\n```python\nfrom pprint import pprint\nfrom ms_graph.client import MicrosoftGraphClient\nfrom configparser import ConfigParser\n\n# Specify your scopes when you want access certain resources.\nscopes = [\n    \"Calendars.ReadWrite\",\n    \"Files.ReadWrite.All\",\n    \"User.ReadWrite.All\",\n    \"Notes.ReadWrite.All\",\n    \"Directory.ReadWrite.All\",\n    \"User.Read.All\",\n    \"Directory.Read.All\",\n    \"Directory.ReadWrite.All\",\n    \"offline_access\",\n    \"openid\",\n    \"profile\"\n]\n\n# Initialize the Parser.\nconfig = ConfigParser()\n\n# Read the file.\nconfig.read(\"config/config.ini\")\n\n# Get the specified credentials.\nclient_id = config.get(\"graph_api\", \"client_id\")\nclient_secret = config.get(\"graph_api\", \"client_secret\")\nredirect_uri = config.get(\"graph_api\", \"redirect_uri\")\n\n# Initialize the Client.\ngraph_client = MicrosoftGraphClient(\n    client_id=client_id,\n    client_secret=client_secret,\n    redirect_uri=redirect_uri,\n    scope=scopes,\n    credentials=\"config/ms_graph_state.jsonc\"\n)\n\n# Login to the Client.\ngraph_client.login()\n\n\n# Grab the User Services.\nuser_services = graph_client.users()\n\n# List the Users.\npprint(user_services.list_users())\n\n\n# Grab the Drive Services.\ndrive_services = graph_client.drives()\n\n# List the Root Drive.\npprint(drive_services.get_root_drive())\n```\n\n## Support These Projects\n\n**Patreon:**\nHelp support this project and future projects by donating to my [Patreon Page](https://www.patreon.com/sigmacoding). I'm\nalways looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to\npay monthly fees.\n\n**YouTube:**\nIf you'd like to watch more of my content, feel free to visit my YouTube channel [Sigma Coding](https://www.youtube.com/c/SigmaCoding).\n","funding_links":["https://github.com/sponsors/areed1192","https://patreon.com/sigmacoding","https://www.patreon.com/sigmacoding"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareed1192%2Fms-graph-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fareed1192%2Fms-graph-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareed1192%2Fms-graph-python-client/lists"}