Featured Posts

Featured Image

Running Multiple Celery Beat Instances in One Python Project

 Feb. 1, 2021    0 comments 

In Python world Celery is a popular tool for running background tasks. It includes Celery beat that allows to run periodic tasks on some schedule. At my current work I participated in developing a system for running multiple periodic tasks. Since our technology stack is based on Python, Celery beat was a natural choice. One of the requirements to the system was granular control over individual tasks, that is, the ability to start/stop/restart each task individually. The straightforward solution was to run multiple Celery beat/worker pairs for each task, but after some googling it turned out that running multiple Celery beat instances seemed to be impossible. At least everybody said so, e.g. check this Stack Overflow discussion. If you try to do so you'll get duplicate tasks in your workers because each beat sends tasks to each worker. (...)

Read post

 CeleryPython

Featured Image

Setting Up MySQL in LibreELEC on Raspberry Pi

 Nov. 17, 2017    0 comments 

Updated on 2020-06-13

Kodi mediacenter can maintain a common medialibrary on MySQL/MariaDB database server. This way a media library, including "watched" and "in progress" marks, can be synchronized between several Kodi instances. The official Kodi Wiki provides instructions on how to set up MySQL server on various platforms, however those instructions do not include LibreELEC — a popular mediacenter software based on Kodi that runs on various platforms, including different versions of Raspberry Pi single-board computers. (...)

Read post

 DockerKodiMariaDBMySQLRaspberry Pi

Featured Image

Autodocumenting your Python code with Sphinx - part 2

 Feb. 24, 2016    0 comments 

This is Part 2 of my Sphinx autodocumentation tutorial. Part 1 of this tutorial you can find by the following link:

Autodocumenting your Python code with Sphinx - part 1

As I've mentioned in Part 1, Sphinx as an automatic documentation generator for Python is neither convenient nor simple. But it is de facto the tool for documenting Python programs and libraries, so unfortunately we have to deal with its weaknesses.

In Part 1 I've demonstrated you how to write Sphinx-compatible docstrings for your Python objects, and now I'll show you how to set-up a Sphinx project to generate documentation from your code docstrings. (...)

Read post

 Python

Featured Image

Autodocumenting your Python code with Sphinx - part 1

 Jan. 12, 2016    0 comments 

There are a number of Python auto-documenting tools in existence, starting with Python's built-in pydoc module. Some time ago Epydoc was a popular tool for auto-generating documentation from Python docstrings but its development was abandoned and it does not support current Python releases, though some popular Python IDEs, like PyDev for Eclipse or PyCharm still support Epytext markup language.

Now Sphinx has become de facto the standard tool for creating documentation for Python programs and libraries, and even the docs for Python itself are created with Sphinx. Docs for third-party Python libraries hosted on Read the Docs, a popular documentation hosting site, are also generated by Sphinx. (...)

Read post

 Python