Abstract
Extract and store data entries from a set of reStructuredText documents.
Table of Contents
Extract and store data entries from a set of reStructuredText documents.
rst-fields DATABASE FILE1 FILE2 ...
Entries look like this (all names are generic):
[book] :title: Probability Theory :subtitle: The Logic of Science :authors: E.T. Jaynes, G. Larry Bretthorst :isbn: 978-0521592710
You can have the data stored in an existing database, or in a file. This program can also automatically infer a database schema from the data (and create the tables). If you only store the data in a database, only the fields defined in the schema will be stored (the others will be dropped). This allows you to create your database tables ahead of time, as you like, and to have only valid fields filled with the data later.
This script provides an ultra-simple way to store data that can be expressed as name-value pairs embedded in a text file (with other text). The typical kind of data that you would use this for would be for PIM data (e.g., books, addresses, links, etc.).
A special source key is used in the outgoing data to identify the source file that each data entry came from. By default, the source is the filename, but you can set this source id in the file itself, by creating an 'Id' docinfo entry, at the top of the document, like this:
======== My Title ======== :Id: <unique-id> ...
About normalization:
By default the field names are sanitized by attempting to remove plurals automatically, and the value strings are merged into a single line each. This can be optionally disabled.
Notes:
The ideas for this project originate from project Nabu (http://furius.ca/nabu/). It is an attempt at providing its basic functionality without all the complications, setup and customization that Nabu requires.
Important
This computer program or library is provided for free. I am aware that some of the programs that I provide for free allow people to get their work done faster or better, save them time and money. If you are using this program for benefit, especially if you are using it within a commercial environment and it saves you time or work, please consider making a donation by sending me a book from my Amazon Wishlist or by a direct donation to my company's PayPal account by clicking on the link below.