Package: ffdb
ffdb.py - Flat-File DB: nosql single file database and document storageThe moduleffdband the associated set of utility scripts
(indexer,extractor,filestorer,removerandmerger)
allow the creation, maintenance and usage of a database and document storage
which employs a single file acting as a container for all the data.This file can be distributed in several copies, made locally available or placed online
to be accessed remotely (e.g. over ftp or www).The resulting database is hence accessible everywhere, without the need for any complex
installation and in particular without requiring any service to be running continuously.Simple 1-2-3 procedure:Index your flat-file and/or choose documents to storePlace the resulting file wherever you want (locally or online, e.g. ftp or www)Retrieve the entries or the documents from any device and locationFFDBcan index entries according to any pattern, creating index of identifiers unique to each entry or shared across many. For a biological database this could mean for example to allow retrieval of all entries belonging to a certain species.When requesting entries, the user can specify whether retrieving all the entries corresponding to the given identifier, or only the first or only the last one. This allows the possibility of storing a version history of the entries, continuously appending new entry versions to the file.When indexing entries of a flat-file or storing documents inside the database,
the user can optionally specify to encrypt (AES) or compress (ZLIB) the entries/files.Encrypted entries share a single master password but each has a unique IV (Initialization vector). No plaintext information is sent or received, thus allowing secure access to encrypted entries of the database over insecure channels.With an external utility (gztool), the
container file can even be compressed as a whole, while still allowing retrieval of
single entries. This can be useful when said file needs to also be
distributed and employed in its entirety, without limiting its use only viaffdb.If the container file is compressed withbgzip,
then no external utility is needed.DocumentationGitHub pageDownload and installationffdbis pure python code. It has no platform-specific dependencies and should thus work on all platforms. It requires the packagesrequestspycryptodomexandsortedcontainers.
The latest version offfdbcan be installed by typing either:pip3install-Uffdb(fromPython Package Index)or:pip3installgit+git://github.com/g-insana/ffdb.py.git(fromGitHub).The utility scripts should get installed for you by pip (if installed as --user you
may need to add e.g. ~/.local/bin/ to your $PATH).
Alternatively, you can directly download those you need:curl-LOhttps://github.com/g-insana/ffdb.py/raw/master/scripts/indexer.py
curl-LOhttps://github.com/g-insana/ffdb.py/raw/master/scripts/extractor.py
curl-LOhttps://github.com/g-insana/ffdb.py/raw/master/scripts/remover.py
curl-LOhttps://github.com/g-insana/ffdb.py/raw/master/scripts/merger.pyQuickstart: some examples#index a flat-file:$indexer.py-i'^name: (.+)$''email: (.+)$'-faddressbook>addressbook.idx

$indexer.py-i'^AC   (.+?);'-funiprot.dat-e'^//$'>uniprot.pac#store all the files contained in a directory:$filestorer.py-fmyphotos.db-diceland_photos/#add some more files$filestorer.py-fmyphotos.db-ssunset.jpgicecream.jpg#extract a series of entries from the db$extractor.py-funiprot.dat-iuniprot.pac-lsars_proteins#extract an entry from remote location$extractor.py-fhttp://remote.host/addressbook-iaddressbook.idx-sjohn@abc.de#extract a file from the db$extractor.py-fmyphotos.db-ssunset.jpg>sunset.jpg#merge two indexed flat-files$merger.py-fmydb-imydb.idx-enewentries-nnewentries.idx-d#(mydb will incorporate newentries)#remove a series of entries from the db$remover.py-faddressbook-iaddressbook.idx-ldisagreed_with_me.listCopyrightffdbis licensed under theGNU Affero General Public License.(c) CopyrightGiuseppe Insana, 2020-