argument-clinic

Supplies arguments as desired.

Usage


In [1]:
from argumentclinic.argumentclinic import argue

print(argue("This is a great package."))


No it isn't.

Software requirements


In [2]:
%run get_reqs.py


sqlalchemy>=0.9: satisfied by SQLAlchemy 0.9.2
psycopg2: not installed
BeautifulSoup4>4.1: not installed

You should also install PostgreSQL 9.1 or better.


In [3]:
!psql --version


psql (PostgreSQL) 9.2.5

In [4]:
%load get_reqs.py

In [5]:
import os.path
from pip.req import parse_requirements
import argumentclinic

req_file_path = '../../requirements.txt'
# This worked independent of dexy, and not within dexy,
# actual directory for execution was /home/catherine/proj/argument-clinic/argumentclinic/docs/dexy/.dexy/work/85/853c355a6eed8b5fab5bbf05c0d3dd8f-001-py

req_file_path = os.path.abspath(os.path.join(argumentclinic.__file__, '../../requirements.txt'))
reqs = list(parse_requirements(req_file_path))

def requirements_met():
    result = []
    for req in reqs:
        if req.check_if_exists():
            result.append("%s: satisfied by %s" % 
                           (str(req.req), req.satisfied_by))
        else:
            result.append("%s: not installed" % 
                           (str(req.req), ))
    return result

if __name__ == '__main__':
    result = requirements_met()
    print("\n".join(result))


sqlalchemy>=0.9: satisfied by SQLAlchemy 0.9.2
psycopg2: not installed
BeautifulSoup4>4.1: not installed

In [33]:
import markdown
class MD(str):
    def _repr_html_(self):
        return markdown.markdown(self)

In [36]:
MD('Python **rocks**')


Out[36]:

Python rocks


In [47]:
from get_reqs import requirements_met

md_reqs = [MD(r.replace('not installed', '**not installed**')) for r in requirements_met()]

In [49]:
md_reqs[1]


Out[49]:

psycopg2: not installed