Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/e-alizadeh/PyPocket
A Python Wrapper (Unofficial) for GetPocket (https://getpocket.com)
https://github.com/e-alizadeh/PyPocket
Last synced: 4 months ago
JSON representation
A Python Wrapper (Unofficial) for GetPocket (https://getpocket.com)
- Host: GitHub
- URL: https://github.com/e-alizadeh/PyPocket
- Owner: e-alizadeh
- License: mit
- Created: 2021-01-17T04:11:15.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-05T03:30:23.000Z (about 4 years ago)
- Last Synced: 2024-10-02T11:45:58.178Z (5 months ago)
- Language: Python
- Homepage:
- Size: 90.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PyPocket

[](https://github.com/e-alizadeh/pypocket/actions)
[](https://badge.fury.io/py/pypocket)

[](https://github.com/psf/black)
---
[](https://sonarcloud.io/dashboard?id=PyPocket)[](https://sonarcloud.io/dashboard?id=PyPocket)
[](https://sonarcloud.io/dashboard?id=PyPocket)
[](https://sonarcloud.io/dashboard?id=PyPocket)
[](https://sonarcloud.io/dashboard?id=PyPocket)
[](https://sonarcloud.io/dashboard?id=PyPocket)
[](https://sonarcloud.io/dashboard?id=PyPocket)
---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](https://github.com/e-alizadeh/PyPocket/projects/1). Feel free to request a new feature!
## Installation
```bash
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](https://getpocket.com/developer/docs/authentication)
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.
```python
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:
```python
access_token = auth.get_access_token()
```
---
## Usage```python
from pypocket import Pocketp = 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