Skip to content

requirements/rparse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rparse Build Status

Python requirements.txt parser.

Installation

$ pip install rparse

Usage

import rparse


requirements = """
flask == 0.10.1
pip >= 6.0.0, < 6.0.7
"""

for requirement in rparse.parse(requirements):
    print(requirement.name, requirement.specs)

Output will be looks like this:

("flask", [("==", "0.10.1")])
("pip", [(">=", "6.0.0"), ("<", "6.0.7")])

rparse also have simple command line interface that can be used like this:

$ cat requirements.txt
flask==0.10.1
raven[flask]>=1.0

$ rparse.py requirements.txt
Package: flask
Version Specifier: [('==', '0.10.1')]
Extras: None
Comment: None
----------------------------------------------------------------
Package: raven
Version Specifier: [('>=', '1.0')]
Extras: ['flask']
Comment: None
----------------------------------------------------------------

About

Python requirements.txt parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages