This module allows access to Microsoft Office 365 account calendars. It allows for personal, delegate, and service accounts.
Install
pip install exchange_interface
Example Script
import requests
from exchange_interface import EWS
import datetime
ews = EWS(
username='me@email.com',
password='SuperSecretPassword',
)
ews.Connected = lambda _, state: print('EWS', state)
ews.Disconnected = lambda _, state: print('EWS', state)
ews.NewCalendarItem = lambda _, item: print('NewCalendarItem(', item)
ews.CalendarItemChanged = lambda _, item: print('CalendarItemChanged(', item)
ews.CalendarItemDeleted = lambda _, item: print('CalendarItemDeleted(', item)
ews.UpdateCalendar()
print('Events happending now=', ews.GetNowCalItems())
print('Event(s) happening next=', ews.GetNextCalItems())
nowDT = datetime.datetime.now()
nowPlus24hrs = nowDT + datetime.timedelta(days=1)
print('Events happening in the next 24 hours=', ews.GetEventsInRange(startDT=nowDT, endDT=nowPlus24hrs))
# You can create a new event like this:
ews.CreateCalendarEvent(
subjec='Test Subject',
body='Test Body',
startDT=datetime.datetime.now(),
endDT=datetime.datetime.now() + datetime.timedelta(hours=1),
)
Service Accounts
import requests
from exchange_interface import EWS
ews = EWS(
username='serviceAccount@email.com',
password='SuperSecretPassword', # the service account password
impersonation='roomAccount@email.com'
)
Oauth
import requests
from exchange_interface import EWS
def GetAccessToken():
# do the oauth magic here
return 'theOauthToken'
ews = EWS(
username='serviceAccount@email.com',
oauthCallback=GetAccessToken, # this will be called before each HTTP request is sent
impersonation='roomAccount@email.com'
)
Metadata
Release files for exchange-interface 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| exchange_interface-0.0.4.tar.gz | 9.3 kB | Without provenance | Details for exchange_interface-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| exchange_interface-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for exchange_interface-0.0.4-py3-none-any.whl |
Total release size: 18.0 kB
Release files / exchange_interface-0.0.4.tar.gz
| Download URL | exchange_interface-0.0.4.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b95c391cada2ecbd65750eebb1611065b3455eb51d86722ab61e482266a2361
|
|
BLAKE2b-256 checksum How to use checksums |
9b9c981a4c20c470237d4b12041e215d127096aea6f0a7d10057a70c95af6534
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
|
Release files / exchange_interface-0.0.4-py3-none-any.whl
| Download URL | exchange_interface-0.0.4-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd5a56ca4d2f2c6fd851d344687884f4eefeb1465b7cab6c1b9289441473c7cd
|
|
BLAKE2b-256 checksum How to use checksums |
df7d881fd3ee49c76fb711b50090ef9c336b1db9a4d21b0595c974aae9b2143f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
|
Security for exchange-interface 0.0.4
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.