Gadfly, the Pure Python Relational Database
We
now step away from Microsoft APIs altogether. Gadfly is an SQL
relational database written in Python by Aaron
Watters. It
can be found at
http://www.chordate.com, and is distributed
in a 200-KB Zip file, including documentation.
Gadfly gives Python programs relational database capabilities without relying on any external database engines. It offers the following features:
Compliance with the Python Database API
Total portability between platforms
A transaction log and recovery procedure
A built-in TCP/IP server mode, allowing it to serve clients on remote machines
Security policies to prevent accidental deletion of data
It’s not intended as a multiuser production system, and some features are missing at present, notably Null values and Date/Time variables.
Aaron previously produced both a parsing engine named
kwParsing
and a library of
data structures, including sets, directed graphs, and dictionaries,
called kjBuckets
. These C extensions
are part of the Gadfly package and can build an efficient and fast
in-memory SQL engine. If you are interested in either how to parse
SQL statements or in the low-level relational operations, Gadfly is a
great package to explore. To install and set up
Gadfly,
perform these steps:
Download the 217-KB Zip file.
Unzip to a directory on the Python path.
CD to the directory in a DOS prompt.
Type
pythongfinstall.py.Create a subdirectory for a test database with
MKDIR dbtest.Type
pythongftest.pydbtest. This ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access