Welcome to the Python Zeef API lib.
Using pip:
pip install pyzeef
or cloning installing the current build
git clone https://github.com/ellisonleao/pyzeef.git
cd pyzeef
python setup.py develop
I strong recommend using a virtualenv before installing any of the methods above.
Before get things started, you will need a ZEEF Token in order to use the lib. To generate a new token, please go here
After generating your token:
from pyzeef import Zeef
z = Zeef('YOUR-TOKEN')
print z.pages
# Output
[
<Page ID>,
...
]
When instantiating a new Zeef class all of your pages and the scratchpad will also be persisted by default. If you don't want to fetch the pages and/or the scratchpad you can pass persist_pages
and get_scratchpad
kwargs when creating the new class
That method will be called on the object creation if persist_pages=True
. It will authorize and persist your token through all the API requests and also fetch/persist your ZEEF pages. You can also pass a new
token when instantiating the class. That token will be persisted to be used on the future requests.
You can fetch a page by passing the page_id
or passing both alias
and username
This wil return a Page class.
This will return a Block class object, if any block is found with the block_id
provided.
This will return a Link class objects, if any link is found with the link_id
provided.
Quick method to create a new page, given the name, language and the type. This will return a Page instance with the new page information.
page
- This will return the fetched pages list, as Page objects.
When fetching the pages, there is a helper class which can help you make Zeef Page CRUD operations.
Updates the current page. Both fields are optional.
This will output your ZEEF page in a markdown format.
blocks
- A page can contain multiple blocks. When retrieving a page, the blocks property will return a list of Block objects to help on block API operations.title
- Page's title.
Updates the current block with given data dict. data
keys can be:
title
- Stringpromoted
- Booleanpublicly_visible
- Boolean
For link
type blocks, we can add:
description
- String
For feed
type blocks
, we can add:
feed_url
- URL Stringmax_links
- Integerrefresh_minutes
- Integer
Deletes the block from the Page
links
- A list of Link objects to help links API operationstitle
- Block's titletype
- Block's type
Updates the current link with the provided kwargs.
Deletes the link
title
- Link's titleurl
- Link's URL