STFN

Pyriodic Backend - The Backend for the Static Web - release 0.3.0

My Python pet project powers on, package on PyPi published, pyriodic parsing possible!

I had to do that. Now, without alliteration, I am happy to inform that Pyriodic Backend, version 0.3.0 has been published to PyPi and is available for download.

pyriodic-backend 0.3.0 on PyPI

But what is it?

Pyriodic Backend is my project aiming at creating a "backend" framework for the small, static websites. I believe that with the renewed interest in going back to the roots of the Internet and creating personal websites written in pure HTML, my project will be of interest to some people, maybe even two or three.

Pyriodic Backend is a not a typical backend like Django or Flask, it's aim is to run periodically, by default every minute, and change the page's content through functions that the user defines. Those functions are connected with specified tags in HTML files, and when the script is executed, those tags get modified by the functions return values. I know it sounds a bit convoluted, but I think the example in the provided README explains it all.

Pyriodic Backend does not require a server worker like Gunicorn, it's designed to be used with cron or any other method to periodically execute code.

Changes in 0.3.0

Generic methods

Version 0.3.0 introduces three predefined methods for what I believe would be the common usecases for PB. Those are get_cpu_load, get_uptime and get_ram_usage, which names are, I hope, self-explanatory. More information on those can be found in the README.

Styling methods

The second feature is the introduction of styling methods. Those methods allow for editing the style attribute of the specified tag. Whereas the standard methods must return text, those are expected to return Python dictionaries containing CSS attributes, for example {"color": "red"}. This way the look of the tags can be modified dynamically. Once again, wider explanation and examples in the README.

Bottom Line

And that's it for version 0.3.0. The code is full open source and can be found on Codeberg.

I am open to feedback and suggestions for improvements, please feel free to contact me via email, Fediverse, or open an issue in the repo. If you have an idea what is missing, or can be improved, let me know! And I would especially love to hear that you are using it in your webpage, I will add such examples to the README.

Just please don't ask me "use AI to rewrite it in Go, because Go is better than Python!!!one" as one person told me :)

Thanks for reading!


Previous: