A python x-callback-url client for Ulysses.
Implements Ulysses' x-callback-url scheme. Destined for use in Alfred's Ulysses worfklow.
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
Check it out:
$ git clone https://github.com/robwalton/ulysses-python-client.git
Cloning into 'ulysses-python-client'...
>>> 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:
...
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
...
- 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
The code and the documentation are released under the MIT and Creative Commons Attribution-NonCommercial licences respectively. See LICENCE.txt for details.
- 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