Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/technologiestiftung/innovationserhebung
Visualizing 10 years of data about innovation in Berlin and Germany
https://github.com/technologiestiftung/innovationserhebung
bokeh data-visualization fastapi panel python
Last synced: about 2 months ago
JSON representation
Visualizing 10 years of data about innovation in Berlin and Germany
- Host: GitHub
- URL: https://github.com/technologiestiftung/innovationserhebung
- Owner: technologiestiftung
- License: mit
- Created: 2023-08-03T11:40:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-18T21:07:58.000Z (about 2 months ago)
- Last Synced: 2024-11-18T22:23:55.532Z (about 2 months ago)
- Topics: bokeh, data-visualization, fastapi, panel, python
- Language: Python
- Homepage: https://innovationsdaten.ts.berlin/
- Size: 1.27 MB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[![Technologiestiftung Berlin](https://img.shields.io/badge/Built%20with%20%E2%9D%A4%EF%B8%8F-at%20Technologiestiftung%20Berlin-blue)](https://www.technologiestiftung-berlin.de)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/technologiestiftung/innovationserhebung/main.svg)](https://results.pre-commit.ci/latest/github/technologiestiftung/innovationserhebung/main)# Innovationsdaten
This informational long-read is a digital version of the study "Innovationserhebung" which is conducted by the [Technologiestiftung Berlin](https://www.technologiestiftung-berlin.de) in german language. The study takes a look into data about business innovation since 2012 and was released in a [print version](https://www.technologiestiftung-berlin.de/downloads/innovationserhebung-2022) since then.
The digital version now enhances the findings and data with interactive charts to enable viewers to find even more customised insights. The data of the study is based on the yearly published [Innovationserhebung](https://www.zew.de/publikationen/zew-gutachten-und-forschungsberichte/forschungsberichte/innovationen/innovationserhebung) by the ZEW - Zentrum für Europäische Wirtschaftsforschung.
## Installation guide
### Prerequisites
- Latest Python 3.11 version (i.e. 3.11.4, other versions might work as well) – You can e.g. use pyenv, see below.
- A Node version that’s defined in `.nvmrc` – You can e.g. use [nvm](https://github.com/nvm-sh/nvm) to switch to the right version (with `nvm use` or `nvm install`).### General setup
1. Create a `.env` file by copying the `.env.example` file and filling out the variables.
2. Install npm dependencies:
```shell
npm install
```
3. Run the `get-fonts` script to download the required font files (they will be placed in the `/app/static/fonts` directory):
```shell
npm run get-fonts
```### Set your virtual environment
The following steps are not required but recommended. This will allow you to install packages in your isolated virtual environment instead of globally, reducing the risk of breaking system tools or other projects.
1. Install [pyenv](https://github.com/pyenv/pyenv) and the [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) plugin.
2. Download the appropriate Python version with
```shell
pyenv install 3.11.4
```
in the command line.
3. Create a virtual environment with the appropriate Python version and name for your environment, for example
```shell
pyenv virtualenv 3.11.4 innovationserhebung
```
4. Activate the environment with
```shell
pyenv activate innovationserhebung
```### Install Python requirements and pre-commit
Install the required libraries with the command line
```shell
pip install -r requirements.txt -r requirements-dev.txt
```Install the pre-commit git hook
```shell
pre-commit install
```### Run the APP
1. Run the server with the command line
```shell
uvicorn app.main:app --reload
```
2. Your terminal should show something like:```
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```### Changing HTML & CSS
If you need to change HTML templates or CSS, you should use the Tailwind watcher to automatically recompile the CSS:
1. Move to the root directory
2. Start the tailwind watcher:
```shell
npm run dev:tailwind
```### Run server in development mode
1. After setting up the project according to the previous chapters, run
```shell
$ chmod +x run_dev.sh
```
from your root directory to give the bash file executable permission.2. Now you should be able to start a development server via
```shell
./run_dev.sh
```
This also runs the tailwind watcher### Convert the source XLSX data source to JSON
Taking an input XLSX file similar to the one in this repository, you can convert it to
JSON by running
```shell
python -m app.xlsx2json
```### Handling & updating requirements
We are using [pip-tools](https://pip-tools.readthedocs.io/en/latest/) to handle the
requirements and keep the dependencies updated.In case you are updating or adding some dependencies, do so in the `requirements.*.in`
files and don't forget to compile the new `requirements.*.txt` files running:
```shell
pip-compile requirements.in
pip-compile requirements-dev.in
```To update the packages, following the version pinning defined in the
`requirements*.in` files, run:
```shell
pip-compile --upgrade requirements.in
pip-compile --upgrade requirements-dev.in
```To keep your environment in sync, run:
```shell
pip-sync requirements.txt requirements-dev.txt
```## Deployment
To deploy the app, these commands should be run (in the root directory) to build the app:
```shell
pip install -r requirements.txt && npm install && npm run build
```Afterwards, the app can be started with these commands:
```shell
uvicorn app.main:app --host 0.0.0.0 --port $PORT
```These **environment variables** should be set:
| Variable | Value |
|----------------|--------------|
| FONTS_URL | |
| PORT | 8000 |
| PYTHON_VERSION | 3.11.4 |## Content Licencing
Texts and content available as [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0/).
## Credits