module datainc.croix_rouge
#
Short summary#
module ensae_projects.datainc.croix_rouge
Data related to La Croix-Rouge (Hackathon Microsoft / ENSAE / Croix-Rouge / 2015)
Functions#
function |
truncated documentation |
---|---|
Reads an encrypted dataframe. |
|
Writes a table into RST or HTML format. |
|
Encrypts a file with a specific password. |
|
Retrieves data related to the meaning of a table. |
|
Gets the password from keyring first, then from the environment variables. … |
|
Merges schemas of various databases. |
Documentation#
Data related to La Croix-Rouge (Hackathon Microsoft / ENSAE / Croix-Rouge / 2015)
- ensae_projects.datainc.croix_rouge.decrypt_dataframe(infile, password=None, sep='\t', encoding='utf8', **kwargs)#
Reads an encrypted dataframe.
- Parameters:
infile – filename
password – password
sep – separator
encoding – encoding
kwargs – others options for pandas.read_csv
- Returns:
dataframe
- ensae_projects.datainc.croix_rouge.df2rsthtml(df, format='html', fillna='')#
Writes a table into RST or HTML format.
- Parameters:
df – dataframe
format – format
fillna – fill empty values
- Returns:
string
- ensae_projects.datainc.croix_rouge.encrypt_file(infile, outfile, password=None)#
Encrypts a file with a specific password.
- Parameters:
password – password for the hackathon, if None, look into
os.environ["PWDCROIXROUGE"]
infile – input file
outfile – output file
- Returns:
outfile
- ensae_projects.datainc.croix_rouge.get_meaning(table='invoice', password=None)#
Retrieves data related to the meaning of a table.
- Parameters:
table – SINVOICE or SINVOICE_V, ITTMASTER or stojou
password – password, see
get_password_from_keyring_or_env
- Returns:
DataFrame
- ensae_projects.datainc.croix_rouge.get_password_from_keyring_or_env(pwd)#
Gets the password from keyring first, then from the environment variables.
- Parameters:
pwd –
password to use or None to get it as
os.environ["PWDCROIXROUGE"]
or from keyring.- Returns:
password
To set the password for keyring:
from pyquickhelper.loghelper import set_password set_password("HACKATHON2015", "PWDCROIXROUGE", "value")
- ensae_projects.datainc.croix_rouge.merge_schema(tables=None, password=None)#
Merges schemas of various databases.
- Parameters:
tables – list of tables or None for all
password – password
- Returns:
dataframe with all columns