{ "info": { "author": "Phoenix Zerin", "author_email": "phx@phx.ph", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Filters" ], "description": ".. image:: https://travis-ci.org/todofixthis/filters.svg?branch=master\n :target: https://travis-ci.org/todofixthis/filters\n.. image:: https://readthedocs.org/projects/filters/badge/?version=latest\n :target: http://filters.readthedocs.io/\n\n\n=======\nFilters\n=======\nThe Filters library provides an easy and readable way to create complex\ndata validation and processing pipelines, including:\n\n- Validating complex JSON structures in API requests or config files.\n- Parsing timestamps and converting to UTC.\n- Converting Unicode strings to NFC, normalizing line endings and removing\n unprintable characters.\n- Decoding Base64, including URL-safe variants.\n\nAnd much more!\n\nThe output from one filter can be \"piped\" into the input of another, enabling\nyou to \"chain\" filters together to quickly and easily create complex data\npipelines.\n\n\nExamples\n--------\nValidate a latitude position and round to manageable precision:\n\n.. code-block:: python\n\n (\n f.Required |\n f.Decimal |\n f.Min(Decimal(-90)) |\n f.Max(Decimal(90)) |\n f.Round(to_nearest='0.000001')\n ).apply('-12.0431842')\n\nParse an incoming value as a datetime, convert to UTC and strip tzinfo:\n\n.. code-block:: python\n\n f.Datetime(naive=True).apply('2015-04-08T15:11:22-05:00')\n\nConvert every value in an iterable (e.g., list) to unicode and strip\nleading/trailing whitespace.\nThis also applies `Unicode normalization`_, strips unprintable characters and\nnormalizes line endings automatically.\n\n.. code-block:: python\n\n f.FilterRepeater(f.Unicode | f.Strip).apply([\n b'\\xe2\\x99\\xaa ',\n b'\\xe2\\x94\\x8f(\\xc2\\xb0.\\xc2\\xb0)\\xe2\\x94\\x9b ',\n b'\\xe2\\x94\\x97(\\xc2\\xb0.\\xc2\\xb0)\\xe2\\x94\\x93 ',\n b'\\xe2\\x99\\xaa ',\n ])\n\nParse a JSON string and check that it has correct structure:\n\n.. code-block:: python\n\n (\n f.JsonDecode |\n f.FilterMapper(\n {\n 'birthday': f.Date,\n 'gender': f.CaseFold | f.Choice(choices={'m', 'f', 'x'}),\n\n 'utcOffset':\n f.Decimal |\n f.Min(Decimal('-15')) |\n f.Max(Decimal('+15')) |\n f.Round(to_nearest='0.25'),\n },\n\n allow_extra_keys = False,\n allow_missing_keys = False,\n )\n ).apply('{\"birthday\":\"1879-03-14\", \"gender\":\"M\", \"utcOffset\":\"1\"}')\n\n\nRequirements\n------------\nFilters is compatible with the following Python versions:\n\n- 3.8\n- 3.7\n- 3.6\n- 3.5\n\n.. note::\n Filters is **not** compatible with Python 2.\n\n\nInstallation\n------------\nInstall the latest stable version via pip::\n\n pip install phx-filters\n\n\nExtensions\n~~~~~~~~~~\nThe following extensions are available:\n\n- `Django Filters`_: Adds filters designed to work with Django applications.\n To install::\n\n pip install phx-filters[django]\n\n- `ISO Filters`_: Adds filters for interpreting standard codes and identifiers.\n To install::\n\n pip install phx-filters[iso]\n\n.. tip::\n To install multiple extensions, separate them with commas, e.g.::\n\n pip install phx-filters[django,iso]\n\n\nRunning Unit Tests\n------------------\nTo run unit tests after installing from source::\n\n python setup.py test\n\nThis project is also compatible with `tox`_, which will run the unit tests in\ndifferent virtual environments (one for each supported version of Python).\n\nInstall the package with the ``test-runner`` extra to set up the necessary\ndependencies, and then you can run the tests with the ``tox`` command::\n\n pip install -e .[test-runner]\n tox -p all\n\n\nDocumentation\n-------------\nDocumentation is available on `ReadTheDocs`_.\n\nIf you are installing from source (see above), you can also build the\ndocumentation locally:\n\n#. Install extra dependencies (you only have to do this once)::\n\n pip install '.[docs-builder]'\n\n#. Switch to the ``docs`` directory::\n\n cd docs\n\n#. Build the documentation::\n\n make html\n\n\n.. _Django Filters: https://pypi.python.org/pypi/filters-django\n.. _ISO Filters: https://pypi.python.org/pypi/filters-iso\n.. _ReadTheDocs: https://filters.readthedocs.io/\n.. _tox: https://tox.readthedocs.io/\n.. _Unicode normalization: https://en.wikipedia.org/wiki/Unicode_equivalence\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://filters.readthedocs.io/", "keywords": "data validation", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "phx-filters", "package_url": "https://pypi.org/project/phx-filters/", "platform": "", "project_url": "https://pypi.org/project/phx-filters/", "project_urls": { "Homepage": "https://filters.readthedocs.io/" }, "release_url": "https://pypi.org/project/phx-filters/2.0.2/", "requires_dist": [ "phx-class-registry", "python-dateutil", "pytz", "regex (>=2018.8.17)", "phx-filters-django ; extra == 'django'", "sphinx ; extra == 'docs-builder'", "sphinx-rtd-theme ; extra == 'docs-builder'", "phx-filters-iso ; extra == 'iso'", "tox (>=3.7) ; extra == 'test-runner'", "nose ; extra == 'test-runner'" ], "requires_python": "", "summary": "Validation and data pipelines made easy!", "version": "2.0.2" }, "last_serial": 5942498, "releases": { "2.0.0": [ { "comment_text": "", "digests": { "md5": "f992cb67bdc46617a285175cc3f4abbf", "sha256": "75c1b77e52a286193ccc47814a6427794063c39d009eb091c10b2042965e63e6" }, "downloads": -1, "filename": "phx_filters-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f992cb67bdc46617a285175cc3f4abbf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 35147, "upload_time": "2019-08-29T12:30:49", "url": "https://files.pythonhosted.org/packages/48/e0/195529e15b6e5dcbea20fa21d7df449bfa763086222cb3247d1313e93b24/phx_filters-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c440bbac3a1c1f210b62e39e8407ea4", "sha256": "329943eec0dd9134c6224e7a11ac1df50edf37c9ec6113a3387f9fc72f84103f" }, "downloads": -1, "filename": "phx-filters-2.0.0.tar.gz", "has_sig": false, "md5_digest": "4c440bbac3a1c1f210b62e39e8407ea4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58646, "upload_time": "2019-08-29T12:30:52", "url": "https://files.pythonhosted.org/packages/8d/a3/020f32c54623e714f33047fe7fafeb53fe6f6adf7bf1e7342e40771ab6c4/phx-filters-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "3ffb14ea27f1a12e52c49938cb4fb50c", "sha256": "6dacfef5a16ed6726434811d593478c3da9226523333667cd2d8d1c038aa1084" }, "downloads": -1, "filename": "phx_filters-2.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3ffb14ea27f1a12e52c49938cb4fb50c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 35941, "upload_time": "2019-09-30T03:09:54", "url": "https://files.pythonhosted.org/packages/d7/93/bf57ec37d92353e706ed125335c7a851ba9bd13e2bd28da5639153668bbc/phx_filters-2.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8f919f305bca802047cdeb3a0f43c63", "sha256": "b6ff09b865d0aa6402f657279b74bbf5c46a6af33e89609c34c93c743ab2f15c" }, "downloads": -1, "filename": "phx-filters-2.0.1.tar.gz", "has_sig": false, "md5_digest": "e8f919f305bca802047cdeb3a0f43c63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59917, "upload_time": "2019-09-30T03:09:57", "url": "https://files.pythonhosted.org/packages/75/8a/ee7eab6bf897afd98ca2a839d2b491ead8e282d286d10ea51b5de25be8cb/phx-filters-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "a4fa538e4dc141588e62cb0e92556861", "sha256": "15f603901b4240dd6dc6ebb7ee001b5372da8451a66d8998a387bbdb86d9f066" }, "downloads": -1, "filename": "phx_filters-2.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a4fa538e4dc141588e62cb0e92556861", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 35942, "upload_time": "2019-10-08T02:37:04", "url": "https://files.pythonhosted.org/packages/bc/f5/25ca588777ddebdf1d6adf98781d6353ae6910116e6753533da1739f725f/phx_filters-2.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c7a9f2798b66385c63b0fc4069ffa004", "sha256": "ca8f8bef190cff0932b6c7e1c17b50aff825ba9f68cdf14d5b46a643788a2bca" }, "downloads": -1, "filename": "phx-filters-2.0.2.tar.gz", "has_sig": false, "md5_digest": "c7a9f2798b66385c63b0fc4069ffa004", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59916, "upload_time": "2019-10-08T02:37:06", "url": "https://files.pythonhosted.org/packages/57/e1/cd033dbe3c8c31d2c03cc904429834f4fc27b44c4e36089a275647afcdce/phx-filters-2.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a4fa538e4dc141588e62cb0e92556861", "sha256": "15f603901b4240dd6dc6ebb7ee001b5372da8451a66d8998a387bbdb86d9f066" }, "downloads": -1, "filename": "phx_filters-2.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a4fa538e4dc141588e62cb0e92556861", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 35942, "upload_time": "2019-10-08T02:37:04", "url": "https://files.pythonhosted.org/packages/bc/f5/25ca588777ddebdf1d6adf98781d6353ae6910116e6753533da1739f725f/phx_filters-2.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c7a9f2798b66385c63b0fc4069ffa004", "sha256": "ca8f8bef190cff0932b6c7e1c17b50aff825ba9f68cdf14d5b46a643788a2bca" }, "downloads": -1, "filename": "phx-filters-2.0.2.tar.gz", "has_sig": false, "md5_digest": "c7a9f2798b66385c63b0fc4069ffa004", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 59916, "upload_time": "2019-10-08T02:37:06", "url": "https://files.pythonhosted.org/packages/57/e1/cd033dbe3c8c31d2c03cc904429834f4fc27b44c4e36089a275647afcdce/phx-filters-2.0.2.tar.gz" } ] }