How/where to store calibration values - written by program A, read by program B

Mats Wichmann mats at wichmann.us
Tue Dec 5 15:30:53 EST 2023


On 12/5/23 07:37, Chris Green via Python-list wrote:
> Is there a neat, pythonic way to store values which are 'sometimes'
> changed?
> 
> My particular case at the moment is calibration values for ADC inputs
> which are set by running a calibration program and used by lots of
> programs which display the values or do calculations with them.
> 
>  From the program readability point of view it would be good to have a
> Python module with the values in it but using a Python program to
> write/update a Python module sounds a bit odd somehow.
> 
> I could simply write the values to a file (or a database) and I
> suspect that this may be the best answer but it does make retrieving
> the values different from getting all other (nearly) constant values.
> 
> Are there any Python modules aimed specifically at this sort of
> requirement?

A search term to look for is "data persistence"

there is lots of support at various levels - you can do simpler things 
with plain text (or binary), json data, or csv data, or configparser, or 
use pickles; if there's not a lot of values a dbapi database may, as 
already mentioned, be overkill.



More information about the Python-list mailing list