-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from pythonhealthdatascience/dev
LICENSE page
- Loading branch information
Showing
5 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import streamlit as st | ||
import urllib.request as request | ||
|
||
LICENSE_FILE = ( | ||
"https://raw.githubusercontent.com/pythonhealthdatascience/" | ||
+ "stars-streamlit-example/dev/LICENSE" | ||
) | ||
|
||
LICENSE_PAGE_TXT = ( | ||
"https://raw.githubusercontent.com/pythonhealthdatascience/" | ||
+ "stars-streamlit-example/dev/txt/license_page.md" | ||
) | ||
|
||
|
||
def read_file_contents(path): | ||
""" | ||
Download the content of a file from the GitHub Repo and return as a utf-8 string | ||
Notes: | ||
------- | ||
adapted from 'https://github.com/streamlit/demo-self-driving' | ||
Parameters: | ||
---------- | ||
path: str | ||
e.g. file_name.md | ||
Returns: | ||
-------- | ||
utf-8 str | ||
""" | ||
response = request.urlopen(path) | ||
return response.read().decode("utf-8") | ||
|
||
# show license header and badge | ||
#st.markdown(read_file_contents(LICENSE_PAGE_TXT)) | ||
st.markdown("# License") | ||
|
||
# show MIT license. | ||
license_txt = read_file_contents(LICENSE_FILE) | ||
st.code(license_txt, language="markdown", line_numbers=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License | ||
|
||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) |