Pinote Better enables programmatic access to Pinboard Notes. This is very much a workaround, as currently there isn't an official API for Notes. (Hence the requirement of username/password instead of API token.)
>>> from pinote import Pinote
>>> pn = Pinote('your_username', 'your_password')
Once you've done this, you can now use the pn
object to access Notes. Here are some examples:
>>> pn.get_all_notes()
{
u'count': 1,
u'notes': [{
u'hash': u'47cd8b82d59beby67',
u'title': u'my cool note',
u'created_at': u'2017-03-03 21:00:41',
u'updated_at': u'2017-03-03 21:00:41',
u'length': u'293',
u'id': u'1ebd124daf1y82nd0'
}]
}
>>> pn.get_note_details('1ebd124daf1y82nd0')
{
u'hash': u'47cd8b82d59beby67',
u'title': u'my cool note',
u'text': u'*note body* more note body',
u'created_at': u'2017-03-03 21:00:41',
u'updated_at': u'2017-03-03 21:00:41',
u'length': 5,
u'id': u'1ebd124daf1y82nd0'
}
>>> pn.get_note_html('1ebd124daf1y82nd0')
<blockquote class="note">
<p><b>my cool note</b></p>
<p><em>note body</em> more note body</p>
</blockquote>
>>> pn.add_note('my cool note', '*note body* more note body', 'space separated tags', True, False)
>>> pn.edit_note('my title', 'my note body', '1ebd124daf1y82nd0', False)
>>> pn.delete_note('1ebd124daf1y82nd0')
- Add exception handling
- Add a Pythonista GUI (i.e. iOS app)
MIT License. See License for details.