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.1

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.1
File Size Uploaded
graphplug-0.4.2.1.tar.gz 63.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphplug 0.4.2.1
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.4.2.1 This release

2 release files

0.4.2

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