event.notes

Platypush documentation

event.notes#

class platypush.message.event.notes.BaseNoteEvent(*args, plugin: str, **kwargs)[source]#

Bases: Event, ABC

Base class for note events.

__init__(*args, plugin: str, **kwargs)[source]#
Parameters:

plugin – The name of the plugin that triggered the event.

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.notes.CollectionCreatedEvent(*args, collection: NoteCollection, **kwargs)[source]#

Bases: NoteCollectionEvent

Event triggered when a note collection is created.

__init__(*args, collection: NoteCollection, **kwargs)#
Parameters:

collection

Format:

{
  "collections": [
    {
      "description": "Notes related to work projects",
      "id": 1235,
      "title": "Work Notes"
    }
  ],
  "created_at": "2020-01-01T00:00:00+00:00",
  "description": "A collection of my important notes",
  "id": 1234,
  "notes": [
    {
      "content": "Note content goes here",
      "created_at": "2023-10-01T12:00:00Z",
      "id": 2345,
      "title": "My Important Note",
      "updated_at": "2023-10-02T12:00:00Z"
    }
  ],
  "parent": {
    "description": "A top-level collection of all notes",
    "id": 1233,
    "title": "All Notes"
  },
  "title": "My Notes",
  "updated_at": "2020-01-01T00:00:00+00:00"
}

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.notes.CollectionDeletedEvent(*args, collection: NoteCollection, **kwargs)[source]#

Bases: NoteCollectionEvent

Event triggered when a note collection is deleted.

__init__(*args, collection: NoteCollection, **kwargs)#
Parameters:

collection

Format:

{
  "collections": [
    {
      "description": "Notes related to work projects",
      "id": 1235,
      "title": "Work Notes"
    }
  ],
  "created_at": "2020-01-01T00:00:00+00:00",
  "description": "A collection of my important notes",
  "id": 1234,
  "notes": [
    {
      "content": "Note content goes here",
      "created_at": "2023-10-01T12:00:00Z",
      "id": 2345,
      "title": "My Important Note",
      "updated_at": "2023-10-02T12:00:00Z"
    }
  ],
  "parent": {
    "description": "A top-level collection of all notes",
    "id": 1233,
    "title": "All Notes"
  },
  "title": "My Notes",
  "updated_at": "2020-01-01T00:00:00+00:00"
}

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.notes.CollectionUpdatedEvent(*args, collection: NoteCollection, **kwargs)[source]#

Bases: NoteCollectionEvent

Event triggered when a note collection is updated.

__init__(*args, collection: NoteCollection, **kwargs)#
Parameters:

collection

Format:

{
  "collections": [
    {
      "description": "Notes related to work projects",
      "id": 1235,
      "title": "Work Notes"
    }
  ],
  "created_at": "2020-01-01T00:00:00+00:00",
  "description": "A collection of my important notes",
  "id": 1234,
  "notes": [
    {
      "content": "Note content goes here",
      "created_at": "2023-10-01T12:00:00Z",
      "id": 2345,
      "title": "My Important Note",
      "updated_at": "2023-10-02T12:00:00Z"
    }
  ],
  "parent": {
    "description": "A top-level collection of all notes",
    "id": 1233,
    "title": "All Notes"
  },
  "title": "My Notes",
  "updated_at": "2020-01-01T00:00:00+00:00"
}

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.notes.NoteCollectionEvent(*args, collection: NoteCollection, **kwargs)[source]#

Bases: BaseNoteEvent, ABC

Base class for note collection events.

__init__(*args, collection: NoteCollection, **kwargs)[source]#
Parameters:

collection

Format:

{
  "collections": [
    {
      "description": "Notes related to work projects",
      "id": 1235,
      "title": "Work Notes"
    }
  ],
  "created_at": "2020-01-01T00:00:00+00:00",
  "description": "A collection of my important notes",
  "id": 1234,
  "notes": [
    {
      "content": "Note content goes here",
      "created_at": "2023-10-01T12:00:00Z",
      "id": 2345,
      "title": "My Important Note",
      "updated_at": "2023-10-02T12:00:00Z"
    }
  ],
  "parent": {
    "description": "A top-level collection of all notes",
    "id": 1233,
    "title": "All Notes"
  },
  "title": "My Notes",
  "updated_at": "2020-01-01T00:00:00+00:00"
}

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.notes.NoteCreatedEvent(*args, note: Note, **kwargs)[source]#

Bases: NoteItemEvent

Event triggered when a note is created

__init__(*args, note: Note, **kwargs)#
Parameters:

note

Format:

{
  "altitude": 30.0,
  "author": "John Doe",
  "content": "Note content goes here",
  "created_at": "2020-01-01T00:00:00+00:00",
  "description": "This note contains important information.",
  "digest": "abc123def456",
  "id": 2345,
  "latitude": 37.7749,
  "longitude": -122.4194,
  "parent": {
    "description": "A collection of my important notes",
    "id": 1234,
    "title": "My Notes"
  },
  "source": {
    "app": "My Note App",
    "name": "My Note Source",
    "url": "https://example.com/note"
  },
  "tags": [
    "important",
    "work"
  ],
  "title": "My Important Note",
  "updated_at": "2020-01-01T00:00:00+00:00"
}

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.notes.NoteDeletedEvent(*args, note: Note, **kwargs)[source]#

Bases: NoteItemEvent

Event triggered when a note is deleted.

__init__(*args, note: Note, **kwargs)#
Parameters:

note

Format:

{
  "altitude": 30.0,
  "author": "John Doe",
  "content": "Note content goes here",
  "created_at": "2020-01-01T00:00:00+00:00",
  "description": "This note contains important information.",
  "digest": "abc123def456",
  "id": 2345,
  "latitude": 37.7749,
  "longitude": -122.4194,
  "parent": {
    "description": "A collection of my important notes",
    "id": 1234,
    "title": "My Notes"
  },
  "source": {
    "app": "My Note App",
    "name": "My Note Source",
    "url": "https://example.com/note"
  },
  "tags": [
    "important",
    "work"
  ],
  "title": "My Important Note",
  "updated_at": "2020-01-01T00:00:00+00:00"
}

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.notes.NoteItemEvent(*args, note: Note, **kwargs)[source]#

Bases: BaseNoteEvent, ABC

Base class for note item events.

__init__(*args, note: Note, **kwargs)[source]#
Parameters:

note

Format:

{
  "altitude": 30.0,
  "author": "John Doe",
  "content": "Note content goes here",
  "created_at": "2020-01-01T00:00:00+00:00",
  "description": "This note contains important information.",
  "digest": "abc123def456",
  "id": 2345,
  "latitude": 37.7749,
  "longitude": -122.4194,
  "parent": {
    "description": "A collection of my important notes",
    "id": 1234,
    "title": "My Notes"
  },
  "source": {
    "app": "My Note App",
    "name": "My Note Source",
    "url": "https://example.com/note"
  },
  "tags": [
    "important",
    "work"
  ],
  "title": "My Important Note",
  "updated_at": "2020-01-01T00:00:00+00:00"
}

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object

class platypush.message.event.notes.NoteUpdatedEvent(*args, note: Note, **kwargs)[source]#

Bases: NoteItemEvent

Event triggered when a note is updated.

__init__(*args, note: Note, **kwargs)#
Parameters:

note

Format:

{
  "altitude": 30.0,
  "author": "John Doe",
  "content": "Note content goes here",
  "created_at": "2020-01-01T00:00:00+00:00",
  "description": "This note contains important information.",
  "digest": "abc123def456",
  "id": 2345,
  "latitude": 37.7749,
  "longitude": -122.4194,
  "parent": {
    "description": "A collection of my important notes",
    "id": 1234,
    "title": "My Notes"
  },
  "source": {
    "app": "My Note App",
    "name": "My Note Source",
    "url": "https://example.com/note"
  },
  "tags": [
    "important",
    "work"
  ],
  "title": "My Important Note",
  "updated_at": "2020-01-01T00:00:00+00:00"
}

as_dict()#

Converts the event into a dictionary

classmethod build(msg)#

Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event

matches_condition(condition)#

If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object

classmethod parse(msg)#

Parse a generic message into a key-value dictionary

Parameters:

msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON

classmethod to_dict(msg)#

Converts a Message object into a dictionary

Parameters:

msg – Message object