File: api.rst

package info (click to toggle)
python-simplenote 2.1.4-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 164 kB
  • sloc: python: 495; makefile: 116
file content (81 lines) | stat: -rw-r--r-- 2,811 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.. _api:

===
API
===


.. module:: simplenote

This chapter covers all API interfaces of the simplenote module.

---------------------------------------
Historical Simplenote API - Note Object
---------------------------------------

Prior to the Simperium API a complete note `dict` object contained the
following fields::

    {
      key       : (string, note identifier, created by server),
      deleted   : (bool, whether or not note is in trash),
      modifydate: (last modified date, in seconds since epoch),
      createdate: (note created date, in seconds since epoch),
      syncnum   : (integer, number set by server, track note changes),
      version   : (integer, number set by server, track note content changes),
      minversion: (integer, number set by server, minimum version available for note),
      sharekey  : (string, shared note identifier),
      publishkey: (string, published note identifier),
      systemtags: [(Array of strings, some set by server)],
      tags      : [(Array of strings)],
      content   : (string, data content)
    }

---------------------------
Simperium API - Note Object
---------------------------

Under Simperium some of the fields were renamed and some were removed. String
data also seems to be UTF-8 by default. A Simperium note object looks like
this::


    {
      deleted         : (bool, whether or not note is in trash),
      modificationDate: (last modified date, in seconds since epoch),
      creationDate    : (note created date, in seconds since epoch),
      version         : (integer, number set by server, track note content changes),
      shareURL        : (string, shared url),
      publishURL      : (string, published note url),
      systemTags      : [(Array of strings, some set by server)],
      tags            : [(Array of strings)],
      content         : (string, data content)
    }
   
It no longer includes the "key" (actually now an "id", but still not included
in the note object).

Howver, Simplenote.py tries to work as a drop in replacement for code that
expects the older fields and therefore you can still use the following::

    {
      key       : (string, note identifier, created by server),
      deleted   : (bool, whether or not note is in trash),
      modifydate: (last modified date, in seconds since epoch),
      createdate: (note created date, in seconds since epoch),
      version   : (integer, number set by server, track note content changes),
      systemtags: [(Array of strings, some set by server)],
      tags      : [(Array of strings)],
      content   : (string, data content)
    }

And simplenote.py will handle conversion to/from the Simperium fields.

-----------------------
Simplenote main class
-----------------------


.. autoclass:: Simplenote
   :inherited-members: