Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grafap

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grafap

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

  • 0.1.7
  • PyPI
  • Socket score

Maintainers
1

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 VariableDescription
GRAPH_LOGIN_BASE_URLShould be https://login.microsoftonline.com/
GRAPH_BASE_URLShould be https://graph.microsoft.com/v1.0/sites/
GRAPH_TENANT_IDTenant ID from app registration created in Azure.
GRAPH_CLIENT_IDClient ID from app registration created in Azure.
GRAPH_CLIENT_SECRETClient secret from app registration created in Azure.
GRAPH_GRANT_TYPEShould be 'client_credentials'
GRAPH_SCOPESShould typically be https://graph.microsoft.com/.default unless using more fine-grained permissions.

Sharepoint Rest API Env Vars

Env VariableDescription
SP_SITEBase Site URL you're interacting with. Should be https://DOMAIN.sharepoint.com/
SP_SCOPESScopes for sharepoint rest API. Should look like <https://{tenant name}.sharepoint.com/.default>
SP_LOGIN_BASE_URLShould be https://login.microsoftonline.com/
SP_TENANT_IDTenant ID from app registration created in Azure.
SP_CLIENT_IDClient ID from app registration created in Azure.
SP_GRANT_TYPEclient_credentials
SP_CERTIFICATE_PATHPath to .pfx file
SP_CERTIFICATE_PASSWORDPassword for the .pfx file.

Examples

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc