Created
January 12, 2017 19:34
-
-
Save bt0DotNinja/c235a39152c0ef7606fa63132c42ae3b to your computer and use it in GitHub Desktop.
a table generator from candidates CSV
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
#!/usr/bin/env python | |
# Alberto Rodriguez Sanchez (bt0dotninja@fedoraproject.org) | |
import sys | |
import pandas as pd | |
if __name__ == '__main__': | |
assert len(sys.argv) == 3 , "Usage: python tables.py CSVfile OutputHtmlFile" | |
df = pd.read_csv(sys.argv[1]) | |
pd.set_option('max_colwidth', 100000) # quick and dirty fix | |
df["Interview"]=df["Interview"].apply(lambda x: '<a href="{0}">Yes</a>'.format(x) if x != 'No' else x) | |
df["Wiki Page"]=df["Wiki Page"].apply(lambda x: '<a href="{0}">Here</a>'.format(x)) | |
df.to_html(sys.argv[2], escape=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment