GithubHelp home page GithubHelp logo

ahmetbaglan / pocket-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rakanalh/pocket-api

0.0 1.0 0.0 17 KB

A python wrapper around GetPocket API V3.

License: MIT License

Python 100.00%

pocket-api's Introduction

Pocket-API

Build Status

This package provides a wrapper class around GetPocket V3 APIs.

Pocket-CLI

You can checkout pocket-cli, which is an application for reading / listing /managing your pocket articles from the terminal

Installation

	pip install pocket-api

Usage

First, you have to Create your consumer key from getpocket's developer console. To get the access token, you have to authorize the app on your own account. There are tools on the web that can automate this for you such as fxneumann's OneClickPocket

from pocket import Pocket, PocketException


p = Pocket(
	consumer_key='<Your Consumer Key>',
	access_token='<Your Access Token>'
)

# Fetch a list of articles
try:
	print(p.retrieve(offset=0, count=10))
except PocketException as e:
	print(e.message)

# Add an article
p.add('https://pymotw.com/3/asyncio/')

# Start a bulk operation and commit
p.archive(1186408060).favorite(1188103217).tags_add(
	1168820736, 'Python'
).tags_add(
	1168820736, 'Web Development'
).commit()

Methods

  • Add an article

      add(url, title, tags, tweet_id)
    
  • Retrieve articles

      retrieve(state, favorite, tag, contentType,
               sort, detailType, search, domain,
               since, count, offset)
    

Bulk Actions

  • Add an article to bulktime_of_action

      bulk_add(item_id, ref_id, tags, time_of_action, title, url)
    
  • Archive article

      archive(item_id, time_of_action)
    
  • Reread an article

      readd(item_id, time_of_action)
    
  • Mark article as favorite

      favorite(item_id, time_of_action)
    
  • Remove favorite mark from article

      unfavorite(item_id, time_of_action)
    
  • Delete an article from list

      delete(item_id, time_of_action)
    
  • Add tag to article

      tags_add(item_id, tags, time_of_action)
    
  • Remove tag from article

      tags_remove(item_id, tags, time_of_action)
    
  • Replace tags on article

      tags_replace(item_id, tags, time_of_action)
    
  • Clear tags from article

      tags_clear(item_id, time_of_action)
    
  • Rename a tag

      tag_rename(old_tag, new_tag, time_of_action)
    
  • Reset bulk actions (removes all previously registered actions)

      reset()
    
  • Send request of all bulk items to getpocket

      commit()
    

pocket-api's People

Contributors

rakanalh avatar

Watchers

Ahmet Baglan avatar

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.