davidfischer/requirements-parser — pull request #14 by davidfischer (2013-08-16 03:11:11+00:00)
Title: Big parser refactor

* broke the parser into a Requirement class
* refactored the unit test suite
* better handling of VCS

This is backwards incompatible in the sense that `parse` returns a generator of objects rather than `dicts`. However, the objects behave like dict-like objects. The parser is much more complete in my opinion as it handles more use cases from the revised spec. It should fix #10, #8, and #12 more or less.

I need to create more docs but here's some usage:

>>> from requirements import parse
>>> list(parse('https://github.com/django/django/tarball/stable/1.6.x'))[0].uri
'https://github.com/django/django/tarball/stable/1.6.x'
>>> list(parse('django==1.5.2'))[0].specs
[('==', '1.5.2')]
>>> list(parse('django==1.5.2'))[0].specifier
True
>>> list(parse('-e git://git.myproject.org/MyProject.git@v1.0#egg=MyProject'))[0].editable
True
>>> list(parse('-e git://git.myproject.org/MyProject.git@v1.0#egg=MyProject'))[0].revision
'v1.0'

I wouldn't mind a weigh-in by @treyhunner on this change.