"Anyway, now the question is: is it possible to update the SQL-style values ββin the CSV database?"
Technically, this is possible. However, this can be difficult.
If PHP and Python are writing a file, you will need to use OS-level locking to ensure that they do not overwrite each other. Each part of your system will have to lock the file, rewrite it from scratch with all updates and unlock the file.
This means that PHP and Python must load the entire file into memory before overwriting it.
There are several ways to handle OS locks.
Use the same file and actually use some OS locking module. Both processes always open the file.
Write a temporary file and rename. This means that every program must open and read a file for each transaction. Very safe and reliable. A bit slow.
Or.
You can rebuild it so that only Python writes the file. The interface reads the file when it changes and discards small transaction files to create a work queue for Python. In this case, you do not have several authors - you have one reader and one writer, and life is much simpler.
source share