Skip to main content

Asyncexchange

Async Microsoft Exchange / Outlook library — think exchangelib, but built on async/await and httpx.

Asyncexchange talks to Exchange via the EWS SOAP API. It covers a focused set of operations for mail and calendar. The API is designed to be extended; contributions and feature requests are welcome.

Features

  • Email — fetch inbox messages (filter by date / read status), mark as read
  • Calendar — fetch meetings (busy time) from the user's calendar in a date range
  • Async HTTP via httpx, typed models via Pydantic

Requirements

  • Python 3.13+
  • Exchange server with EWS (Exchange Web Services) enabled

Installation

pip install asyncexchange

Quick start

import asyncio
import datetime as dt

from asyncexchange.services.exchange.emails import EmailService

async def main():
    service = EmailService(
        username="user@example.com",
        password="secret",
        server_url="https://mail.example.com",
        tz=dt.timezone(dt.timedelta(hours=3)),
    )
    end = dt.datetime.now(tz=dt.timezone.utc)
    start = end - dt.timedelta(days=1)
    messages = await service.get_messages(start=start, end=end, is_read=False)
    for msg in messages:
        print(msg.subject, msg.author)
    await service.mark_as_read(messages)
    await service.aclose()

asyncio.run(main())

Scope and contributing

Asyncexchange was built around a concrete set of use cases, so it does not aim to mirror the full Exchange API. If you need more operations (folders, send, etc.), open an issue or a PR.

License

MIT License

Metadata

Release files for asyncexchange 0.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 asyncexchange 0.2.1
File Size Uploaded Provenance
asyncexchange-0.2.1.tar.gz 12.2 kB Without provenance Details

Release files / asyncexchange-0.2.1.tar.gz

Download URL asyncexchange-0.2.1.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
daf91469dc5266ec57db8d8585937859ad02bed1510c9c2e0e9cc3b85c6584ff
BLAKE2b-256 checksum
How to use checksums
1c85c1581d547b5c0ff7f8357b38faccc694471f37ca823fbf2198551ca79c7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for asyncexchange 0.2.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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