{"id":14035322,"url":"https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats","last_synced_at":"2025-07-27T03:31:02.900Z","repository":{"id":57441682,"uuid":"82759294","full_name":"MinchinWeb/minchin.pelican.plugins.post_stats","owner":"MinchinWeb","description":"A Pelican plugin which calculates various statistics about a post and store them in an article.stats dictionary.","archived":false,"fork":false,"pushed_at":"2023-08-09T20:47:23.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-12T13:28:27.475Z","etag":null,"topics":["pelican","pelican-plugins"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MinchinWeb.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-22T04:07:44.000Z","updated_at":"2022-11-07T00:44:21.000Z","dependencies_parsed_at":"2022-09-26T17:20:52.960Z","dependency_job_id":null,"html_url":"https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinchinWeb%2Fminchin.pelican.plugins.post_stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinchinWeb%2Fminchin.pelican.plugins.post_stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinchinWeb%2Fminchin.pelican.plugins.post_stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinchinWeb%2Fminchin.pelican.plugins.post_stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MinchinWeb","download_url":"https://codeload.github.com/MinchinWeb/minchin.pelican.plugins.post_stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":214982088,"owners_count":15811653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pelican","pelican-plugins"],"created_at":"2024-08-12T03:01:27.189Z","updated_at":"2024-08-12T03:03:09.500Z","avatar_url":"https://github.com/MinchinWeb.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"===============\nPost Statistics\n===============\n\n``Post Stats`` is a plugin for `Pelican \u003chttp://docs.getpelican.com/\u003e`_,\na static site generator written in Python.\n\n``Post Stats`` calculates various statistics about a post and store them in\nan article.stats dictionary:\n\n- ``wc``: how many words\n- ``read_mins``: how many minutes would it take to read this article, based\n  on 250 wpm\n  (`source \u003chttp://en.wikipedia.org/wiki/Words_per_minute#Reading_and_comprehension\u003e`_)\n- ``word_counts``: frquency count of all the words in the article; can be\n  used for tag/word clouds\n- ``fi``: Flesch-Kincaid Index/Reading Ease\n  (`more info \u003chttp://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests\u003e`_)\n- ``fk``: Flesch-Kincaid Grade Level\n\n\n.. image:: https://img.shields.io/pypi/v/minchin.pelican.plugins.post-stats.svg?style=flat\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/\n    :alt: PyPI version number\n\n.. image:: https://img.shields.io/badge/-Changelog-success\n   :target: https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats/blob/master/CHANGELOG.rst\n   :alt: Changelog\n\n.. image:: https://img.shields.io/pypi/pyversions/minchin.pelican.plugins.post-stats?style=flat\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/\n    :alt: Supported Python version\n\n.. image:: https://img.shields.io/pypi/l/minchin.pelican.plugins.post-stats.svg?style=flat\u0026color=green\n    :target: https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats/blob/master/LICENSE.txt\n    :alt: License\n\n.. image:: https://img.shields.io/pypi/dm/minchin.pelican.plugins.post-stats.svg?style=flat\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/\n    :alt: Download Count\n\n\nInstallation\n============\n\nThe easiest way to install ``Post Stats`` is through the use of pip. This\nwill also install the required dependencies automatically.\n\n.. code-block:: sh\n\n  pip install minchin.pelican.plugins.post_stats\n\nOn Pelican versions 4.5 and later, the plugin will automatically activate\nitself!\n\nYou may also need to configure your template to make use of the statistics\ngenerated.\n\n\nRequirements\n============\n\n``Post Stats`` depends on (and is really only useful with) Pelican. The\nplugin also requries Beautiful Soup 4 to process your content. If the plugin\nis installed from pip, these will automatically be installed. These can also\nbe manually installed with pip:\n\n.. code-block:: sh\n\n   pip install pelican\n   pip install beautifulsoup4\n\n\n\nConfiguration and Usage\n=======================\n\nThis plugin calculates various statistics about a post and store them in\nan article.stats dictionary.\n\nExample:\n\n.. code-block:: python\n\n    {\n        'wc': 2760,\n        'fi': '65.94',\n        'fk': '7.65',\n        'word_counts': Counter({u'to': 98, u'a': 90, u'the': 83, u'of': 50, ...}),\n        'read_mins': 12\n    }\n\nThis allows you to output these values in your templates, like this, for\nexample:\n\n.. code-block:: html+jinja\n\n\t\u003cp title=\"~{{ article.stats['wc'] }} words\"\u003e~{{ article.stats['read_mins'] }} min read\u003c/p\u003e\n\t\u003cul\u003e\n\t    \u003cli\u003eFlesch-kincaid Index/ Reading Ease: {{ article.stats['fi'] }}\u003c/li\u003e\n\t    \u003cli\u003eFlesch-kincaid Grade Level: {{ article.stats['fk'] }}\u003c/li\u003e\n\t\u003c/ul\u003e\n\nThe ``word_counts`` variable is a python ``Counter`` dictionary and looks\nsomething like this, with each unique word and it's frequency:\n\n.. code-block:: python\n\n\tCounter({u'to': 98, u'a': 90, u'the': 83, u'of': 50, u'karma': 50, .....\n\nand can be used to create a tag/word cloud for a post.\n\nThere are no user-configurable settings.\n\n\nCredits\n=======\n\n`Original plugin \u003chttp://duncanlock.net/blog/2013/06/23/post-statistics-plugin-for-pelican/\u003e`_\nby Duncan Lock (`@dflock \u003chttps://github.com/dflock\u003e`_) and\nposted to the `Pelican-Plugins repo\n\u003chttps://github.com/getpelican/pelican-plugins\u003e`_.\n\n\nLicense\n=======\n\nThe plugin code is assumed to be under the AGPLv3 license (this is the\nlicense of the Pelican-Plugins repo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMinchinWeb%2Fminchin.pelican.plugins.post_stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMinchinWeb%2Fminchin.pelican.plugins.post_stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMinchinWeb%2Fminchin.pelican.plugins.post_stats/lists"}