initial commit

This commit is contained in:
Matthew Welch 2020-04-02 17:41:09 -07:00
commit 6c33f35a24
3 changed files with 28 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
\.idea

14
main.py Normal file
View File

@ -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"]))

13
test.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{{ version }}
{{ summary }}
{{ home_page }}
{{ sha256 }}
</body>
</html>