A parser for Python dependency files
Project description
Dependency Parser
A parser for Python dependency files
Free software: MIT license
Documentation: https://dparse.readthedocs.io.
Supported Files
File |
parse |
update |
---|---|---|
requirements.txt |
yes |
yes |
conda.yml |
yes |
yes |
tox.ini |
yes |
yes |
Pipfile |
no (# 1) |
no (# 1) |
Pifile.lock |
no (# 1) |
no (# 1) |
setup.py |
no (# 2) |
no (# 2) |
zc.bildout |
no (# 3) |
no (# 3) |
Installation
To install dparse, run:
$ pip install dparse
Usage
To use dparse in a Python project:
from dparse import parse, 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": [] } ] }
History
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dparse-0.1.1.tar.gz
(20.2 kB
view hashes)
Built Distribution
dparse-0.1.1-py2-none-any.whl
(10.3 kB
view hashes)