Coder Social home page Coder Social logo

pypocket's Introduction

PyPocket

Actions Status PyPI version MIT License Code Style: Black


SonarCloud

Coverage Security Rating Vulnerabilities Maintainability Rating Reliability Rating Lines of Code

PyPocket is a Python wrapper for GetPocket (https://getpocket.com). The Export option in Pocket will generate a dry html file containing only the saved article links. PyPocket library will generate a more sophisticated HTML report with given tags, the article title, time added. You can specify the number of articles you want to retrieve too (particularly useful if you have a large collection of saved articles).

More functionalies are under development like the ability to filter and export by tag(s), additional metadata, etc.

Check the development roadmap for this project here. Feel free to request a new feature!

Installation

pip install pypocket

Library Requirements

  • requests (pip install requests)
  • dominate (pip install dominate)

Prerequisite: Obtain Your Consumer Key & Access Token

In order to use PyPocket, you will need consumer_key and access_token for your Pocket. For the consumer_key, you can follow Step 1 of Pocket Authentication API Documentation to obtain your consumer_key.

For obtaining your access_token, you can either follow the pocket documentation (above link) to get your access_token, or use the Auth class available in this library for your convenience as below.

from pypocket.auth import Auth
auth = Auth(consumer_key="your_consumer_key")
# The following will automatically obtain a request_token and ask you to authorize it. 
auth.authorize_request_token_browser() 

The auth.authorize_request_token_browser() will open a webpage to getpocket.com website asking you to authorize the token. Once, you authorize it. Then you can get your access token by running the following:

access_token = auth.get_access_token() 

Usage

from pypocket import Pocket

p =  Pocket(
    consumer_key="your_consumer_key", 
    access_token="your_token", 
    html_filename="report"
)
p.to_html(num_post=10)

New features in the pipeline

  • Retrieve pocket contents according to given tags
  • Modify the pocket contents properties

pypocket's People

Contributors

e-alizadeh avatar

Stargazers

Adrian Salceanu avatar  avatar Me avatar

Watchers

James Cloos avatar  avatar

pypocket's Issues

Update HTML report

Instead of having a table of output using Pandas, we should generate an HTML report in a more efficient and nicer way.
This way, we can remove pandas library from dependencies!

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.