• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

dparse/H26-Apr-2020-814624

dparse.egg-info/H03-May-2022-229173

tests/H26-Apr-2020-940696

CONTRIBUTING.rstH A D26-Apr-20203 KiB11272

HISTORY.rstH A D26-Apr-20201.4 KiB6341

LICENSEH A D26-Apr-20201 KiB125

MANIFEST.inH A D26-Apr-2020199 118

PKG-INFOH A D26-Apr-20207.5 KiB229173

README.rstH A D26-Apr-20203.8 KiB143111

setup.cfgH A D26-Apr-202038 53

setup.pyH A D26-Apr-20201.3 KiB5041

README.rst

1=================
2Dependency Parser
3=================
4
5
6.. image:: https://img.shields.io/pypi/v/dparse.svg
7        :target: https://pypi.python.org/pypi/dparse
8
9.. image:: https://img.shields.io/travis/pyupio/dparse.svg
10        :target: https://travis-ci.org/pyupio/dparse
11
12.. image:: https://codecov.io/gh/pyupio/dparse/branch/master/graph/badge.svg
13  :target: https://codecov.io/gh/pyupio/dparse
14
15
16A parser for Python dependency files
17
18
19Supported Files
20---------------
21
22+------------------+------------+-----------+
23| File             | parse      | update    |
24+==================+============+===========+
25| requirements.txt | yes        | yes       |
26+------------------+------------+-----------+
27| conda.yml        | yes        | yes       |
28+------------------+------------+-----------+
29| tox.ini          | yes        | yes       |
30+------------------+------------+-----------+
31| Pipfile          | yes        | yes       |
32+------------------+------------+-----------+
33| Pipfile.lock     | yes        | yes       |
34+------------------+------------+-----------+
35| setup.py         | no (# 2_)  | no (# 2_) |
36+------------------+------------+-----------+
37| zc.buildout      | no (# 3_)  | no (# 3_) |
38+------------------+------------+-----------+
39| setup.cfg        | no (# 4_)  | no (# 4_) |
40+------------------+------------+-----------+
41
42.. _2: https://github.com/pyupio/dparse/issues/2
43.. _3: https://github.com/pyupio/dparse/issues/3
44.. _4: https://github.com/pyupio/dparse/issues/8
45
46************
47Installation
48************
49
50To install dparse, run:
51
52.. code-block:: console
53
54    $ pip install dparse
55
56If you want to update Pipfiles, install the pipenv extra:
57
58.. code-block:: console
59
60    $ pip install dparse[pipenv]
61
62*****
63Usage
64*****
65
66To use dparse in a Python project::
67
68    from dparse import parse, filetypes
69
70    content = """
71    South==1.0.1 --hash=sha256:abcdefghijklmno
72    pycrypto>=2.6
73    """
74
75    df = parse(content, file_type=filetypes.requirements_txt)
76
77    print(df.json())
78
79
80
81
82    {
83      "file_type": "requirements.txt",
84      "content": "\nSouth==1.0.1 --hash=sha256:abcdefghijklmno\npycrypto>=2.6\n",
85      "path": null,
86      "sha": null,
87      "dependencies": [
88        {
89          "name": "South",
90          "specs": [
91            [
92              "==",
93              "1.0.1"
94            ]
95          ],
96          "line": "South==1.0.1 --hash=sha256:abcdefghijklmno",
97          "source": "pypi",
98          "meta": {},
99          "line_numbers": null,
100          "index_server": null,
101          "hashes": [
102            "--hash=sha256:abcdefghijklmno"
103          ],
104          "dependency_type": "requirements.txt",
105          "extras": []
106        },
107        {
108          "name": "pycrypto",
109          "specs": [
110            [
111              ">=",
112              "2.6"
113            ]
114          ],
115          "line": "pycrypto>=2.6",
116          "source": "pypi",
117          "meta": {},
118          "line_numbers": null,
119          "index_server": null,
120          "hashes": [],
121          "dependency_type": "requirements.txt",
122          "extras": []
123        }
124      ]
125    }
126
127**********
128Python 2.7
129**********
130
131This tool requires latest Python patch versions starting with version 3.5. We
132did support Python 2.7 in the past but, as for other Python 3.x minor versions,
133it reached its End-Of-Life and as such we are not able to support it anymore.
134
135We understand you might still have Python 2.7 projects running. At the same
136time, Safety itself has a commitment to encourage developers to keep their
137software up-to-date, and it would not make sense for us to work with officially
138unsupported Python versions, or even those that reached their end of life.
139
140If you still need to use Safety with Python 2.7, please use version 0.4.1 of
141Dparse available at PyPi. Alternatively, you can run Safety from a Python 3
142environment to check the requirements file for your Python 2.7 project.
143