Python tooling to visualize the results of the participation polls for gigs of AkaBlas for the members as well as other interesting content. Uses
- the API of the NextCloud Polls App to get the poll results. The API is documented here.
- the API of the NextCloud Circles App to get the members of the circle. Information about the API can be found here. See also this GitHub thread.
- the API of the NextCloud Forms App to get the results of the forms. The API is documented here.
- the API of Wordpress to publish content to the AkaBlas homepage. The API is documented here.
- Jinja2 for templating the HTML output.
- pydanctic models for the data structures.
Make sure that you have installed Python 3.11+ as well as pip.
Clone the repository and change into the directory:
git clone https://github.com/AkaBlas/akalisten.git cd akalisten
Install the dependencies. It is recommended to use a virtual environment:
python -m venv venv source venv/bin/activate pip install -r requirements.txt
Copy the file
.env.exampleto.envand adjust the values to your needs:cp .env.example .env nano .env
Run the script:
python main.py
Open the file
output/index.htmlin your browser.
Make sure to follow the installation steps above.
In addition, please install the pre-commit hooks:
pip install pre-commit pre-commit install
This makes sure that some sanity checks are run before you commit your changes. You can also run the checks manually with:
pre-commit run -a
Now, for a quick overview of the project structure.
akalisten
│ crawl.py # contains the main logic to retrieve all the data from the APIs
│ jinja2.py # custom extensions for Jinja2
│
├───clients
│ # the clients to interact with the APIs
│
├───models
│ │ # pydantic models to represent the data structures retrieved from the APIs
│ │ # also contains higher-level abstractions/wrappers around the raw API models that
│ │ # are used in the Jinja2 templates
│ │
│ └───raw_api_models
│ # the pydantic models representing the raw API responses
│
└───template
# the files used to render the HTML output via Jinja2