pystatis
pystatis
is a Python wrapper for the different GENESIS web service interfaces (API). Currently we are supporting the following databases:
The main features are:
Simplified access to all supported API. No more need to write cumbersome API calls or switch between databases.
Credential management removes the need to manually add credentials. We handle all your credentials for you.
Database management handles different databases and lets you switch easily between them.
Integrated workflow enables an end-to-end process from finding the relevant data to downloading it.
Pandas support instead of manually parsing results.
Caching to enable productive work despite strict query limits.
Starting and handling background jobs for datasets that are too big to be downloaded directly from GENESIS.
To learn more about GENESIS, please refer to the official documentation here.
The full documentation of the main and dev branches are hosted via GitHub Pages (main) and GitHub Pages (dev).
Zensus 2022 update
The new Zensus has finally arrived and been published. However, old credentials are no longer valid and the base url has changed, too. If you have worked with pystatis
and Zensus database before, you need to update your config. You can do so in two ways:
Create a new config:
Delete your current user config manually or via
pystatis.config.delete_config()
.Restart your Python session and import
pystatis
again, this will create a new default config.Set up your credentials via
pystatis.setup_credentials()
.
Update your config:
It is not enough to just change your credentials, you also have to change the base_url.
That is why you have to manually open the current
config.ini
and change both username and password as well as the base_url for the Zensus database.
You can test your changes by calling pystatis.logincheck("zensus")
.
API Token
Zensus database now also supports authentication with an API token instead of the classic username and password.
You can get your token from the Webservice interface info page when being logged in.
You can use the token instead of your username, and leave the password blank. There is no extra field or parameter for the token, so you have to pass it as your username. That means pystatis
is already supporting it, you can just put it as your username and leave the password blank.