Metadata-Version: 2.4
Name: dparse2
Version: 0.7.0
Summary: A parser for Python dependency files
Home-page: https://github.com/aboutcode-org/dparse2
Author: originally from Jannis Gebauer, maintained by AboutCode.org
Author-email: info@nexb.com
License: MIT
Keywords: dparse pypi dependencies tox conda pipfile setup.cfg
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: README.rst
License-File: CHANGELOG.rst
License-File: CONTRIBUTING.rst
Requires-Dist: packvers
Requires-Dist: pyyaml
Provides-Extra: pipenv
Requires-Dist: pipenv; extra == "pipenv"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

=================
Dependency Parser
=================


A parser for Python manifests and dependency files now at
https://github.com/aboutcode-org/dparse2

Originally at https://github.com/pyupio/dparse

This is a maintained fork by some of the contributors since upstream stopped
updating this.


Supported Files
---------------

+------------------+------------+
| File             | parse      |
+==================+============+
| conda.yml        | yes        |
+------------------+------------+
| tox.ini          | yes        |
+------------------+------------+
| Pipfile          | yes        |
+------------------+------------+
| Pipfile.lock     | yes        |
+------------------+------------+

************
Installation
************

To install dparse2, run:

.. code-block:: console

    $ pip install dparse2

If you want to update Pipfiles, install the pipenv extra:

.. code-block:: console

    $ pip install dparse2[pipenv]

*****
Usage
*****

To use dparse2 in a Python project::

    from dparse2 import parse
    from dparse2 import filetypes

    content = """
    South==1.0.1 --hash=sha256:abcdefghijklmno
    pycrypto>=2.6
    """

    df = parse(content, file_type=filetypes.requirements_txt)

    print(df.json())


    {
      "file_type": "requirements.txt",
      "content": "\nSouth==1.0.1 --hash=sha256:abcdefghijklmno\npycrypto>=2.6\n",
      "path": null,
      "sha": null,
      "dependencies": [
        {
          "name": "South",
          "specs": [
            [
              "==",
              "1.0.1"
            ]
          ],
          "line": "South==1.0.1 --hash=sha256:abcdefghijklmno",
          "source": "pypi",
          "meta": {},
          "line_numbers": null,
          "index_server": null,
          "hashes": [
            "--hash=sha256:abcdefghijklmno"
          ],
          "dependency_type": "requirements.txt",
          "extras": []
        },
        {
          "name": "pycrypto",
          "specs": [
            [
              ">=",
              "2.6"
            ]
          ],
          "line": "pycrypto>=2.6",
          "source": "pypi",
          "meta": {},
          "line_numbers": null,
          "index_server": null,
          "hashes": [],
          "dependency_type": "requirements.txt",
          "extras": []
        }
      ]
    }



This tool supports Python 3.6 and up. Older version support older Python versions


==========
Changelog
==========

0.7.0
-------

* Use packvers instead of packaging



0.6.1 
-------

* Use non-deprecated ConfigParser method


0.6.0 
-------

* Fork from upstream dparse that is unresponsive
* Rename package to dparse2
* Fix security issue for GHSL-2021-111https://github.com/pyupio/dparse/issues/50
* Drop support for Python < 3.6 and add support for up to 3.10
* Drop support for updating requirements files
* format code with black, sort imports


0.5.1 (2020-04-26)
------------------

* Fixed package metadata removing 2.7 support
* Install pipenv only when asked for with extras

0.5.0 (2020-03-14)
------------------

A bug with this package allows it to be installed on Python 2.7 environments,
even though it should not work on such version. You should stick with version
0.4.1 version instead for Python 2.7 support.

* Dropped Python 2.7, 3.3, 3.4 support
* Removed six package
* Removed pinned dependencies of tests
* Dropped setup.py tests support in favor of tox

0.4.1 (2018-04-06)
------------------

* Fixed a packaging error.

0.4.0 (2018-04-06)
------------------

* pipenv is now an optional dependency that's only used when updating a Pipfile. Install it with dparse[pipenv]
* Added support for invalid toml Pipfiles (thanks @pombredanne)


0.3.0 (2018-03-01)
------------------

* Added support for setup.cfg files (thanks @kexepal)
* Dependencies from Pipfiles now include the section (thanks @paulortman)
* Multiline requirements are now ignored if they are marked
* Added experimental support for Pipfiles

0.2.1 (2017-07-19)
------------------

* Internal refactoring

0.2.0 (2017-07-19)
------------------

* Removed setuptools dependency


0.1.1 (2017-07-14)
------------------

* Fixed a bug that was causing the parser to throw errors on invalid requirements.

0.1.0 (2017-07-11)
------------------

* Initial, not much to see here.
