minchin.pelican.plugins.post-stats


Nameminchin.pelican.plugins.post-stats JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/MinchinWeb/minchin.pelican.plugins.post_stats
SummaryThis Pelcan plugin calculates various statistics about a post and stores them in an article.stats dictionary.
upload_time2023-08-09 20:45:05
maintainer
docs_urlNone
authorWilliam Minchin
requires_python
licenseGNU Affero General Public License v3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===============
Post Statistics
===============

``Post Stats`` is a plugin for `Pelican <http://docs.getpelican.com/>`_,
a static site generator written in Python.

``Post Stats`` calculates various statistics about a post and store them in
an article.stats dictionary:

- ``wc``: how many words
- ``read_mins``: how many minutes would it take to read this article, based
  on 250 wpm
  (`source <http://en.wikipedia.org/wiki/Words_per_minute#Reading_and_comprehension>`_)
- ``word_counts``: frquency count of all the words in the article; can be
  used for tag/word clouds
- ``fi``: Flesch-Kincaid Index/Reading Ease
  (`more info <http://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests>`_)
- ``fk``: Flesch-Kincaid Grade Level


.. image:: https://img.shields.io/pypi/v/minchin.pelican.plugins.post-stats.svg?style=flat
    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/
    :alt: PyPI version number

.. image:: https://img.shields.io/badge/-Changelog-success
   :target: https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats/blob/master/CHANGELOG.rst
   :alt: Changelog

.. image:: https://img.shields.io/pypi/pyversions/minchin.pelican.plugins.post-stats?style=flat
    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/
    :alt: Supported Python version

.. image:: https://img.shields.io/pypi/l/minchin.pelican.plugins.post-stats.svg?style=flat&color=green
    :target: https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats/blob/master/LICENSE.txt
    :alt: License

.. image:: https://img.shields.io/pypi/dm/minchin.pelican.plugins.post-stats.svg?style=flat
    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/
    :alt: Download Count


Installation
============

The easiest way to install ``Post Stats`` is through the use of pip. This
will also install the required dependencies automatically.

.. code-block:: sh

  pip install minchin.pelican.plugins.post_stats

On Pelican versions 4.5 and later, the plugin will automatically activate
itself!

You may also need to configure your template to make use of the statistics
generated.


Requirements
============

``Post Stats`` depends on (and is really only useful with) Pelican. The
plugin also requries Beautiful Soup 4 to process your content. If the plugin
is installed from pip, these will automatically be installed. These can also
be manually installed with pip:

.. code-block:: sh

   pip install pelican
   pip install beautifulsoup4



Configuration and Usage
=======================

This plugin calculates various statistics about a post and store them in
an article.stats dictionary.

Example:

.. code-block:: python

    {
        'wc': 2760,
        'fi': '65.94',
        'fk': '7.65',
        'word_counts': Counter({u'to': 98, u'a': 90, u'the': 83, u'of': 50, ...}),
        'read_mins': 12
    }

This allows you to output these values in your templates, like this, for
example:

.. code-block:: html+jinja

	<p title="~{{ article.stats['wc'] }} words">~{{ article.stats['read_mins'] }} min read</p>
	<ul>
	    <li>Flesch-kincaid Index/ Reading Ease: {{ article.stats['fi'] }}</li>
	    <li>Flesch-kincaid Grade Level: {{ article.stats['fk'] }}</li>
	</ul>

The ``word_counts`` variable is a python ``Counter`` dictionary and looks
something like this, with each unique word and it's frequency:

