Name | pelican-statistics JSON |
Version |
1.0.0
JSON |
| download |
home_page | None |
Summary | Pelican plugin that calculates post statistics such as word count, reading ease, and more. |
upload_time | 2025-01-12 09:54:35 |
maintainer | None |
docs_url | None |
author | None |
requires_python | ~=3.9 |
license | AGPL-3.0 |
keywords |
pelican
plugin
statistics
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Statistics: A Plugin for Pelican
================================
[](https://github.com/pelican-plugins/statistics/actions)
[](https://pypi.org/project/pelican-statistics/)
[](https://pypi.org/project/pelican-statistics/)

Statistics is a Pelican plugin that calculates post statistics such as word count, reading ease, and more.
Installation
------------
This plugin can be installed via:
python -m pip install pelican-statistics
As long as you have not explicitly added a `PLUGINS` setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add `statistics` to your existing `PLUGINS` list. For more information, please see the [How to Use Plugins](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.
Usage
-----
This plugin calculates various statistics about a post and stores them in an `article.statistics` dictionary:
- `wc`: the number of words in the article
- `read_mins`: how many minutes it would take to read this article, based on 250 [WPM](https://en.wikipedia.org/wiki/Words_per_minute#Reading_and_comprehension)
- `word_counts`: frequency count of all the words in the article — can be used for tag/word clouds
- `fi`: [Flesch Reading Ease](https://en.wikipedia.org/wiki/Flesch–Kincaid_readability_tests)
- `fk`: Flesch–Kincaid Grade Level
`article.statistics` dictionary example:
```python
{
'wc': 2760,
'fi': '65.94',
'fk': '7.65',
'word_counts': Counter({"to": 98, "a": 90, "the": 83, "of": 50, ...}),
'read_mins': 12
}
```
This `article.statistics` dictionary allows you to output these values in your templates. For example:
```html
<p title="~{{ article.statistics['wc'] }} words">~{{ article.statistics['read_mins'] }} min read</p>
<ul>
<li>Flesch Reading Ease: {{ article.statistics['fi'] }}</li>
<li>Flesch–Kincaid Grade Level: {{ article.statistics['fk'] }}</li>
</ul>
```
The `word_counts` variable is a python `Counter` dictionary and looks something like the following, with each unique word and its frequency:
```python
Counter({"to": 98, "a": 90, "the": 83, "of": 50, "karma": 50, .....
```
This `word_counts` variable can be used to create a tag/word cloud for a post.
Contributing
------------
Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].
To start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.
[existing issues]: https://github.com/pelican-plugins/statistics/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html
License
-------
This project is licensed under the AGPL-3.0 license.
Raw data
{
"_id": null,
"home_page": null,
"name": "pelican-statistics",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.9",
"maintainer_email": null,
"keywords": "pelican, plugin, statistics",
"author": null,
"author_email": "Pelican Dev Team <authors@getpelican.com>",
"download_url": "https://files.pythonhosted.org/packages/5e/b5/ff348ea371553423afd666bc6544509b6b4ed267f77887972088cac0109f/pelican_statistics-1.0.0.tar.gz",
"platform": null,
"description": "Statistics: A Plugin for Pelican\n================================\n\n[](https://github.com/pelican-plugins/statistics/actions)\n[](https://pypi.org/project/pelican-statistics/)\n[](https://pypi.org/project/pelican-statistics/)\n\n\nStatistics is a Pelican plugin that calculates post statistics such as word count, reading ease, and more.\n\nInstallation\n------------\n\nThis plugin can be installed via:\n\n python -m pip install pelican-statistics\n\nAs long as you have not explicitly added a `PLUGINS` setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add `statistics` to your existing `PLUGINS` list. For more information, please see the [How to Use Plugins](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.\n\nUsage\n-----\n\nThis plugin calculates various statistics about a post and stores them in an `article.statistics` dictionary:\n\n- `wc`: the number of words in the article\n- `read_mins`: how many minutes it would take to read this article, based on 250 [WPM](https://en.wikipedia.org/wiki/Words_per_minute#Reading_and_comprehension)\n- `word_counts`: frequency count of all the words in the article \u2014 can be used for tag/word clouds\n- `fi`: [Flesch Reading Ease](https://en.wikipedia.org/wiki/Flesch\u2013Kincaid_readability_tests)\n- `fk`: Flesch\u2013Kincaid Grade Level\n\n`article.statistics` dictionary example:\n\n```python\n{\n 'wc': 2760,\n 'fi': '65.94',\n 'fk': '7.65',\n 'word_counts': Counter({\"to\": 98, \"a\": 90, \"the\": 83, \"of\": 50, ...}),\n 'read_mins': 12\n}\n```\n\nThis `article.statistics` dictionary allows you to output these values in your templates. For example:\n\n```html\n<p title=\"~{{ article.statistics['wc'] }} words\">~{{ article.statistics['read_mins'] }} min read</p>\n<ul>\n <li>Flesch Reading Ease: {{ article.statistics['fi'] }}</li>\n <li>Flesch\u2013Kincaid Grade Level: {{ article.statistics['fk'] }}</li>\n</ul>\n```\n\nThe `word_counts` variable is a python `Counter` dictionary and looks something like the following, with each unique word and its frequency:\n\n```python\nCounter({\"to\": 98, \"a\": 90, \"the\": 83, \"of\": 50, \"karma\": 50, .....\n```\n\nThis `word_counts` variable can be used to create a tag/word cloud for a post.\n\nContributing\n------------\n\nContributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on [existing issues][].\n\nTo start contributing to this plugin, review the [Contributing to Pelican][] documentation, beginning with the **Contributing Code** section.\n\n[existing issues]: https://github.com/pelican-plugins/statistics/issues\n[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html\n\nLicense\n-------\n\nThis project is licensed under the AGPL-3.0 license.\n",
"bugtrack_url": null,
"license": "AGPL-3.0",
"summary": "Pelican plugin that calculates post statistics such as word count, reading ease, and more.",
"version": "1.0.0",
"project_urls": {
"Changelog": "https://github.com/pelican-plugins/statistics/blob/main/CHANGELOG.md",
"Funding": "https://donate.getpelican.com/",
"Homepage": "https://github.com/pelican-plugins/statistics",
"Issue Tracker": "https://github.com/pelican-plugins/statistics/issues"
},
"split_keywords": [
"pelican",
" plugin",
" statistics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8994cea69c4042022106cf9ae93c6d1af32770bf8f154903d09a63d305f01043",
"md5": "aed4762450aaa3d4df810e9b7adc8cdb",
"sha256": "f2397fc1cee0731e65057d755c5aa8811d075b20c11b2bdc07a88ea7b7dc40e1"
},
"downloads": -1,
"filename": "pelican_statistics-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aed4762450aaa3d4df810e9b7adc8cdb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.9",
"size": 6242,
"upload_time": "2025-01-12T09:54:32",
"upload_time_iso_8601": "2025-01-12T09:54:32.484029Z",
"url": "https://files.pythonhosted.org/packages/89/94/cea69c4042022106cf9ae93c6d1af32770bf8f154903d09a63d305f01043/pelican_statistics-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5eb5ff348ea371553423afd666bc6544509b6b4ed267f77887972088cac0109f",
"md5": "c8650d77a406593a8e2e7a8d714ce55a",
"sha256": "d9d20b262bb8e9af975c68fb73169fd9d588f26ff340260387ec4dc81f2d13b0"
},
"downloads": -1,
"filename": "pelican_statistics-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "c8650d77a406593a8e2e7a8d714ce55a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.9",
"size": 5410,
"upload_time": "2025-01-12T09:54:35",
"upload_time_iso_8601": "2025-01-12T09:54:35.008779Z",
"url": "https://files.pythonhosted.org/packages/5e/b5/ff348ea371553423afd666bc6544509b6b4ed267f77887972088cac0109f/pelican_statistics-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-12 09:54:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pelican-plugins",
"github_project": "statistics",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pelican-statistics"
}