Skip to main content

A Python wrapper for GetPocket

Project description

PyPocket

Actions Status PyPI version MIT License Code Style: Black


SonarCloud

Coverage Security Rating Vulnerabilities Maintainability Rating Reliability Rating Lines of Code

A Python Package for GetPocket (https://getpocket.com)

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)

Check the development roadmap for this project here

New features in the pipeline

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypocket-0.2.0.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

pypocket-0.2.0-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page