.. code-block:: python

	Counter({u'to': 98, u'a': 90, u'the': 83, u'of': 50, u'karma': 50, .....

and can be used to create a tag/word cloud for a post.

There are no user-configurable settings.


Credits
=======

`Original plugin <http://duncanlock.net/blog/2013/06/23/post-statistics-plugin-for-pelican/>`_
by Duncan Lock (`@dflock <https://github.com/dflock>`_) and
posted to the `Pelican-Plugins repo
<https://github.com/getpelican/pelican-plugins>`_.


License
=======

The plugin code is assumed to be under the AGPLv3 license (this is the
license of the Pelican-Plugins repo).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats",
    "name": "minchin.pelican.plugins.post-stats",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "William Minchin",
    "author_email": "w_minchin@hotmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7c/1b/db7cc319f78df11187a40a28979f02630c96c133b10773cac6ed93e6a984/minchin.pelican.plugins.post_stats-1.2.0.tar.gz",
    "platform": "any",
    "description": "===============\r\nPost Statistics\r\n===============\r\n\r\n``Post Stats`` is a plugin for `Pelican <http://docs.getpelican.com/>`_,\r\na static site generator written in Python.\r\n\r\n``Post Stats`` calculates various statistics about a post and store them in\r\nan article.stats dictionary:\r\n\r\n- ``wc``: how many words\r\n- ``read_mins``: how many minutes would it take to read this article, based\r\n  on 250 wpm\r\n  (`source <http://en.wikipedia.org/wiki/Words_per_minute#Reading_and_comprehension>`_)\r\n- ``word_counts``: frquency count of all the words in the article; can be\r\n  used for tag/word clouds\r\n- ``fi``: Flesch-Kincaid Index/Reading Ease\r\n  (`more info <http://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests>`_)\r\n- ``fk``: Flesch-Kincaid Grade Level\r\n\r\n\r\n.. image:: https://img.shields.io/pypi/v/minchin.pelican.plugins.post-stats.svg?style=flat\r\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/\r\n    :alt: PyPI version number\r\n\r\n.. image:: https://img.shields.io/badge/-Changelog-success\r\n   :target: https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats/blob/master/CHANGELOG.rst\r\n   :alt: Changelog\r\n\r\n.. image:: https://img.shields.io/pypi/pyversions/minchin.pelican.plugins.post-stats?style=flat\r\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/\r\n    :alt: Supported Python version\r\n\r\n.. image:: https://img.shields.io/pypi/l/minchin.pelican.plugins.post-stats.svg?style=flat&color=green\r\n    :target: https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats/blob/master/LICENSE.txt\r\n    :alt: License\r\n\r\n.. image:: https://img.shields.io/pypi/dm/minchin.pelican.plugins.post-stats.svg?style=flat\r\n    :target: https://pypi.python.org/pypi/minchin.pelican.plugins.post-stats/\r\n    :alt: Download Count\r\n\r\n\r\nInstallation\r\n============\r\n\r\nThe easiest way to install ``Post Stats`` is through the use of pip. This\r\nwill also install the required dependencies automatically.\r\n\r\n.. code-block:: sh\r\n\r\n  pip install minchin.pelican.plugins.post_stats\r\n\r\nOn Pelican versions 4.5 and later, the plugin will automatically activate\r\nitself!\r\n\r\nYou may also need to configure your template to make use of the statistics\r\ngenerated.\r\n\r\n\r\nRequirements\r\n============\r\n\r\n``Post Stats`` depends on (and is really only useful with) Pelican. The\r\nplugin also requries Beautiful Soup 4 to process your content. If the plugin\r\nis installed from pip, these will automatically be installed. These can also\r\nbe manually installed with pip:\r\n\r\n.. code-block:: sh\r\n\r\n   pip install pelican\r\n   pip install beautifulsoup4\r\n\r\n\r\n\r\nConfiguration and Usage\r\n=======================\r\n\r\nThis plugin calculates various statistics about a post and store them in\r\nan article.stats dictionary.\r\n\r\nExample:\r\n\r\n.. code-block:: python\r\n\r\n    {\r\n        'wc': 2760,\r\n        'fi': '65.94',\r\n        'fk': '7.65',\r\n        'word_counts': Counter({u'to': 98, u'a': 90, u'the': 83, u'of': 50, ...}),\r\n        'read_mins': 12\r\n    }\r\n\r\nThis allows you to output these values in your templates, like this, for\r\nexample:\r\n\r\n.. code-block:: html+jinja\r\n\r\n\t<p title=\"~{{ article.stats['wc'] }} words\">~{{ article.stats['read_mins'] }} min read</p>\r\n\t<ul>\r\n\t    <li>Flesch-kincaid Index/ Reading Ease: {{ article.stats['fi'] }}</li>\r\n\t    <li>Flesch-kincaid Grade Level: {{ article.stats['fk'] }}</li>\r\n\t</ul>\r\n\r\nThe ``word_counts`` variable is a python ``Counter`` dictionary and looks\r\nsomething like this, with each unique word and it's frequency:\r\n\r\n.. code-block:: python\r\n\r\n\tCounter({u'to': 98, u'a': 90, u'the': 83, u'of': 50, u'karma': 50, .....\r\n\r\nand can be used to create a tag/word cloud for a post.\r\n\r\nThere are no user-configurable settings.\r\n\r\n\r\nCredits\r\n=======\r\n\r\n`Original plugin <http://duncanlock.net/blog/2013/06/23/post-statistics-plugin-for-pelican/>`_\r\nby Duncan Lock (`@dflock <https://github.com/dflock>`_) and\r\nposted to the `Pelican-Plugins repo\r\n<https://github.com/getpelican/pelican-plugins>`_.\r\n\r\n\r\nLicense\r\n=======\r\n\r\nThe plugin code is assumed to be under the AGPLv3 license (this is the\r\nlicense of the Pelican-Plugins repo).\r\n",
    "bugtrack_url": null,
    "license": "GNU Affero General Public License v3",
    "summary": "This Pelcan plugin calculates various statistics about a post and stores them in an article.stats dictionary.",
    "version": "1.2.0",
    "project_urls": {
        "Homepage": "https://github.com/MinchinWeb/minchin.pelican.plugins.post_stats"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "34d12e1dcd7eb37ba2a116b2abace34ded975cf45ad286e8a22b8851350b7e10",
                "md5": "1ccaa173bf5a778d6de7b7829007cd9f",
                "sha256": "41b131219864754466b6b652728f3bd5b8d9c3e72726fe18c0019e50dc8f5bce"
            },
            "downloads": -1,
            "filename": "minchin.pelican.plugins.post_stats-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1ccaa173bf5a778d6de7b7829007cd9f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 18922,
            "upload_time": "2023-08-09T20:45:40",
            "upload_time_iso_8601": "2023-08-09T20:45:40.442360Z",
            "url": "https://files.pythonhosted.org/packages/34/d1/2e1dcd7eb37ba2a116b2abace34ded975cf45ad286e8a22b8851350b7e10/minchin.pelican.plugins.post_stats-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c1bdb7cc319f78df11187a40a28979f02630c96c133b10773cac6ed93e6a984",
                "md5": "80fc47470d267eebed1dac5aedeb63a6",
                "sha256": "341796a82efe4f651c31fc31a0d4018abaac3074775ed598b04a83037986d5f8"
            },
            "downloads": -1,
            "filename": "minchin.pelican.plugins.post_stats-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "80fc47470d267eebed1dac5aedeb63a6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 19533,
            "upload_time": "2023-08-09T20:45:05",
            "upload_time_iso_8601": "2023-08-09T20:45:05.573461Z",
            "url": "https://files.pythonhosted.org/packages/7c/1b/db7cc319f78df11187a40a28979f02630c96c133b10773cac6ed93e6a984/minchin.pelican.plugins.post_stats-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-09 20:45:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MinchinWeb",
    "github_project": "minchin.pelican.plugins.post_stats",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "minchin.pelican.plugins.post-stats"
}
        
Elapsed time: 0.09958s