Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Dan Sommers Newsgroups: comp.lang.python Subject: Re: Most Pythonic way to store (small) configuration Date: Mon, 3 Aug 2015 04:02:54 +0000 (UTC) Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <87k2teq9tb.fsf@Equus.decebal.nl> <85k2tdlxbg.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 3 Aug 2015 04:02:54 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="7afa85ad1f051434641aa58aa18198d3"; logging-data="7878"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/g0hkM6m1TVftgNr4k66lRlceOOWutqxk=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:4O/IidZqahixN//VQp6LflzYqIE= Xref: csiph.com comp.lang.python:94916 On Sun, 02 Aug 2015 16:11:14 -0500, Tim Chase wrote: > On 2015-08-02 21:54, Ben Finney wrote: >> So, both XML and JSON should be considered write-only, and produced >> only for consumption by a computer; they are a poor choice for >> presenting to a human. [snip] > I second Ben's thoughts against XML & JSON -- they *can* be edited by > hand, but put the onus on the user to make perfect XML/JSON. Config > files (".ini") are more forgiving. [snip] > An additional option is using a sqlite database. The sqlite library > is part of the stdlib, and advantages include being a single file, > expandability, consistent/reliable character encoding, cross-platform > portability, and atomicity (utilities that read/write are blocked from > getting/creating incomplete data seen by the other file). Well, I have at least some non-zero chance of reading and writing JSON or XML by hand. Can the same be said for a sqlite database? ;-)