Giter Site home page Giter Site logo

pyzeef's Introduction

pyzeef

Code Health Build Status PyPI

Welcome to the Python Zeef API lib.

Table of contents

Installing

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>,
		...
	]

Zeef(token, persist_pages=True, get_scratchpad=True)

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

Methods

authorize(token=None, persist_pages=True)

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.

get_page(page_id=int, alias=string, username=string)

You can fetch a page by passing the page_id or passing both alias and username This wil return a Page class.

get_block(block_id)

This will return a Block class object, if any block is found with the block_id provided.

get_link(link_id)

This will return a Link class objects, if any link is found with the link_id provided.

create_page(name, language='en', type=['SUBJECT', 'COMPANY', 'PERSONAL'])

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.

Main properties

  • 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.

Methods

update(type=['SUBJECT', 'COMPANY'], description='your description')

Updates the current page. Both fields are optional.

to_markdown()

This will output your ZEEF page in a markdown format.

Main Properties

  • 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.

Methods

update(data)

Updates the current block with given data dict. data keys can be:

  • title - String
  • promoted - Boolean
  • publicly_visible - Boolean

For link type blocks, we can add:

  • description - String

For feed type blocks, we can add:

  • feed_url - URL String
  • max_links - Integer
  • refresh_minutes - Integer

delete()

Deletes the block from the Page

Main Properties

  • links - A list of Link objects to help links API operations
  • title - Block's title
  • type - Block's type

Methods

update(link='http://mylink.com', description='text', title='title')

Updates the current link with the provided kwargs.

delete()

Deletes the link

Main Properties

  • title - Link's title
  • url - Link's URL

pyzeef's People

Contributors

ellisonleao avatar

Stargazers

Rinat Sabitov avatar  avatar Thomas Vander Wal avatar William Oliveira avatar Jan Beernink avatar Rick Boerebach avatar

Watchers

James Cloos avatar  avatar

pyzeef's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.