Skip to content

robwalton/ulysses-python-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ulysses-python-client

A python x-callback-url client for Ulysses.

Implements Ulysses' x-callback-url scheme. Destined for use in Alfred's Ulysses worfklow.

Software compatability

Requires:

  • macOS
  • Ulysses 2.8
  • python 2.7
  • Uses macOS' xcall (included) for x-callback-url support (Thanks Martin Finke!)
  • Uses python-xcall (included) to simplify calls to xcall
  • Needs pytest for testing

Installation

Check it out:

$ git clone https://github.com/robwalton/ulysses-python-client.git
Cloning into 'ulysses-python-client'...

Try it out

>>> import ulysses
>>> ulysses.get_version()
u'2'
>>> token = ulysses.authorize()
>>> ulysses.set_access_token(token)

>>> library = ulysses.get_root_items(recursive=True)
>>> print library[0]
Group(title='iCloud', n_sheets=0, n_containers=4, identifier='4A14NiU-iGaw06m2Y2DNwA')

>>> print '\n'.join(ulysses.treeview(library[0]))
4A14NiU-iGaw06m2Y2DNwA - iCloud:
hZ7IX2jqKbVmPGlYUXkZjQ -    Inbox:
aFV99jXk9_AHHqZJ6znb8w -       test
d5TuSlVXQwZnIWMN0DusKQ -    ulysses-python-client-playground:
dULx6YXeWVqCZzrpsH7-3A -       test sheet
YHlYv7PlYgtm626haxAF4A -    Project:
...

Testing

Running the tests requires the pytest and mock packages and Ulysses. Code your access-token into the top of test_calls.py. Get the access token removing the @skip mark from test_authorise() in this file.

From the root package folder call:

MacBook:ulysses-python-client walton$ pytest
...

API calls implemented

  • new-sheet
  • new-group
  • insert
  • attach-note
  • update-note
  • remove-note
  • attach-image
  • attach-keywords
  • remove-keywords
  • set-group-title
  • set-sheet-title
  • move
  • copy
  • trash
  • get-item
  • get-root-items
  • read-sheet
  • get-quick-look-url
  • open
  • open-all, open-recent, open-favorites
  • authorize

Licensing & thanks

The code and the documentation are released under the MIT and Creative Commons Attribution-NonCommercial licences respectively. See LICENCE.txt for details.

TODO

  • Do something useful with this
  • Add links up to parent groups
  • Logging should go somwhere sensible and include level
  • Add to PiPy
    • complete setup.py
    • document testing
  • implement attach-image call

About

Python x-callback-url client for Ulysses

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages