cenpy.set_sitekey

cenpy.set_sitekey(sitekey, overwrite=False)[source]

Save the sitekey so that users can access it via cenpy.SITEKEY. This lets users bind an API key to a given installation.

Parameters
sitekeystr

str containing the census data api key the user wants to bind

overwritebool

flag denoting whether to overwrite existing sitekey. Defaults to False.

Returns
path to the location of the sitekey file or raises FileError if overwriting is prohibited and the file exists.