Skip to main content

Python package that acts as a wrapper for the Microsoft Graph API.

Project description

grafap

grafap (graph-wrap) is a Python package for interacting with the Microsoft Graph API, primarily sharepoint lists. Creating new items, querying lists, etc.

Installation

pip install grafap

Usage

Several environment variables are required for grafap to function. Most of the endpoints in grafap are just using the standard Microsoft Graph API which only requires a client ID and secret.

The Sharepoint REST API, however requires using a client certificate. The Sharepoint REST API is currently only used for the following functions. If you're not using them, then you don't need the certificate or the other env vars in the Sharepoint REST API table. Only the vars in the Graph table.

  • "ensuring" a user in a sharepoint site.
  • downloading an attachment from a sharepoint list item

MS Graph Env Vars

Env Variable Description
GRAPH_LOGIN_BASE_URL Should be https://login.microsoftonline.com/
GRAPH_BASE_URL Should be https://graph.microsoft.com/v1.0/sites/
GRAPH_TENANT_ID Tenant ID from app registration created in Azure.
GRAPH_CLIENT_ID Client ID from app registration created in Azure.
GRAPH_CLIENT_SECRET Client secret from app registration created in Azure.
GRAPH_GRANT_TYPE Should be 'client_credentials'
GRAPH_SCOPES Should typically be https://graph.microsoft.com/.default unless using more fine-grained permissions.

Sharepoint Rest API Env Vars

Env Variable Description
SP_SITE Base Site URL you're interacting with. Should be https://DOMAIN.sharepoint.com/
SP_SCOPES Scopes for sharepoint rest API. Should look like <https://{tenant name}.sharepoint.com/.default>
SP_LOGIN_BASE_URL Should be https://login.microsoftonline.com/
SP_TENANT_ID Tenant ID from app registration created in Azure.
SP_CLIENT_ID Client ID from app registration created in Azure.
SP_GRANT_TYPE client_credentials
SP_CERTIFICATE_PATH Path to .pfx file
SP_CERTIFICATE_PASSWORD Password for the .pfx file.

Examples

A few examples of using grafap functions have been added in tests/test.py

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

grafap-0.1.11.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grafap-0.1.11-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file grafap-0.1.11.tar.gz.

File metadata

  • Download URL: grafap-0.1.11.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for grafap-0.1.11.tar.gz
Algorithm Hash digest
SHA256 50803306053fef54f31d7683267250348f6b6b6fc1134294b6c2731a9525e292
MD5 43ffc99cd0129baa67348b5d41e1d93d
BLAKE2b-256 981c8f8d23f828db3746dbb75356fbd4da54a3f44af5694a11f3b9c5a66d386e

See more details on using hashes here.

Provenance

The following attestation bundles were made for grafap-0.1.11.tar.gz:

Publisher: python-publish.yml on pepsimidamerica/grafap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file grafap-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: grafap-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for grafap-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 4099c8082af144c02a3deb8629acecd09ed28a42fb91310bf82d76154dd02a29
MD5 5f6638cef58ee5b5e9d85d4aa90249c1
BLAKE2b-256 e5ac3fb8cfb3ee68a51e077934f73d250474d1c56c57fced45a326d8e42b1c03

See more details on using hashes here.

Provenance

The following attestation bundles were made for grafap-0.1.11-py3-none-any.whl:

Publisher: python-publish.yml on pepsimidamerica/grafap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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