Skip to main content

PyPI version build codecov Total alerts Language grade: Python

Pocket Stats

A tool to analyze your Pocket reading list.

Deployed at https://pocket-stats.nlbao.page .

Features

Word Cloud

word_cloud

Article Count timeseries

article_count

Word Count distribution

Stacked histograms word_count

Reading Speed & Reading Time

Stacked histograms reading_time

Top Domains

Stacked bar charts. top_domains

Language & Favorite

language_favorite

Installation

Prerequisites:

You can install using Pip:

    pip3 install pocket-stats

Or clone this repo:

    git clone https://github.com/nlbao/pocket_stats.git
    cd pocket_stats
    make setup

Run web app locally

    # Set necessary environment variables:
    export POCKET_STATS_CONSUMER_KEY='<your_pocket_consumer_key>'
    export POCKET_STATS_ACCESS_TOKEN='<your_pocket_access_token>'
       
    # Start the webserver
    gunicorn --workers 2 'pocket_stats.app:server' -b :8050 --reload
    
    # You will see something like this:
    # Dash is running on http://127.0.0.1:8050/

Go to http://127.0.0.1:8050/ from your web browser.

Data querying

    from pocket_stats.data import <your_function_names>
  • Count word in all the titles:
    >>> count_words_in_title(data)
    Counter({'-': 5, '|': 5, 'python': 3, 'problem': 2, 'strace': 1, 'wow': 1, 'much': 1, 'syscall': 1, 'martin': 1, 'heinz': 1, 'personal': 1, 'website': 1, '&': 1, 'blog': 1, 'call': 1, 'programmer,': 1})
  • Number of words in each article:
    >>> get_word_counts(data)
    [2207, 0, 5449, 4721, 3245, 805, 1849, 4087, 0, 538, 5054, 21, 866, 266, 1146, 213, 823, 3551, 787, 0]
  • Reading time of each article:
    >>> get_reading_time(data)
    [9.80888888888889, 24.217777777777776, 20.982222222222223, 14.422222222222222, 3.577777777777778, 8.217777777777778, 18.164444444444445, 2.391111111111111, 22.462222222222223, 0.09333333333333334, 3.848888888888889, 1.1822222222222223, 5.093333333333334, 0.9466666666666667, 3.6577777777777776, 15.782222222222222, 3.497777777777778]
  • Number of newly added articles per day:
    >>> get_added_time_series(data) 
                All articles
    2020-07-04             5
    2020-07-03             8
    2020-07-02             2
    2020-07-01             5
  • Number of newly archived articles per day:
    >>> get_archived_time_series(data)
                Archived articles
    2020-07-04             2
  • Number of articles per domain:
    >>> get_domain_counts(data)
    Counter({'kalzumeus.com': 3, 'bogleheads.org': 2, 'github.io': 2, 'brendangregg.com': 1, 'martinheinz.dev': 1, 'awealthofcommonsense.com': 1, 'jlcollinsnh.com': 1, 'callan.com': 1, 'engineerseekingfire.com': 1, 'arxiv.org': 1, 'popularmechanics.com': 1, 'dolpages.com': 1, 'economist.com': 1, 'romantomjak.com': 1, 'digitalocean.com': 1, 'deepnote.com': 1})
  • Number of articles per language:
    >>> get_language_counts(data)
    Counter({'en': 17, 'unknown': 3})
  • Number of favorite articles and its percent:
    >>> get_favorite_count(data)
    {'count': 2, 'percent': 0.1}

Testing

    make check

Deployment

You can deploy the app.py as a webserver.

Example: https://dash.plotly.com/deployment.

Contribute

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

License

MIT License - see the LICENSE.md file for details.

Acknowledgments

Metadata

Release files for pocket-stats 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pocket-stats 0.3.1
File Size Uploaded Provenance Actions
pocket_stats-0.3.1.tar.gz 11.9 kB Without provenance Details for pocket_stats-0.3.1.tar.gz

Release files / pocket_stats-0.3.1.tar.gz

Download URL pocket_stats-0.3.1.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ca05f5dc6d0310bf3965606d4d2f49538fc15f1801656353e5ab25223f6a36f9
BLAKE2b-256 checksum
How to use checksums
8f425b59061d6b897141daf0d3249ab9958b2226670bd7b766d5d654a71ff1d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Security for pocket-stats 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page