{ "info": { "author": "Libor Jelinek", "author_email": "ljelinek@virtage.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Topic :: Text Processing" ], "description": "============\nPage counter\n============\n\nHello! This is small Python library and commandline tool to count number of standard pages in the\ntext, files and folders. Comes with common standard page dialects builtin, but is super easy to\ndefine your very own method of page counting.\n\nStandard page is primary good unit of text length because it's doesn't take into account any\nformatting but the text itself only. It's useful e.g. when you want to know how much pages you wrote\nand how much will you get pay. Standard pages are used among book authors and publishers,\ntranslators and their clients, in newspaper world and many other areas.\n\nPage Counter can be used as Python library called ``page_counter``, or easy-to-use commandline tool\ncalled ``page-counter``.\n\nInstallation\n************\n\nInstallation will bring on your computer the both - library and commandline tool. Page Counter requires Python 3 installed. Then install it in standard Python way with\n\n::\n\n pip install page-counter\n\nPage Counter as Python Library\n******************************\n\nPage Counter as API has two parts: ``PageCounter`` class and functions called standard page dialects that does page counting itself dialects.\n\n``PageCounter()`` class has only one required parameter: text to analyse::\n\n page_counter = PageCounter(\"There were froggies by the lake, \"\n \"they were thinking what to make.\")\n\nSecond only ``PageCounter``\\`s parameter is optional flag to clean out HTML tags from the text. This\nis disabled by default but if you pass for example ``

sometext

`` it will use\n``sometext`` as text to analyse::\n\n page_counter = PageCounter(\"

There were froggies by the lake, \"\n \"they were thinking what to make.

\", strip_html=True)\n\nThere are only four intuitive methods of ``PageCounter`` instance:\n\n* ``chars_with_spaces()`` says number of characters including space character\n* ``chars_without_spaces()`` says number of characters except for space character\n* ``word_count()`` says number of words\n* ``page_count(dialect)`` says how many pages has the text computed using specified standard page dialect.\n\nAll methods returns integer number. ``page_count()`` called with builtin dialect never returns zero\npages - even one word or one letter long text is at least one page. Your custom dialects may behave\ndifferently.\n\nStandard page dialects\n======================\n\nThere is no universally accepted standard page. You easily come across different dialects based on\ncountry, convention or organization-specific. PageCounter is ready for this variability. As a\nparameter to ``page_count()`` you must specify *some* page dialect. Dialect argument may be of str\nfor builtin dialects, or of callable for your own dialects.\n\nIf argument is of str, it must be builtin dialect name. Builtin dialect names are defined in\n``page_counter.dialect_names`` list. For example::\n\n number_of_pages = page_counter.page_count('cz_sk_1800_chars_space_savvy_standard_page')\n\nOr you can write your own dialect callable (i.e. a function for our purposes) and pass it to\n``page_count()``. Your dialect function must accept ``PageCounter`` instance. Use ``PageCounter``\nmethods to compute page count. Example of simple dialect function::\n\n def my_company_page_standard(page_counter):\n return page_counter.chars_with_spaces // 1500\n\n number_of_pages = page_counter.page_count(my_company_page_standard)\n\nIf you think your standard page dialects should be builtin dialect, consider sharing it as an issue\nor (better) as a pull request.\n\nBuiltin standard page dialects\n==============================\n\nCurrently PageCounter includes the following builtin page dialects.\n\n* ``cz_sk_1800_chars_standard_page`` - Czech and Slovak standard page (normostrana) is 1800 chars per page including spaces.\n* ``cz_sk_1800_chars_space_savvy_standard_page`` - Czech and Slovak standard page (normostrana) is 1800 chars per page excluding multiple spaces.\n* ``uk_1000_words_standard_page`` - UK standard page is 1000 words per page.\n* ``eu_1500_chars_standard_page`` - Standard page used in many EU countries is 1500 chars per page including spaces.\n* ``eu_1500_chars_space_savvy_standard_page`` - Standard page used in many EU countries is 1500 chars per page excluding multiple spaces.\n\nPage Counter commandline tool\n*****************************\n\nBy installing PageCounter you will also get handy commandline tool ``page-counter`` for page count\ndetection in single file or files in a folder. Usage::\n\n page-counter \n page-counter \n\nFor example to count pages in ``readme.rst`` in current directory using Czech standard page\ndialect::\n\n page-counter cz_sk_1800_standard_pages readme.rst\n\nFor example to count pages recursively in all \\*.txt or \\*.TXT files in\n``~/books/python-for-novices/``::\n\n page-counter cz_sk_1800_standard_pages ~/books/python-for-novices/ txt\n\nIf you execute ``page-counter`` without parameters or with invalid number of parameters, you will get list of known builtin standard page dialects.\n\n\nContributing\n************\nIf you have something you'd like to contribute, the best approach is to send a well-formed pull\nrequest, complete with tests and documentation, as needed. Pull requests should be focused: trying\nto do more than one thing in a single request will make it more difficult to process.\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bircow/page-counter", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "page-counter", "package_url": "https://pypi.org/project/page-counter/", "platform": "", "project_url": "https://pypi.org/project/page-counter/", "project_urls": { "Homepage": "https://github.com/bircow/page-counter" }, "release_url": "https://pypi.org/project/page-counter/1.0.1/", "requires_dist": [ "beautifulsoup4" ], "requires_python": ">=3", "summary": "Small Python library and commandline tool to count number of standard pages in the text, files and folders. Comes with common standard page dialects but is super easy to bring your own definition.", "version": "1.0.1" }, "last_serial": 3853696, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "ee7010cbb4e12d05d41bc7205c899ca7", "sha256": "1deda081fad23b22a8ec056241f1b5936ba80d58a3ec27322f521841272ae1ce" }, "downloads": -1, "filename": "page_counter-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ee7010cbb4e12d05d41bc7205c899ca7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8193, "upload_time": "2018-05-07T05:14:30", "url": "https://files.pythonhosted.org/packages/a2/d5/ad800092e01ddd729e02f2a77276700c2844dda5f0b591d8ed42072525f6/page_counter-1.0.0-py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f1a667bab4c8ba06acc4c617f356b5c2", "sha256": "e375aef563cc60c29236fdc339ad1e9cfe34a581587ec5d5d75996f40f5492d1" }, "downloads": -1, "filename": "page_counter-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f1a667bab4c8ba06acc4c617f356b5c2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8483, "upload_time": "2018-05-11T10:20:12", "url": "https://files.pythonhosted.org/packages/f1/fa/5aa4d17b22434554c615b11f6d579edbb7363dd57e3f726f23148e0c9315/page_counter-1.0.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f1a667bab4c8ba06acc4c617f356b5c2", "sha256": "e375aef563cc60c29236fdc339ad1e9cfe34a581587ec5d5d75996f40f5492d1" }, "downloads": -1, "filename": "page_counter-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f1a667bab4c8ba06acc4c617f356b5c2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8483, "upload_time": "2018-05-11T10:20:12", "url": "https://files.pythonhosted.org/packages/f1/fa/5aa4d17b22434554c615b11f6d579edbb7363dd57e3f726f23148e0c9315/page_counter-1.0.1-py3-none-any.whl" } ] }