GithubHelp home page GithubHelp logo

pckt's Introduction

PCKT

A CLI for Pocket using pocket-api and influenced by pocket-cli but more specific to my use case ๐Ÿ˜‰

API and credentials

For accessing your Pocket items you must obtain a free API access. James Mackenzie provides an excellent guide.

With your credentials create a file named conf.yaml with the following content next to the __main__.py:

credentials:
  consumer_key: '<your-key>'
  access_token: '<your-token>'

Functionality

  1. Retrieve all Pocket entries from your account
  2. Store url, title, tags, and time_added in a local sqlite3 database
  3. Handle and mark missing fields (e.g. missing title)
  4. Print simple statistics about tags
  5. Filter and output stored entries as ascii table or parsable

Why

Over the years the tags of my Pocket entries increased and need to be standardized. Therefore, the goal is to clean up Pocket entries, especially their tag, with the help of this tool. Of course the web frontend offers filtering by tag but in my opinion a CLI tool is more powerful.

Commands

$ python main.py
Usage: main.py [OPTIONS] COMMAND [ARGS]...

  CLI for interacting with the Pocket API

Options:
  --help  Show this message and exit.

Commands:
  filter  Filter and list entries
  tags    Prints tags and their figures
  update  Updates/recreates the database containing all information

Create / update local database

$ python main.py update --help
Usage: main.py update [OPTIONS]

  Updates/recreates the database containing all information

Options:
  --count INTEGER  number of entries to fetch
  --path TEXT      path to sqlite3 file
  --help           Show this message and exit.

List and filter entries

python __main__.py filter --help
Usage: __main__.py filter [OPTIONS] [KEYWORDS]...

  Filter and list entries

Options:
  --path TEXT                 path to sqlite3 file
  --width INTEGER             column width of url and title
  --col TEXT                  Which column (url, title, tags, note) to search
  --count / --no-count        Prints number of items
  --parsable / --no-parsable  Output no asci table
  --help                      Show this message and exit.

Print tag stats

$ python main.py tags --help
Usage: main.py tags [OPTIONS]

  Prints tags and their figures

Options:
  --path TEXT         path to sqlite3 file
  --sort / --no-sort  sort by tag numbers
  --help              Show this message and exit.

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.