Releases: nylas/nylas-python
v3.0.0
Release Notes
Large changes
- The Nylas Python SDK now fully supports both Python 2.7 and Python 3.3+.
- The SDK has a new dependency: the
URLObject library.
This dependency will be automatically installed when you upgrade. - The SDK now automatically converts between timestamps and Python datetime
objects. These automatic conversions are opt-in: your existing code should
continue to work unmodified. See the "Timestamps and Datetimes"
section of this document for more information.
Small changes
- The SDK now has over 95% automated test coverage.
- Previously, trying to access the following model properties would raise an error:
Folder.threads,Folder.messages,Label.threads,Label.messages.
These properties should now work as expected. - The
Threadmodel now exposes thelast_message_received_timestampand
last_message_sent_timestampproperties, obtained from the Nylas API. - Previously, if you created a
Draftobject, saved it, and then
deleted it without modifying it further, the deletion would fail silently.
Now, the SDK will actually attempt to delete a newly-savedDraftobject,
and will raise an error if it is unable to do so. - Previously, you could initialize an
APIClientwith anapi_server
value set to anhttp://URL. Now,APIClientwill verify that the
api_servervalue starts withhttps://, and will raise an error if it
does not. - The
APIClientconstructor no longers accepts theauth_serverargument,
as it was never used for anything. - The
nylas.client.util.url_concatandnylas.client.util.generate_id
functions have been removed. These functions were meant for internal use,
and were never documented or expected to be used by others. - You can now pass a
stateargument toAPIClient.authentication_url(),
as per the OAuth 2.0 spec.
Timestamps and Datetimes
Some properties in the Nylas API use timestamp integers to represent a specific
moment in time, such as Message.date. The Python SDK now exposes new properties
that have converted these existing properties from integers to Python datetime
objects. You can still access the existing properties to get the timestamp
integer -- these new properties are just a convenient way to access Python
datetime objects, if you want them.
This table summarizes the new datetime properties, and which existing timestamp
properties they match up with.
| New Property (datetime) | Existing Property (timestamp) |
|---|---|
Message.received_at |
Message.date |
Thread.first_message_at |
Thread.first_message_timestamp |
Thread.last_message_at |
Thread.last_message_timestamp |
Thread.last_message_received_at |
Thread.last_message_received_timestamp |
Thread.last_message_sent_at |
Thread.last_message_sent_timestamp |
Draft.last_modified_at |
Draft.date |
Event.original_start_at |
Event.original_start_time |
You can also use datetime objects when filtering on models with the .where()
method. For example, if you wanted to find all messages that were received
before Jan 1, 2015, previously you would run this code:
client.messages.where(received_before=1420070400).all()That code will still work, but if you prefer, you can run this code instead:
from datetime import datetime
client.messages.where(received_before=datetime(2015, 1, 1)).all()You can now use datetimes with the following filters:
client.messages.where(received_before=datetime())client.messages.where(received_after=datetime())client.threads.where(last_message_before=datetime())client.threads.where(last_message_after=datetime())client.threads.where(started_before=datetime())client.threads.where(started_after=datetime())
v2.0.0
- Add support for expanded message view
- Remove deprecated "Inbox" name
- Send correct auth headers for account management
- Respect the offset parameter for restfulmodelcollection
- Add ability to revoke token
v1.2.0
Please see the change log for full details: https://github.com/nylas/nylas-python/blob/master/CHANGELOG.md
- Deprecate tags and tag-related functions.
- Return message object when sending a draft
- Support passing parameters and request bodies on delete
v1.1.0
Please see the change log for full details: https://github.com/nylas/nylas-python/blob/master/CHANGELOG.md
- Add client.account property
- Add handling for 405 responses
- Surface SMTP server errors
- Expose Message attributes: events, snippet
- Expose Folder and Label attributes: object, account_id
- Expose Thread attribute: received_recent_date
- Expose Draft attributes: reply_to_message_id, reply_to, starred, snippet
- Expose File attributes: content_id, message_ids
- Expose "object" attribute on Calendar, Event, and Contact
- Add local token for tests
- Expose "owner" attribute on Events
- Clean up raw message data
- Don't first save draft objects when a direct send is possible.
- Remove deprecated namespaces support from SDK
- Account management fixes and upgrade/downgrade changes
- Added tests
- Drafts can now be sent without an implicit intermediate save to the mail provider.
v0.3.5
v0.3.0
Major changes:
- Adds support for the new Folders and Labels API. Tags will continue to work until September 30th, but creation is now deprecated. Full docs: https://developer.nylas.com/foundation/api_folders
Minor changes:
ccsupport in Messagesnylasmodule namespaceauth_serverno longer required if pointingAPIClientat a custom server- Support in place for
received_recent_datathread ordering (coming soon - see https://developer.nylas.com/foundation/api_threads)
v0.2.4
- Added new
CalendarandEventfields to API response - Updated chunk ordering of
RestfulModelCollectionto be consistent across chunks; all results are now in ascending order. - Merged contributor patches: tox, python 3 support.
v0.2.1
- Added full support for Accounts API (account status, upgrade, downgrade)
- Querying raw content of messages is now supported
- Updated exception handling to reflect synchronous sending errors
- Update URLs to refer to nilas.com -- ensure your OAuth callbacks are updated!