@@ -8,7 +8,7 @@ Dependency Parser
88
99.. image :: https://img.shields.io/travis/pyupio/dparse.svg
1010 :target: https://travis-ci.org/pyupio/dparse
11-
11+
1212.. image :: https://codecov.io/gh/pyupio/dparse/branch/master/graph/badge.svg
1313 :target: https://codecov.io/gh/pyupio/dparse
1414
@@ -61,7 +61,7 @@ To install dparse, run:
6161
6262.. code-block :: console
6363
64- $ pip install -e git+https://github.com/pyupio/ dparse.git
64+ $ pip install dparse
6565
6666*****
6767Usage
@@ -72,18 +72,58 @@ To use dparse in a Python project::
7272 from dparse import parse, filetypes
7373
7474 content = """
75- -e common/lib/calc
76- South==1.0.1 --hash==abcdefghijklmno
75+ South==1.0.1 --hash=sha256:abcdefghijklmno
7776 pycrypto>=2.6
78- git+https://github.com/pmitros/pyfs.git@96e1922348bfe6d99201b9512a9ed946c87b7e0b
79- distribute>=0.6.28, <0.7
80- # bogus comment
81- -e .
82- pdfminer==20140328
83- -r production/requirements.txt
84- --requirement test.txt
8577 """
8678
87- df = parse(content, filetype =filetypes.requirements_txt)
79+ df = parse(content, file_type =filetypes.requirements_txt)
8880
8981 print(df.json())
82+
83+
84+
85+
86+ {
87+ "file_type": "requirements.txt",
88+ "content": "\nSouth==1.0.1 --hash=sha256:abcdefghijklmno\npycrypto>=2.6\n",
89+ "path": null,
90+ "sha": null,
91+ "dependencies": [
92+ {
93+ "name": "South",
94+ "specs": [
95+ [
96+ "==",
97+ "1.0.1"
98+ ]
99+ ],
100+ "line": "South==1.0.1 --hash=sha256:abcdefghijklmno",
101+ "source": "pypi",
102+ "meta": {},
103+ "line_numbers": null,
104+ "index_server": null,
105+ "hashes": [
106+ "--hash=sha256:abcdefghijklmno"
107+ ],
108+ "dependency_type": "requirements.txt",
109+ "extras": []
110+ },
111+ {
112+ "name": "pycrypto",
113+ "specs": [
114+ [
115+ ">=",
116+ "2.6"
117+ ]
118+ ],
119+ "line": "pycrypto>=2.6",
120+ "source": "pypi",
121+ "meta": {},
122+ "line_numbers": null,
123+ "index_server": null,
124+ "hashes": [],
125+ "dependency_type": "requirements.txt",
126+ "extras": []
127+ }
128+ ]
129+ }
0 commit comments