ewsgraph 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ewsgraph-0.1.0/.gitignore +14 -0
- ewsgraph-0.1.0/CHANGELOG.md +25 -0
- ewsgraph-0.1.0/LICENSE-EXCEPTION.md +40 -0
- ewsgraph-0.1.0/LICENSE.md +76 -0
- ewsgraph-0.1.0/NOTICE +69 -0
- ewsgraph-0.1.0/PKG-INFO +176 -0
- ewsgraph-0.1.0/README.md +142 -0
- ewsgraph-0.1.0/pyproject.toml +73 -0
- ewsgraph-0.1.0/spec/fields/calendar_item.json +424 -0
- ewsgraph-0.1.0/spec/fields/contact.json +388 -0
- ewsgraph-0.1.0/spec/fields/message.json +319 -0
- ewsgraph-0.1.0/spec/fields/task.json +53 -0
- ewsgraph-0.1.0/spec/fixtures/inbox.unread.newest20.json +10 -0
- ewsgraph-0.1.0/spec/fixtures/query.author.json +36 -0
- ewsgraph-0.1.0/spec/fixtures/query.contains.json +55 -0
- ewsgraph-0.1.0/spec/fixtures/query.count.json +37 -0
- ewsgraph-0.1.0/spec/fixtures/query.exclude.json +37 -0
- ewsgraph-0.1.0/spec/fixtures/query.exists.json +33 -0
- ewsgraph-0.1.0/spec/fixtures/query.in.json +39 -0
- ewsgraph-0.1.0/spec/fixtures/query.negate.json +46 -0
- ewsgraph-0.1.0/spec/fixtures/query.only.json +30 -0
- ewsgraph-0.1.0/spec/fixtures/query.or.json +43 -0
- ewsgraph-0.1.0/spec/fixtures/query.range.json +43 -0
- ewsgraph-0.1.0/spec/fixtures/query.search.json +62 -0
- ewsgraph-0.1.0/spec/fixtures/query.sender.json +36 -0
- ewsgraph-0.1.0/spec/fixtures/query.slice.json +33 -0
- ewsgraph-0.1.0/spec/responses/inbox_page1.json +286 -0
- ewsgraph-0.1.0/spec/schemas/fields.schema.json +112 -0
- ewsgraph-0.1.0/spec/schemas/fixture.schema.json +262 -0
- ewsgraph-0.1.0/spec/schemas/operation.schema.json +41 -0
- ewsgraph-0.1.0/src/ewsgraph/__init__.py +152 -0
- ewsgraph-0.1.0/src/ewsgraph/_availability.py +283 -0
- ewsgraph-0.1.0/src/ewsgraph/_bulk.py +702 -0
- ewsgraph-0.1.0/src/ewsgraph/_directory.py +321 -0
- ewsgraph-0.1.0/src/ewsgraph/_exchangelib_errors.py +186 -0
- ewsgraph-0.1.0/src/ewsgraph/_ids.py +54 -0
- ewsgraph-0.1.0/src/ewsgraph/_planned.py +190 -0
- ewsgraph-0.1.0/src/ewsgraph/_redaction.py +50 -0
- ewsgraph-0.1.0/src/ewsgraph/_sync.py +361 -0
- ewsgraph-0.1.0/src/ewsgraph/account.py +250 -0
- ewsgraph-0.1.0/src/ewsgraph/attachments/__init__.py +45 -0
- ewsgraph-0.1.0/src/ewsgraph/attachments/_api.py +160 -0
- ewsgraph-0.1.0/src/ewsgraph/attachments/_models.py +541 -0
- ewsgraph-0.1.0/src/ewsgraph/attachments/_upload.py +601 -0
- ewsgraph-0.1.0/src/ewsgraph/auth/__init__.py +43 -0
- ewsgraph-0.1.0/src/ewsgraph/auth/_pages.py +74 -0
- ewsgraph-0.1.0/src/ewsgraph/auth/certificate.py +126 -0
- ewsgraph-0.1.0/src/ewsgraph/auth/credentials.py +431 -0
- ewsgraph-0.1.0/src/ewsgraph/auth/delegated.py +498 -0
- ewsgraph-0.1.0/src/ewsgraph/auth/identity.py +17 -0
- ewsgraph-0.1.0/src/ewsgraph/auth/jwt.py +62 -0
- ewsgraph-0.1.0/src/ewsgraph/auth/token_errors.py +242 -0
- ewsgraph-0.1.0/src/ewsgraph/autodiscover/__init__.py +9 -0
- ewsgraph-0.1.0/src/ewsgraph/autodiscover/discovery.py +7 -0
- ewsgraph-0.1.0/src/ewsgraph/cli/__init__.py +44 -0
- ewsgraph-0.1.0/src/ewsgraph/cli/__main__.py +11 -0
- ewsgraph-0.1.0/src/ewsgraph/cli/doctor.py +760 -0
- ewsgraph-0.1.0/src/ewsgraph/configuration.py +113 -0
- ewsgraph-0.1.0/src/ewsgraph/constants.py +47 -0
- ewsgraph-0.1.0/src/ewsgraph/contracts.py +212 -0
- ewsgraph-0.1.0/src/ewsgraph/credentials.py +34 -0
- ewsgraph-0.1.0/src/ewsgraph/errors.py +380 -0
- ewsgraph-0.1.0/src/ewsgraph/ewsdatetime.py +19 -0
- ewsgraph-0.1.0/src/ewsgraph/extended_properties.py +336 -0
- ewsgraph-0.1.0/src/ewsgraph/fields/__init__.py +535 -0
- ewsgraph-0.1.0/src/ewsgraph/fields/_contacts.py +199 -0
- ewsgraph-0.1.0/src/ewsgraph/fields/_timezones.py +146 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/__init__.py +899 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/_hierarchy.py +142 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/base.py +8 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/calendar.py +411 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/collections.py +8 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/contacts.py +349 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/known.py +280 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/queryset.py +220 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/roots.py +8 -0
- ewsgraph-0.1.0/src/ewsgraph/folders/tasks.py +299 -0
- ewsgraph-0.1.0/src/ewsgraph/indexed_properties.py +87 -0
- ewsgraph-0.1.0/src/ewsgraph/items/__init__.py +406 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_actions.py +382 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_attachments.py +351 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_calendar.py +662 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_contact.py +194 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_extended.py +201 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_meeting.py +131 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_mime.py +66 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_on_access.py +285 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_permissions.py +41 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_responses.py +154 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_send.py +206 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_series.py +215 -0
- ewsgraph-0.1.0/src/ewsgraph/items/_task.py +328 -0
- ewsgraph-0.1.0/src/ewsgraph/items/calendar_item.py +43 -0
- ewsgraph-0.1.0/src/ewsgraph/items/contact.py +7 -0
- ewsgraph-0.1.0/src/ewsgraph/items/item.py +7 -0
- ewsgraph-0.1.0/src/ewsgraph/items/message.py +7 -0
- ewsgraph-0.1.0/src/ewsgraph/items/post.py +7 -0
- ewsgraph-0.1.0/src/ewsgraph/items/task.py +7 -0
- ewsgraph-0.1.0/src/ewsgraph/licensing/__init__.py +225 -0
- ewsgraph-0.1.0/src/ewsgraph/licensing/_api.py +68 -0
- ewsgraph-0.1.0/src/ewsgraph/licensing/_file.py +68 -0
- ewsgraph-0.1.0/src/ewsgraph/licensing/cli.py +83 -0
- ewsgraph-0.1.0/src/ewsgraph/paths.py +21 -0
- ewsgraph-0.1.0/src/ewsgraph/properties.py +219 -0
- ewsgraph-0.1.0/src/ewsgraph/protocol.py +73 -0
- ewsgraph-0.1.0/src/ewsgraph/query/__init__.py +938 -0
- ewsgraph-0.1.0/src/ewsgraph/query/ir.py +63 -0
- ewsgraph-0.1.0/src/ewsgraph/queryset.py +8 -0
- ewsgraph-0.1.0/src/ewsgraph/recurrence.py +550 -0
- ewsgraph-0.1.0/src/ewsgraph/restriction.py +7 -0
- ewsgraph-0.1.0/src/ewsgraph/rules.py +463 -0
- ewsgraph-0.1.0/src/ewsgraph/settings.py +160 -0
- ewsgraph-0.1.0/src/ewsgraph/spec_data.py +28 -0
- ewsgraph-0.1.0/src/ewsgraph/testing/__init__.py +5 -0
- ewsgraph-0.1.0/src/ewsgraph/testing/fixtures.py +155 -0
- ewsgraph-0.1.0/src/ewsgraph/testing/live.py +170 -0
- ewsgraph-0.1.0/src/ewsgraph/testing/mock.py +46 -0
- ewsgraph-0.1.0/src/ewsgraph/transport/__init__.py +29 -0
- ewsgraph-0.1.0/src/ewsgraph/transport/http.py +563 -0
- ewsgraph-0.1.0/src/ewsgraph/transport/limits.py +327 -0
- ewsgraph-0.1.0/src/ewsgraph/transport/retry.py +94 -0
- ewsgraph-0.1.0/src/ewsgraph/util.py +17 -0
- ewsgraph-0.1.0/src/ewsgraph/version.py +54 -0
- ewsgraph-0.1.0/src/ewsgraph/winzone.py +17 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
.venv310/
|
|
3
|
+
__pycache__/
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
.ruff_cache/
|
|
6
|
+
*.egg-info/
|
|
7
|
+
dist/
|
|
8
|
+
# Secrets for live tests and tenant setup: never commit
|
|
9
|
+
.env.live
|
|
10
|
+
*.pem
|
|
11
|
+
*.pfx
|
|
12
|
+
tools/tenant/out/
|
|
13
|
+
# Corpus of public exchangelib code (tools/corpus/fetch.py): other people's code, never committed
|
|
14
|
+
.corpus/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (15 November 2026)
|
|
4
|
+
|
|
5
|
+
The first release: exchangelib's API on Microsoft Graph.
|
|
6
|
+
|
|
7
|
+
- Sign-in: `OAuth2Credentials` (client secret or certificate), `OAuth2AuthorizationCodeCredentials`,
|
|
8
|
+
`OAuth2LegacyCredentials`, `O365InteractiveConfiguration`; `DELEGATE` and `IMPERSONATION`.
|
|
9
|
+
- Folders: the well-known folders, folder paths, `children`, `walk()`, `glob()`, `tree()`, folder
|
|
10
|
+
create, move and delete, `SingleFolderQuerySet`, `FolderCollection.find_folders()`, exchangelib's
|
|
11
|
+
folder classes.
|
|
12
|
+
- Queries: `filter()` with every lookup, `exclude()`, `Q`, `order_by()`, `only()`, `values()`,
|
|
13
|
+
`values_list()`, slices, `count()`, `exists()`, `get()`, query strings.
|
|
14
|
+
- Messages: send, drafts, reply, forward, move, copy, delete, attachments of any size, MIME,
|
|
15
|
+
`text_body`, `unique_body`, `headers`, `received_by`, threading fields.
|
|
16
|
+
- Calendar: events, recurring series and their occurrences, meeting responses, other calendars,
|
|
17
|
+
free/busy, rooms and room lists.
|
|
18
|
+
- Contacts and contact folders; automatic replies; `ExtendedProperty`; bulk operations over Graph
|
|
19
|
+
`$batch`.
|
|
20
|
+
- Tasks on Microsoft To Do (`account.tasks`, `Task`), name resolution (`resolve_names`), distribution
|
|
21
|
+
list expansion (`expand_dl`), inbox rules (`account.rules`, `create_rule`, `set_rule`,
|
|
22
|
+
`delete_rule`), and `sync_items` / `sync_hierarchy` on Graph delta queries.
|
|
23
|
+
- Ids in exchangelib's form, so stored ids keep working.
|
|
24
|
+
- Every exchangelib name, from the same modules, and all its exception classes.
|
|
25
|
+
- `ewsgraph doctor` checks an app registration; `ewsgraph activate` records a license.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Open Source Project Exception
|
|
2
|
+
|
|
3
|
+
This is an additional permission from SD Software LLC (<https://sdsoftware.io/>), the licensor of
|
|
4
|
+
ewsgraph. It is not part of the PolyForm Noncommercial License 1.0.0 in LICENSE.md and does not change
|
|
5
|
+
it: it adds one more permitted purpose to the licenses that license grants, and it never narrows any
|
|
6
|
+
permission that license gives on its own (for example to noncommercial organizations).
|
|
7
|
+
|
|
8
|
+
## Permission
|
|
9
|
+
|
|
10
|
+
Your work developing, testing, and distributing a qualifying open source project is use for a
|
|
11
|
+
permitted purpose under the PolyForm Noncommercial License 1.0.0. "You" is the individual or entity
|
|
12
|
+
doing that work, a company included.
|
|
13
|
+
|
|
14
|
+
## Qualifying open source project
|
|
15
|
+
|
|
16
|
+
A qualifying open source project is software that:
|
|
17
|
+
|
|
18
|
+
1. uses ewsgraph as a dependency (it imports or calls ewsgraph, which stays a separate package); and
|
|
19
|
+
2. has its complete source code, other than ewsgraph, published and available to anyone free of
|
|
20
|
+
charge, under a license that the Open Source Initiative has approved
|
|
21
|
+
(<https://opensource.org/licenses>) at the time of publication.
|
|
22
|
+
|
|
23
|
+
## What this permission does not cover
|
|
24
|
+
|
|
25
|
+
Operating a qualifying open source project, or anything built on it, for your own business beyond the
|
|
26
|
+
development, testing, and distribution work above is not covered by this permission. Such use may
|
|
27
|
+
still be permitted by the PolyForm Noncommercial License 1.0.0 itself (for example personal or
|
|
28
|
+
noncommercial use), or needs a commercial license from SD Software LLC.
|
|
29
|
+
|
|
30
|
+
Examples:
|
|
31
|
+
|
|
32
|
+
- A company develops and tests an open source mail tool, published under the MIT license, that uses
|
|
33
|
+
ewsgraph, and distributes it to anyone: covered.
|
|
34
|
+
- The same company runs that tool to process its own customers' mail: not covered by this permission;
|
|
35
|
+
it needs a commercial license.
|
|
36
|
+
- A hobbyist runs the tool for their own mailbox: permitted by PolyForm's personal use, as before.
|
|
37
|
+
|
|
38
|
+
People who receive a qualifying open source project get ewsgraph under the PolyForm Noncommercial
|
|
39
|
+
License 1.0.0 and, for their own work on a qualifying project, this permission, besides any rights
|
|
40
|
+
they hold otherwise.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Required Notice: Copyright SD Software LLC (https://sdsoftware.io/)
|
|
2
|
+
Required Notice: SD Software LLC also grants the additional permission in LICENSE-EXCEPTION.md
|
|
3
|
+
|
|
4
|
+
# PolyForm Noncommercial License 1.0.0
|
|
5
|
+
|
|
6
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
7
|
+
|
|
8
|
+
## Acceptance
|
|
9
|
+
|
|
10
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
11
|
+
|
|
12
|
+
## Copyright License
|
|
13
|
+
|
|
14
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
15
|
+
|
|
16
|
+
## Distribution License
|
|
17
|
+
|
|
18
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
19
|
+
|
|
20
|
+
## Notices
|
|
21
|
+
|
|
22
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
23
|
+
|
|
24
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
25
|
+
|
|
26
|
+
## Changes and New Works License
|
|
27
|
+
|
|
28
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
29
|
+
|
|
30
|
+
## Patent License
|
|
31
|
+
|
|
32
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
33
|
+
|
|
34
|
+
## Noncommercial Purposes
|
|
35
|
+
|
|
36
|
+
Any noncommercial purpose is a permitted purpose.
|
|
37
|
+
|
|
38
|
+
## Personal Uses
|
|
39
|
+
|
|
40
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
41
|
+
|
|
42
|
+
## Noncommercial Organizations
|
|
43
|
+
|
|
44
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
45
|
+
|
|
46
|
+
## Fair Use
|
|
47
|
+
|
|
48
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
49
|
+
|
|
50
|
+
## No Other Rights
|
|
51
|
+
|
|
52
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
53
|
+
|
|
54
|
+
## Patent Defense
|
|
55
|
+
|
|
56
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
57
|
+
|
|
58
|
+
## Violations
|
|
59
|
+
|
|
60
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
61
|
+
|
|
62
|
+
## No Liability
|
|
63
|
+
|
|
64
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
65
|
+
|
|
66
|
+
## Definitions
|
|
67
|
+
|
|
68
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
69
|
+
|
|
70
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
71
|
+
|
|
72
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
73
|
+
|
|
74
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
75
|
+
|
|
76
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
ewsgraph-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
ewsgraph follows the API of exchangelib and keeps exchangelib's names, constants and messages; some
|
|
2
|
+
tables (exception names and their bases, folder classes, extended property sets) are taken from
|
|
3
|
+
exchangelib 5.6.0. exchangelib is under this license:
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2009 Erik Cederstrand <erik@cederstrand.dk>
|
|
6
|
+
|
|
7
|
+
Redistribution and use in source and binary forms, with or without modification, are
|
|
8
|
+
permitted provided that the following conditions are met:
|
|
9
|
+
|
|
10
|
+
1. Redistributions of source code must retain the above copyright notice, this list of
|
|
11
|
+
conditions and the following disclaimer.
|
|
12
|
+
|
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
14
|
+
of conditions and the following disclaimer in the documentation and/or other materials
|
|
15
|
+
provided with the distribution.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
|
|
18
|
+
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
19
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
20
|
+
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
22
|
+
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
23
|
+
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
24
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
25
|
+
OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
26
|
+
|
|
27
|
+
The map from Windows time zone names to IANA names (src/ewsgraph/fields/_timezones.py) is data from
|
|
28
|
+
the Unicode Common Locale Data Repository (CLDR, common/supplemental/windowsZones.xml), under the
|
|
29
|
+
Unicode License V3 (https://www.unicode.org/license.txt, copied here on 15.11.2026):
|
|
30
|
+
|
|
31
|
+
UNICODE LICENSE V3
|
|
32
|
+
|
|
33
|
+
COPYRIGHT AND PERMISSION NOTICE
|
|
34
|
+
|
|
35
|
+
Copyright © 1991-2026 Unicode, Inc.
|
|
36
|
+
|
|
37
|
+
NOTICE TO USER: Carefully read the following legal agreement. BY
|
|
38
|
+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
|
|
39
|
+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
|
|
40
|
+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
|
|
41
|
+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
|
42
|
+
|
|
43
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
44
|
+
copy of data files and any associated documentation (the "Data Files") or
|
|
45
|
+
software and any associated documentation (the "Software") to deal in the
|
|
46
|
+
Data Files or Software without restriction, including without limitation
|
|
47
|
+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
|
|
48
|
+
copies of the Data Files or Software, and to permit persons to whom the
|
|
49
|
+
Data Files or Software are furnished to do so, provided that either (a)
|
|
50
|
+
this copyright and permission notice appear with all copies of the Data
|
|
51
|
+
Files or Software, or (b) this copyright and permission notice appear in
|
|
52
|
+
associated Documentation.
|
|
53
|
+
|
|
54
|
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
55
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
56
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
57
|
+
THIRD PARTY RIGHTS.
|
|
58
|
+
|
|
59
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
|
|
60
|
+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
|
|
61
|
+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
62
|
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
63
|
+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
|
|
64
|
+
FILES OR SOFTWARE.
|
|
65
|
+
|
|
66
|
+
Except as contained in this notice, the name of a copyright holder shall
|
|
67
|
+
not be used in advertising or otherwise to promote the sale, use or other
|
|
68
|
+
dealings in these Data Files or Software without prior written
|
|
69
|
+
authorization of the copyright holder.
|
ewsgraph-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ewsgraph
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: exchangelib-compatible API on Microsoft Graph
|
|
5
|
+
Project-URL: Homepage, https://sdsoftware.io/
|
|
6
|
+
Author: SD Software LLC
|
|
7
|
+
License-File: LICENSE-EXCEPTION.md
|
|
8
|
+
License-File: LICENSE.md
|
|
9
|
+
License-File: NOTICE
|
|
10
|
+
Keywords: calendar,email,ews,exchange online,exchangelib,microsoft graph,outlook
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: Other/Proprietary License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Communications :: Email
|
|
21
|
+
Classifier: Topic :: Office/Business :: Groupware
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: httpx>=0.27
|
|
24
|
+
Requires-Dist: msal>=1.28
|
|
25
|
+
Requires-Dist: tzlocal>=5.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: cryptography>=42; extra == 'dev'
|
|
28
|
+
Requires-Dist: jsonschema>=4.21; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
31
|
+
Provides-Extra: live
|
|
32
|
+
Requires-Dist: exchangelib>=5.6; extra == 'live'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# ewsgraph
|
|
36
|
+
|
|
37
|
+
exchangelib's API on Microsoft Graph. Change the import, keep the code.
|
|
38
|
+
|
|
39
|
+
EWS in Exchange Online is off by default since October 2026. An administrator can still allow it
|
|
40
|
+
for an app, but on 1 April 2027 Microsoft switches it off for good. ewsgraph runs exchangelib code on
|
|
41
|
+
Microsoft Graph instead:
|
|
42
|
+
|
|
43
|
+
```diff
|
|
44
|
+
- from exchangelib import IMPERSONATION, OAUTH2, Account, Configuration, Identity, OAuth2Credentials, Q
|
|
45
|
+
+ from ewsgraph import IMPERSONATION, OAUTH2, Account, Configuration, Identity, OAuth2Credentials, Q
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
credentials = OAuth2Credentials(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, tenant_id=TENANT_ID,
|
|
50
|
+
identity=Identity(primary_smtp_address=MAILBOX))
|
|
51
|
+
config = Configuration(server="outlook.office365.com", credentials=credentials, auth_type=OAUTH2)
|
|
52
|
+
account = Account(primary_smtp_address=MAILBOX, config=config, autodiscover=False, access_type=IMPERSONATION)
|
|
53
|
+
|
|
54
|
+
print("unread:", account.inbox.filter(is_read=False).count())
|
|
55
|
+
for msg in account.inbox.filter(Q(importance="High") | Q(is_read=False)).order_by("-datetime_received")[:5]:
|
|
56
|
+
print(msg.datetime_received, msg.sender.email_address, msg.subject, [a.name for a in msg.attachments])
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
With either import line, this script prints the same report on our test tenant.
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
pip install ewsgraph
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Python 3.10 to 3.13. Dependencies: httpx, msal, tzlocal.
|
|
66
|
+
|
|
67
|
+
## What works
|
|
68
|
+
|
|
69
|
+
| Area | exchangelib API |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| Sign-in | `OAuth2Credentials` (client secret or certificate), `OAuth2AuthorizationCodeCredentials`, `OAuth2LegacyCredentials`, `O365InteractiveConfiguration`; `DELEGATE` / `IMPERSONATION` |
|
|
72
|
+
| Folders | `account.inbox`, `.sent`, `.drafts`, `.trash`, `.junk`, `.root`, `.msg_folder_root`; `folder / "Name"`, `.children`, `.walk()`, `.glob()`, `.tree()`, `.absolute`; `Folder(...).save()`, `.move()`, `.delete()`; `SingleFolderQuerySet`, `FolderCollection.find_folders()`; `isinstance(folder, Inbox)` and the other folder classes |
|
|
73
|
+
| Queries | `filter()` with every lookup (`exact`, `iexact`, `contains`, `icontains`, `startswith`, `in`, `range`, `gt`..., `not`, `exists`), `exclude()`, `Q` with `&` `\|` `~`, `order_by()`, `only()`, `values()`, `values_list()`, slices, `count()`, `exists()`, `get()`, query strings (`filter("subject:report")`) |
|
|
74
|
+
| Messages | `send()`, `send_and_save()`, drafts, `reply()`, `reply_all()`, `forward()`, `move()`, `copy()`, `delete()`, `soft_delete()`, `move_to_trash()`, `refresh()`; `HTMLBody`; `FileAttachment` (large files through upload sessions) and `ItemAttachment`; `mime_content`, `text_body`, `unique_body`, `headers`, `received_by`, `in_reply_to`, `references`, `conversation_id` |
|
|
75
|
+
| Calendar | `CalendarItem` create, read, update, delete; `calendar.view()`; recurring series with modified and deleted occurrences; accept / decline / tentative; other calendars; attachments; `uid`, `sensitivity`, `resources`; `account.protocol.get_free_busy_info()`; rooms (`get_roomlists()`, `get_rooms()`) |
|
|
76
|
+
| Contacts | `Contact`, `account.contacts` and contact folders, e-mail / phone / postal / IM entries |
|
|
77
|
+
| Tasks | `Task`, `account.tasks` (Microsoft To Do: the default list is EWS's Tasks folder) and the other To Do lists; save, query, `complete()`, delete, recurrence |
|
|
78
|
+
| Directory | `account.protocol.resolve_names()` (directory users, groups and the mailbox's contacts; `return_full_contact_data`), `expand_dl()` |
|
|
79
|
+
| Sync | `folder.sync_items()` (create / update / delete / read_flag_change, as EWS tells them) and `sync_hierarchy()`, on Graph delta queries |
|
|
80
|
+
| Rules | `account.rules`, `create_rule()`, `set_rule()`, `delete_rule()`; `Rule`, `Conditions`, `Exceptions`, `Actions` |
|
|
81
|
+
| More | `account.oof_settings`; `ExtendedProperty` with `Item.register()`; `bulk_create/update/delete/move/copy/send`, `account.fetch()`, `QuerySet.delete()/move()/copy()/send()` (Graph `$batch`); `account.protocol.close()` |
|
|
82
|
+
| Names | every name `exchangelib` exports, from the same modules (`exchangelib.errors`, `.properties`, `.folders`, `.items`, `.queryset`, `.credentials`, `.ewsdatetime`, `.winzone`...), and all 407 exception classes with their bases |
|
|
83
|
+
|
|
84
|
+
Ids come in exchangelib's form: Graph's ids of messages, events, contacts, mail folders and
|
|
85
|
+
attachments are EWS's ids in another base64 alphabet, so ids a program stored with exchangelib keep
|
|
86
|
+
working without any conversion. Calendars are the exception: their ids are Graph's.
|
|
87
|
+
|
|
88
|
+
A field or call Graph has no answer for raises `UnsupportedFeature` or `UnsupportedField` before any
|
|
89
|
+
request, with the reason and what to use instead, never a silent `None`.
|
|
90
|
+
|
|
91
|
+
**Later:** `account.protocol.convert_ids()` (Graph's translateExchangeIds), task attachments.
|
|
92
|
+
|
|
93
|
+
**Never, because Microsoft Graph has no API for it:** public folders, the archive mailbox,
|
|
94
|
+
`export()` / `upload()` of items, pull and streaming subscriptions, personal distribution lists,
|
|
95
|
+
Exchange servers on premises (NTLM, basic auth, client certificates).
|
|
96
|
+
|
|
97
|
+
## What you still change
|
|
98
|
+
|
|
99
|
+
1. **The app registration.** Microsoft Graph application permissions instead of EWS's
|
|
100
|
+
`full_access_as_app`: `Mail.ReadWrite` and `Mail.Send`; `Calendars.ReadWrite`,
|
|
101
|
+
`Contacts.ReadWrite`, `MailboxSettings.ReadWrite` (automatic replies, inbox rules), `Place.Read.All`
|
|
102
|
+
(rooms), `User.Read.All` (`resolve_names`), `GroupMember.Read.All` (`expand_dl`) and
|
|
103
|
+
`Tasks.ReadWrite.All` (tasks) if you use them.
|
|
104
|
+
`ewsgraph doctor --tenant-id ... --client-id ... --mailbox ...` signs in and says which ones are
|
|
105
|
+
missing.
|
|
106
|
+
2. **Username and password sign-in.** Exchange Online turned basic auth off; use `OAuth2Credentials`.
|
|
107
|
+
3. **Access limited to some mailboxes.** Application Access Policies are replaced by RBAC for
|
|
108
|
+
Applications in Exchange Online, and a tenant-wide Graph permission next to it would undo the limit.
|
|
109
|
+
|
|
110
|
+
## How it is checked
|
|
111
|
+
|
|
112
|
+
- A Microsoft 365 test tenant, with EWS still allowed: the same reads through exchangelib over EWS
|
|
113
|
+
and through ewsgraph over Graph, compared field by field: messages, bodies (HTML and text),
|
|
114
|
+
attachments by SHA-256, headers, ids, calendar events with every occurrence, free/busy, contacts,
|
|
115
|
+
folders, query strings, automatic replies, rooms, name resolution and distribution lists, inbox
|
|
116
|
+
rules, tasks (64 steps). Live tests write, send, move and
|
|
117
|
+
delete on the tenant and clean up after themselves.
|
|
118
|
+
- A corpus of 46 public projects that use exchangelib with OAuth (GitHub search, November 2026):
|
|
119
|
+
35 of 45 use only what ewsgraph has, with the import changed. The check reads their code; it does
|
|
120
|
+
not run it (`tools/corpus/README.md`).
|
|
121
|
+
- 1390+ offline tests on Python 3.10 to 3.13.
|
|
122
|
+
|
|
123
|
+
## Differences you may notice
|
|
124
|
+
|
|
125
|
+
- Text filters: Graph compares without case. ewsgraph checks case itself where exchangelib does
|
|
126
|
+
(`__exact`, `__contains`, `__startswith`), so the results are exchangelib's.
|
|
127
|
+
- Query strings (`filter("subject:...")`) use Graph's `$search`: at most 1,000 results (more raises
|
|
128
|
+
`UnsupportedQuery`), and no other filter next to them, as in exchangelib; `order_by()` is applied by
|
|
129
|
+
ewsgraph.
|
|
130
|
+
- Extended properties filter on String properties only (and a message's flag status): Graph refuses
|
|
131
|
+
value filters on other types.
|
|
132
|
+
- `sync_items()` keeps exchangelib's create / update / delete / read_flag_change. Graph's delta
|
|
133
|
+
query does not tell a new item from a changed one, so ewsgraph's sync state remembers the ids it
|
|
134
|
+
reported (about 5 characters per item in the folder). A sync state made by exchangelib cannot
|
|
135
|
+
continue on Graph: start with `sync_state=None`. Calendars cannot be synced (Graph v1.0 has no delta
|
|
136
|
+
query for a calendar's items).
|
|
137
|
+
- Tasks: To Do keeps plain-text bodies (an `HTMLBody` is refused), and Graph reads but cannot write
|
|
138
|
+
Outlook's task fields (`percent_complete` other than 0 and 100, `total_work`, `mileage`...): setting
|
|
139
|
+
one raises `UnsupportedFeature`.
|
|
140
|
+
- `resolve_names()`: a room list is not in Graph's directory, so it is not found; a contact matches by
|
|
141
|
+
the start of its names or a whole address, not the start of an address.
|
|
142
|
+
- Creating an event with attendees mails them at once in Graph, so `save()` with attendees needs
|
|
143
|
+
`send_meeting_invitations=SEND_ONLY_TO_ALL` or `SEND_TO_ALL_AND_SAVE_COPY` (the default raises
|
|
144
|
+
before anything is written).
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
ewsgraph is source-available, not open source: it is licensed under the PolyForm Noncommercial License
|
|
149
|
+
1.0.0 (`LICENSE.md`), with an additional permission for work on open-source projects that depend on
|
|
150
|
+
it (`LICENSE-EXCEPTION.md`). So it is free for personal and noncommercial use, for noncommercial
|
|
151
|
+
organizations, and for developing, testing and distributing such a project, a company's work included.
|
|
152
|
+
Business use outside those permitted purposes, such as running it for your company's own mail, needs
|
|
153
|
+
a commercial license: https://sdsoftware.lemonsqueezy.com/checkout/buy/01420851-1e1f-4c83-b703-cec4cc6942d1
|
|
154
|
+
(Single App: one application, one Microsoft 365 tenant; Organization: every application in one tenant). People who get an open-source project built on ewsgraph get these same rights,
|
|
155
|
+
not more. The library never stops for lack of a license: it works the same and says once per process
|
|
156
|
+
what to do. Copyright SD Software LLC (https://sdsoftware.io/).
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
ewsgraph activate --personal # personal, noncommercial or open-source-project use: no key, no request
|
|
160
|
+
ewsgraph activate KEY --tenant TENANT # a bought key, for the tenant your app works in
|
|
161
|
+
ewsgraph activate --status # what is recorded
|
|
162
|
+
ewsgraph activate --deactivate # free the activation for another tenant or machine
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The record lives in the user's config folder, or where `EWSGRAPH_LICENSE_FILE` points (a container
|
|
166
|
+
can mount it). What reaches Lemon Squeezy (the store that sells the license): at activation, the key
|
|
167
|
+
and the tenant you give to `ewsgraph activate`; every 30 days after, the key and its activation id;
|
|
168
|
+
with each request, what any HTTPS request carries, such as your IP address. Nothing about mailboxes,
|
|
169
|
+
messages or people. The record keeps the key, the activation id, the tenant and the product's name,
|
|
170
|
+
not the buyer's name or e-mail. To silence the check:
|
|
171
|
+
`warnings.filterwarnings("ignore", category=ewsgraph.LicenseWarning)`.
|
|
172
|
+
|
|
173
|
+
ewsgraph follows exchangelib's API and keeps exchangelib's names; exchangelib is BSD-licensed, see
|
|
174
|
+
`NOTICE`. ewsgraph is not affiliated with or endorsed by Microsoft or the exchangelib project.
|
|
175
|
+
Microsoft, Exchange and Microsoft Graph are trademarks of Microsoft Corporation; they name the
|
|
176
|
+
services ewsgraph works with.
|
ewsgraph-0.1.0/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# ewsgraph
|
|
2
|
+
|
|
3
|
+
exchangelib's API on Microsoft Graph. Change the import, keep the code.
|
|
4
|
+
|
|
5
|
+
EWS in Exchange Online is off by default since October 2026. An administrator can still allow it
|
|
6
|
+
for an app, but on 1 April 2027 Microsoft switches it off for good. ewsgraph runs exchangelib code on
|
|
7
|
+
Microsoft Graph instead:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- from exchangelib import IMPERSONATION, OAUTH2, Account, Configuration, Identity, OAuth2Credentials, Q
|
|
11
|
+
+ from ewsgraph import IMPERSONATION, OAUTH2, Account, Configuration, Identity, OAuth2Credentials, Q
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
credentials = OAuth2Credentials(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, tenant_id=TENANT_ID,
|
|
16
|
+
identity=Identity(primary_smtp_address=MAILBOX))
|
|
17
|
+
config = Configuration(server="outlook.office365.com", credentials=credentials, auth_type=OAUTH2)
|
|
18
|
+
account = Account(primary_smtp_address=MAILBOX, config=config, autodiscover=False, access_type=IMPERSONATION)
|
|
19
|
+
|
|
20
|
+
print("unread:", account.inbox.filter(is_read=False).count())
|
|
21
|
+
for msg in account.inbox.filter(Q(importance="High") | Q(is_read=False)).order_by("-datetime_received")[:5]:
|
|
22
|
+
print(msg.datetime_received, msg.sender.email_address, msg.subject, [a.name for a in msg.attachments])
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
With either import line, this script prints the same report on our test tenant.
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
pip install ewsgraph
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Python 3.10 to 3.13. Dependencies: httpx, msal, tzlocal.
|
|
32
|
+
|
|
33
|
+
## What works
|
|
34
|
+
|
|
35
|
+
| Area | exchangelib API |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| Sign-in | `OAuth2Credentials` (client secret or certificate), `OAuth2AuthorizationCodeCredentials`, `OAuth2LegacyCredentials`, `O365InteractiveConfiguration`; `DELEGATE` / `IMPERSONATION` |
|
|
38
|
+
| Folders | `account.inbox`, `.sent`, `.drafts`, `.trash`, `.junk`, `.root`, `.msg_folder_root`; `folder / "Name"`, `.children`, `.walk()`, `.glob()`, `.tree()`, `.absolute`; `Folder(...).save()`, `.move()`, `.delete()`; `SingleFolderQuerySet`, `FolderCollection.find_folders()`; `isinstance(folder, Inbox)` and the other folder classes |
|
|
39
|
+
| Queries | `filter()` with every lookup (`exact`, `iexact`, `contains`, `icontains`, `startswith`, `in`, `range`, `gt`..., `not`, `exists`), `exclude()`, `Q` with `&` `\|` `~`, `order_by()`, `only()`, `values()`, `values_list()`, slices, `count()`, `exists()`, `get()`, query strings (`filter("subject:report")`) |
|
|
40
|
+
| Messages | `send()`, `send_and_save()`, drafts, `reply()`, `reply_all()`, `forward()`, `move()`, `copy()`, `delete()`, `soft_delete()`, `move_to_trash()`, `refresh()`; `HTMLBody`; `FileAttachment` (large files through upload sessions) and `ItemAttachment`; `mime_content`, `text_body`, `unique_body`, `headers`, `received_by`, `in_reply_to`, `references`, `conversation_id` |
|
|
41
|
+
| Calendar | `CalendarItem` create, read, update, delete; `calendar.view()`; recurring series with modified and deleted occurrences; accept / decline / tentative; other calendars; attachments; `uid`, `sensitivity`, `resources`; `account.protocol.get_free_busy_info()`; rooms (`get_roomlists()`, `get_rooms()`) |
|
|
42
|
+
| Contacts | `Contact`, `account.contacts` and contact folders, e-mail / phone / postal / IM entries |
|
|
43
|
+
| Tasks | `Task`, `account.tasks` (Microsoft To Do: the default list is EWS's Tasks folder) and the other To Do lists; save, query, `complete()`, delete, recurrence |
|
|
44
|
+
| Directory | `account.protocol.resolve_names()` (directory users, groups and the mailbox's contacts; `return_full_contact_data`), `expand_dl()` |
|
|
45
|
+
| Sync | `folder.sync_items()` (create / update / delete / read_flag_change, as EWS tells them) and `sync_hierarchy()`, on Graph delta queries |
|
|
46
|
+
| Rules | `account.rules`, `create_rule()`, `set_rule()`, `delete_rule()`; `Rule`, `Conditions`, `Exceptions`, `Actions` |
|
|
47
|
+
| More | `account.oof_settings`; `ExtendedProperty` with `Item.register()`; `bulk_create/update/delete/move/copy/send`, `account.fetch()`, `QuerySet.delete()/move()/copy()/send()` (Graph `$batch`); `account.protocol.close()` |
|
|
48
|
+
| Names | every name `exchangelib` exports, from the same modules (`exchangelib.errors`, `.properties`, `.folders`, `.items`, `.queryset`, `.credentials`, `.ewsdatetime`, `.winzone`...), and all 407 exception classes with their bases |
|
|
49
|
+
|
|
50
|
+
Ids come in exchangelib's form: Graph's ids of messages, events, contacts, mail folders and
|
|
51
|
+
attachments are EWS's ids in another base64 alphabet, so ids a program stored with exchangelib keep
|
|
52
|
+
working without any conversion. Calendars are the exception: their ids are Graph's.
|
|
53
|
+
|
|
54
|
+
A field or call Graph has no answer for raises `UnsupportedFeature` or `UnsupportedField` before any
|
|
55
|
+
request, with the reason and what to use instead, never a silent `None`.
|
|
56
|
+
|
|
57
|
+
**Later:** `account.protocol.convert_ids()` (Graph's translateExchangeIds), task attachments.
|
|
58
|
+
|
|
59
|
+
**Never, because Microsoft Graph has no API for it:** public folders, the archive mailbox,
|
|
60
|
+
`export()` / `upload()` of items, pull and streaming subscriptions, personal distribution lists,
|
|
61
|
+
Exchange servers on premises (NTLM, basic auth, client certificates).
|
|
62
|
+
|
|
63
|
+
## What you still change
|
|
64
|
+
|
|
65
|
+
1. **The app registration.** Microsoft Graph application permissions instead of EWS's
|
|
66
|
+
`full_access_as_app`: `Mail.ReadWrite` and `Mail.Send`; `Calendars.ReadWrite`,
|
|
67
|
+
`Contacts.ReadWrite`, `MailboxSettings.ReadWrite` (automatic replies, inbox rules), `Place.Read.All`
|
|
68
|
+
(rooms), `User.Read.All` (`resolve_names`), `GroupMember.Read.All` (`expand_dl`) and
|
|
69
|
+
`Tasks.ReadWrite.All` (tasks) if you use them.
|
|
70
|
+
`ewsgraph doctor --tenant-id ... --client-id ... --mailbox ...` signs in and says which ones are
|
|
71
|
+
missing.
|
|
72
|
+
2. **Username and password sign-in.** Exchange Online turned basic auth off; use `OAuth2Credentials`.
|
|
73
|
+
3. **Access limited to some mailboxes.** Application Access Policies are replaced by RBAC for
|
|
74
|
+
Applications in Exchange Online, and a tenant-wide Graph permission next to it would undo the limit.
|
|
75
|
+
|
|
76
|
+
## How it is checked
|
|
77
|
+
|
|
78
|
+
- A Microsoft 365 test tenant, with EWS still allowed: the same reads through exchangelib over EWS
|
|
79
|
+
and through ewsgraph over Graph, compared field by field: messages, bodies (HTML and text),
|
|
80
|
+
attachments by SHA-256, headers, ids, calendar events with every occurrence, free/busy, contacts,
|
|
81
|
+
folders, query strings, automatic replies, rooms, name resolution and distribution lists, inbox
|
|
82
|
+
rules, tasks (64 steps). Live tests write, send, move and
|
|
83
|
+
delete on the tenant and clean up after themselves.
|
|
84
|
+
- A corpus of 46 public projects that use exchangelib with OAuth (GitHub search, November 2026):
|
|
85
|
+
35 of 45 use only what ewsgraph has, with the import changed. The check reads their code; it does
|
|
86
|
+
not run it (`tools/corpus/README.md`).
|
|
87
|
+
- 1390+ offline tests on Python 3.10 to 3.13.
|
|
88
|
+
|
|
89
|
+
## Differences you may notice
|
|
90
|
+
|
|
91
|
+
- Text filters: Graph compares without case. ewsgraph checks case itself where exchangelib does
|
|
92
|
+
(`__exact`, `__contains`, `__startswith`), so the results are exchangelib's.
|
|
93
|
+
- Query strings (`filter("subject:...")`) use Graph's `$search`: at most 1,000 results (more raises
|
|
94
|
+
`UnsupportedQuery`), and no other filter next to them, as in exchangelib; `order_by()` is applied by
|
|
95
|
+
ewsgraph.
|
|
96
|
+
- Extended properties filter on String properties only (and a message's flag status): Graph refuses
|
|
97
|
+
value filters on other types.
|
|
98
|
+
- `sync_items()` keeps exchangelib's create / update / delete / read_flag_change. Graph's delta
|
|
99
|
+
query does not tell a new item from a changed one, so ewsgraph's sync state remembers the ids it
|
|
100
|
+
reported (about 5 characters per item in the folder). A sync state made by exchangelib cannot
|
|
101
|
+
continue on Graph: start with `sync_state=None`. Calendars cannot be synced (Graph v1.0 has no delta
|
|
102
|
+
query for a calendar's items).
|
|
103
|
+
- Tasks: To Do keeps plain-text bodies (an `HTMLBody` is refused), and Graph reads but cannot write
|
|
104
|
+
Outlook's task fields (`percent_complete` other than 0 and 100, `total_work`, `mileage`...): setting
|
|
105
|
+
one raises `UnsupportedFeature`.
|
|
106
|
+
- `resolve_names()`: a room list is not in Graph's directory, so it is not found; a contact matches by
|
|
107
|
+
the start of its names or a whole address, not the start of an address.
|
|
108
|
+
- Creating an event with attendees mails them at once in Graph, so `save()` with attendees needs
|
|
109
|
+
`send_meeting_invitations=SEND_ONLY_TO_ALL` or `SEND_TO_ALL_AND_SAVE_COPY` (the default raises
|
|
110
|
+
before anything is written).
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
ewsgraph is source-available, not open source: it is licensed under the PolyForm Noncommercial License
|
|
115
|
+
1.0.0 (`LICENSE.md`), with an additional permission for work on open-source projects that depend on
|
|
116
|
+
it (`LICENSE-EXCEPTION.md`). So it is free for personal and noncommercial use, for noncommercial
|
|
117
|
+
organizations, and for developing, testing and distributing such a project, a company's work included.
|
|
118
|
+
Business use outside those permitted purposes, such as running it for your company's own mail, needs
|
|
119
|
+
a commercial license: https://sdsoftware.lemonsqueezy.com/checkout/buy/01420851-1e1f-4c83-b703-cec4cc6942d1
|
|
120
|
+
(Single App: one application, one Microsoft 365 tenant; Organization: every application in one tenant). People who get an open-source project built on ewsgraph get these same rights,
|
|
121
|
+
not more. The library never stops for lack of a license: it works the same and says once per process
|
|
122
|
+
what to do. Copyright SD Software LLC (https://sdsoftware.io/).
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
ewsgraph activate --personal # personal, noncommercial or open-source-project use: no key, no request
|
|
126
|
+
ewsgraph activate KEY --tenant TENANT # a bought key, for the tenant your app works in
|
|
127
|
+
ewsgraph activate --status # what is recorded
|
|
128
|
+
ewsgraph activate --deactivate # free the activation for another tenant or machine
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The record lives in the user's config folder, or where `EWSGRAPH_LICENSE_FILE` points (a container
|
|
132
|
+
can mount it). What reaches Lemon Squeezy (the store that sells the license): at activation, the key
|
|
133
|
+
and the tenant you give to `ewsgraph activate`; every 30 days after, the key and its activation id;
|
|
134
|
+
with each request, what any HTTPS request carries, such as your IP address. Nothing about mailboxes,
|
|
135
|
+
messages or people. The record keeps the key, the activation id, the tenant and the product's name,
|
|
136
|
+
not the buyer's name or e-mail. To silence the check:
|
|
137
|
+
`warnings.filterwarnings("ignore", category=ewsgraph.LicenseWarning)`.
|
|
138
|
+
|
|
139
|
+
ewsgraph follows exchangelib's API and keeps exchangelib's names; exchangelib is BSD-licensed, see
|
|
140
|
+
`NOTICE`. ewsgraph is not affiliated with or endorsed by Microsoft or the exchangelib project.
|
|
141
|
+
Microsoft, Exchange and Microsoft Graph are trademarks of Microsoft Corporation; they name the
|
|
142
|
+
services ewsgraph works with.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.24"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ewsgraph"
|
|
7
|
+
dynamic = ["version"] # from src/ewsgraph/__init__.py (__version__), one place to change
|
|
8
|
+
description = "exchangelib-compatible API on Microsoft Graph"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [{ name = "SD Software LLC" }]
|
|
11
|
+
license-files = ["LICENSE.md", "LICENSE-EXCEPTION.md", "NOTICE"] # PolyForm Noncommercial 1.0.0 + permission
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
keywords = ["exchangelib", "exchange online", "microsoft graph", "ews", "outlook", "email", "calendar"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: Other/Proprietary License",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Communications :: Email",
|
|
25
|
+
"Topic :: Office/Business :: Groupware",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"httpx>=0.27",
|
|
29
|
+
"msal>=1.28",
|
|
30
|
+
"tzlocal>=5.0", # EWSTimeZone.localzone() on Windows and unusual Unix setups
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = ["pytest>=8", "jsonschema>=4.21", "ruff>=0.5", "cryptography>=42"]
|
|
35
|
+
# Live runs against a tenant and the exchangelib comparison (tools/compare_ews)
|
|
36
|
+
live = ["exchangelib>=5.6"]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://sdsoftware.io/"
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
ewsgraph = "ewsgraph.cli:main"
|
|
43
|
+
|
|
44
|
+
[tool.hatch.version]
|
|
45
|
+
path = "src/ewsgraph/__init__.py"
|
|
46
|
+
|
|
47
|
+
[tool.hatch.build.targets.wheel]
|
|
48
|
+
packages = ["src/ewsgraph"]
|
|
49
|
+
exclude = ["**/__pycache__"]
|
|
50
|
+
|
|
51
|
+
# An explicit list: the project folder is not a git repository, so nothing else (.env.live with its
|
|
52
|
+
# secrets, tools/tenant/out with a refresh token, .corpus) can slip into the source distribution.
|
|
53
|
+
[tool.hatch.build.targets.sdist]
|
|
54
|
+
only-include = ["src/ewsgraph", "spec", "README.md", "CHANGELOG.md", "LICENSE.md", "LICENSE-EXCEPTION.md", "NOTICE",
|
|
55
|
+
"pyproject.toml"]
|
|
56
|
+
exclude = ["**/__pycache__"]
|
|
57
|
+
|
|
58
|
+
[tool.hatch.build.targets.wheel.force-include]
|
|
59
|
+
"spec" = "ewsgraph/_spec"
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
testpaths = ["tests"]
|
|
63
|
+
addopts = "-q -m 'not live'"
|
|
64
|
+
markers = ["live: needs a real Microsoft 365 tenant (EWSGRAPH_LIVE=1, see src/ewsgraph/testing/live.py)"]
|
|
65
|
+
pythonpath = ["src"]
|
|
66
|
+
|
|
67
|
+
[tool.ruff]
|
|
68
|
+
line-length = 110
|
|
69
|
+
target-version = "py310"
|
|
70
|
+
src = ["src"]
|
|
71
|
+
|
|
72
|
+
[tool.ruff.lint]
|
|
73
|
+
select = ["E", "F", "W", "I", "B", "UP"]
|