commit 6c33f35a24321f54d69822104e0a1431f75655db Author: Matthew Welch Date: Thu Apr 2 17:41:09 2020 -0700 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..112cc69 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +\.idea diff --git a/main.py b/main.py new file mode 100644 index 0000000..b1e4e7b --- /dev/null +++ b/main.py @@ -0,0 +1,14 @@ +import requests +from jinja2 import Template + + +def package(package_name, template): + url = 'https://pypi.org/pypi/{}/json'.format(package_name) + info = dict(requests.get(url).json()) + test_template = Template(open(template).read()) + + print(test_template.render( + version=info["info"]["version"], + summary=info["info"]["summary"], + home_page=info["info"]["home_page"], + sha256=info["releases"][info["info"]["version"]][0]["digests"]["sha256"])) diff --git a/test.html b/test.html new file mode 100644 index 0000000..241b67c --- /dev/null +++ b/test.html @@ -0,0 +1,13 @@ + + + + + Title + + +{{ version }} +{{ summary }} +{{ home_page }} +{{ sha256 }} + + \ No newline at end of file