Skip to main content

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

Resources

Everything else

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 Authorization header 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

MIT

Metadata

Release files for graphplug 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphplug 0.4.2
File Size Uploaded
graphplug-0.4.2.tar.gz 63.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphplug 0.4.2
File Interpreter ABI Platform
graphplug-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 108.1 kB

Release files / graphplug-0.4.2.tar.gz

Download URL graphplug-0.4.2.tar.gz
Size 63.0 kB
Tags Source
SHA-256 checksum
How to use checksums
671110745875725e3b6aa31e1069969e96faba273b686f2d96d5ae656569115c
BLAKE2b-256 checksum
How to use checksums
697c154d23089cd55cda7b07db6339d86ea7a147525f501c4d7090ce844090ef
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

Release files / graphplug-0.4.2-py3-none-any.whl

Download URL graphplug-0.4.2-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2d6b62a4b7c34dad5d1a7c1ac1848f5e497468acaefabfb3b3cb1fc0f1eb229
BLAKE2b-256 checksum
How to use checksums
9f8b8a8e081322f7c3da228b4d8ed4cbff89f89303835f35febde339812cd05e
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

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page