requirements-parser


Namerequirements-parser JSON
Version 0.11.0 PyPI version JSON
download
home_pagehttps://github.com/madpah/requirements-parser/#readme
SummaryThis is a small Python module for parsing Pip requirement files.
upload_time2024-08-12 15:14:17
maintainerPaul Horton
docs_urlNone
authorPaul Horton
requires_python<4.0,>=3.8
licenseApache-2.0
keywords pip requirements parse
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Requirements Parser

[![shield_pypi-version]][link_pypi]
[![shield_rtfd]][link_rtfd]
[![shield_gh-workflow-test]][link_gh-workflow-test]
[![shield_license]][license_file]

---

This is a small Python module for parsing [Pip](http://www.pip-installer.org/) requirement files.

The goal is to parse everything in the [Pip requirement file format](https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format) spec.

## Installation

    pip install requirements-parser

or

    poetry add requirements-parser

## Examples

`requirements-parser` can parse a file-like object or a text string.

``` {.python}
>>> import requirements
>>> with open('requirements.txt', 'r') as fd:
...     for req in requirements.parse(fd):
...         print(req.name, req.specs)
Django [('>=', '1.11'), ('<', '1.12')]
six [('==', '1.10.0')]
```

It can handle most (if not all) of the options in requirement files that do not involve traversing the local filesystem. These include:

-   editables (`-e git+https://github.com/toastdriven/pyelasticsearch.git]{.title-ref}`)
-   version control URIs
-   egg hashes and subdirectories (`[\#egg=django-haystack&subdirectory=setup]{.title-ref}`)
-   extras ([DocParser\[PDF\]]{.title-ref})
-   URLs

## Documentation

View the documentation [here][link_rtfd].

## Python Support

We endeavour to support all functionality for all [current actively supported Python versions](https://www.python.org/downloads/).
However, some features may not be possible/present in older Python versions due to their lack of support.

## Changelog

See our [CHANGELOG][chaneglog_file].

## Contributing

Feel free to open issues, bugreports or pull requests.  
See the [CONTRIBUTING][contributing_file] file for details.

## Copyright & License

`requirements-parser` was originally written by @davidfischer and is now maintained by @madpah. See [Authors][authors_file] for full details. 

Permission to modify and redistribute is granted under the terms of the Apache 2.0 license.

See the [LICENSE][license_file] file for the full license.

[authors_file]: https://github.com/madpah/requirements-parser/blob/main/AUTHORS.md
[license_file]: https://github.com/madpah/requirements-parser/blob/main/LICENSE
[chaneglog_file]: https://github.com/madpah/requirements-parser/blob/main/CHANGELOG.md
[contributing_file]: https://github.com/madpah/requirements-parser/blob/main/CONTRIBUTING.md

[shield_gh-workflow-test]: https://img.shields.io/github/actions/workflow/status/madpah/requirements-parser/poetry.yml?branch=main&logo=GitHub&logoColor=white "build"
[shield_pypi-version]: https://img.shields.io/pypi/v/requirements-parser?logo=pypi&logoColor=white&label=PyPI "PyPI"
[shield_rtfd]: https://img.shields.io/readthedocs/requirements-parser?logo=readthedocs&logoColor=white "Read the Docs"
[shield_license]: https://img.shields.io/github/license/madpah/requirements-parser?logo=open%20source%20initiative&logoColor=white "license"

[link_gh-workflow-test]: https://github.com/madpah/requirements-parser/actions/workflows/poetry.yml?query=branch%3Amain
[link_pypi]: https://pypi.org/project/requirements-parser/
[link_rtfd]: https://requirements-parser.readthedocs.io/en/latest/


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/madpah/requirements-parser/#readme",
    "name": "requirements-parser",
    "maintainer": "Paul Horton",
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": "paul@hogr.dev",
    "keywords": "Pip, requirements, parse",
    "author": "Paul Horton",
    "author_email": "paul@hogr.dev",
    "download_url": "https://files.pythonhosted.org/packages/05/70/80ed53ebd21853855aad552d4ed6c4934df62cd32fe9a3669fcdef59429c/requirements_parser-0.11.0.tar.gz",
    "platform": null,
    "description": "# Requirements Parser\n\n[![shield_pypi-version]][link_pypi]\n[![shield_rtfd]][link_rtfd]\n[![shield_gh-workflow-test]][link_gh-workflow-test]\n[![shield_license]][license_file]\n\n---\n\nThis is a small Python module for parsing [Pip](http://www.pip-installer.org/) requirement files.\n\nThe goal is to parse everything in the [Pip requirement file format](https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format) spec.\n\n## Installation\n\n    pip install requirements-parser\n\nor\n\n    poetry add requirements-parser\n\n## Examples\n\n`requirements-parser` can parse a file-like object or a text string.\n\n``` {.python}\n>>> import requirements\n>>> with open('requirements.txt', 'r') as fd:\n...     for req in requirements.parse(fd):\n...         print(req.name, req.specs)\nDjango [('>=', '1.11'), ('<', '1.12')]\nsix [('==', '1.10.0')]\n```\n\nIt can handle most (if not all) of the options in requirement files that do not involve traversing the local filesystem. These include:\n\n-   editables (`-e git+https://github.com/toastdriven/pyelasticsearch.git]{.title-ref}`)\n-   version control URIs\n-   egg hashes and subdirectories (`[\\#egg=django-haystack&subdirectory=setup]{.title-ref}`)\n-   extras ([DocParser\\[PDF\\]]{.title-ref})\n-   URLs\n\n## Documentation\n\nView the documentation [here][link_rtfd].\n\n## Python Support\n\nWe endeavour to support all functionality for all [current actively supported Python versions](https://www.python.org/downloads/).\nHowever, some features may not be possible/present in older Python versions due to their lack of support.\n\n## Changelog\n\nSee our [CHANGELOG][chaneglog_file].\n\n## Contributing\n\nFeel free to open issues, bugreports or pull requests.  \nSee the [CONTRIBUTING][contributing_file] file for details.\n\n## Copyright & License\n\n`requirements-parser` was originally written by @davidfischer and is now maintained by @madpah. See [Authors][authors_file] for full details. \n\nPermission to modify and redistribute is granted under the terms of the Apache 2.0 license.\n\nSee the [LICENSE][license_file] file for the full license.\n\n[authors_file]: https://github.com/madpah/requirements-parser/blob/main/AUTHORS.md\n[license_file]: https://github.com/madpah/requirements-parser/blob/main/LICENSE\n[chaneglog_file]: https://github.com/madpah/requirements-parser/blob/main/CHANGELOG.md\n[contributing_file]: https://github.com/madpah/requirements-parser/blob/main/CONTRIBUTING.md\n\n[shield_gh-workflow-test]: https://img.shields.io/github/actions/workflow/status/madpah/requirements-parser/poetry.yml?branch=main&logo=GitHub&logoColor=white \"build\"\n[shield_pypi-version]: https://img.shields.io/pypi/v/requirements-parser?logo=pypi&logoColor=white&label=PyPI \"PyPI\"\n[shield_rtfd]: https://img.shields.io/readthedocs/requirements-parser?logo=readthedocs&logoColor=white \"Read the Docs\"\n[shield_license]: https://img.shields.io/github/license/madpah/requirements-parser?logo=open%20source%20initiative&logoColor=white \"license\"\n\n[link_gh-workflow-test]: https://github.com/madpah/requirements-parser/actions/workflows/poetry.yml?query=branch%3Amain\n[link_pypi]: https://pypi.org/project/requirements-parser/\n[link_rtfd]: https://requirements-parser.readthedocs.io/en/latest/\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "This is a small Python module for parsing Pip requirement files.",
    "version": "0.11.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/madpah/requirements-parser/issues",
        "Documentation": "https://requirements-parser.readthedocs.io/",
        "Homepage": "https://github.com/madpah/requirements-parser/#readme",
        "Repository": "https://github.com/madpah/requirements-parser"
    },
    "split_keywords": [
        "pip",
        " requirements",
        " parse"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8833190393a7d36872e237cbc99e6c44d9a078a1ba7b406462fe6eafd5a28e04",
                "md5": "ed1fa2c23e36c28d0a405263c11c6a64",
                "sha256": "50379eb50311834386c2568263ae5225d7b9d0867fb55cf4ecc93959de2c2684"
            },
            "downloads": -1,
            "filename": "requirements_parser-0.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ed1fa2c23e36c28d0a405263c11c6a64",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 14800,
            "upload_time": "2024-08-12T15:14:16",
            "upload_time_iso_8601": "2024-08-12T15:14:16.167991Z",
            "url": "https://files.pythonhosted.org/packages/88/33/190393a7d36872e237cbc99e6c44d9a078a1ba7b406462fe6eafd5a28e04/requirements_parser-0.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "057080ed53ebd21853855aad552d4ed6c4934df62cd32fe9a3669fcdef59429c",
                "md5": "ea33d88ff4ca38dfe91b986dd06eaecf",
                "sha256": "35f36dc969d14830bf459803da84f314dc3d17c802592e9e970f63d0359e5920"
            },
            "downloads": -1,
            "filename": "requirements_parser-0.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ea33d88ff4ca38dfe91b986dd06eaecf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 23663,
            "upload_time": "2024-08-12T15:14:17",
            "upload_time_iso_8601": "2024-08-12T15:14:17.234449Z",
            "url": "https://files.pythonhosted.org/packages/05/70/80ed53ebd21853855aad552d4ed6c4934df62cd32fe9a3669fcdef59429c/requirements_parser-0.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-12 15:14:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "madpah",
    "github_project": "requirements-parser",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "requirements-parser"
}
        
Elapsed time: 2.55233s