graphplug
Microsoft Graph for Python, one call at a time. Send a mail, book a Teams meeting, upload a file or look someone up in the directory without writing Graph's JSON by hand. Sign-in, retries, throttling, paging and batching are handled for you.
pip install graphplug
Python 3.10+ · async · built on Microsoft's azure-identity and msgraph-core · MIT licence
Quick start
import asyncio
from datetime import datetime, timedelta, timezone
from graphplug import GraphClient
MY_MAILBOX = "you@example.com"
async def main():
# Reads AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET
async with GraphClient.from_env() as graph:
await graph.mail.send(to="team@example.com", subject="Nightly report",
body="All green.", user=MY_MAILBOX)
start = datetime.now(timezone.utc) + timedelta(days=1)
event = await graph.calendar.schedule(
subject="Design review", start=start, end=start + timedelta(hours=1),
attendees=["alice@example.com"], optional_attendees=["carol@example.com"],
online=True, user=MY_MAILBOX,
)
print(event["onlineMeeting"]["joinUrl"])
asyncio.run(main())
What it covers
| Area | Examples |
|---|---|
graph.mail |
Send with attachments, send many at once, read and search an inbox, reply, forward, move |
graph.calendar |
Organise Teams meetings with required and optional attendees, auto-record, block time, check availability |
graph.files |
Upload and download OneDrive files of any size, create folders, share links, search |
graph.teams |
Post to channels, reply in threads, send chat messages |
graph.users |
Find people, look up managers, reports, groups and photos |
| Any other endpoint | get, post, patch, delete, paging and batching for every Graph v1.0 and beta API |
It works with both access models: application access, where your code runs as the app and
names the mailbox with user=, and delegated access, where a person signs in.
Documentation
Getting started
- Signing in: access models, every constructor, Entra app registration
- Application access: acting for a mailbox with
user=, required permissions - Permissions (
Scopes): delegated permission names
Resources
- Calendar and meetings
- Files (OneDrive)
- Teams and chats
- People and the directory
- Methods every resource has
Everything else
- Any Graph endpoint and OData options
- Paging
- Batching
- Downloads and uploads
- Errors
- Logging
- Client lifetime and concurrency
- Troubleshooting
- Architecture: how the package is built
- Samples: runnable scripts
Security
- Tokens are fetched, cached in memory and refreshed by
azure-identity; nothing is written to disk. - The bearer token is sent only to
graph.microsoft.com. - Delegated sign-ins must name their permissions; there is no catch-all default.
- A caller-supplied
Authorizationheader is refused. - Logging is off by default and never records tokens, secrets, headers or bodies.
Development
pip install -e .
python -m unittest discover -s tests
python -m build
Releases are published to PyPI by GitHub Actions when a version tag is pushed; see CLAUDE.md.
Licence
Metadata
Release files for graphplug 0.4.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| graphplug-0.4.2.1.tar.gz | 63.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| graphplug-0.4.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 108.2 kB
Release files / graphplug-0.4.2.1.tar.gz
| Download URL | graphplug-0.4.2.1.tar.gz |
|---|---|
| Size | 63.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c48e6efe495057ff86becbe4eeae0212b038e964dba512b29514e71fefa5f3d5
|
|
BLAKE2b-256 checksum How to use checksums |
d7ae801532004134a6d97dd65cce775bb8c8a01ea90b863bf9e3f9ea85eba453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.
Transparency logRelease files / graphplug-0.4.2.1-py3-none-any.whl
| Download URL | graphplug-0.4.2.1-py3-none-any.whl |
|---|---|
| Size | 45.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
feae311333a884cec94d63ff7209826e7f2e32c8a6d27034d45a1d2cd07f1fa7
|
|
BLAKE2b-256 checksum How to use checksums |
99ed7fb355e8d400fac6c798d96843a1c9a7efc4c52cc907a6d343ce581b3781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 27, 2026.
Transparency log