Looking for the latest version? Download littletable-0.8.zip (107.3 kB)
Name Modified Size Downloads / Week Status
Totals: 6 Items   3.1 kB 1
littletable-0.9 2016-06-27 11 weekly downloads
littletable-0.8 2015-12-13 22 weekly downloads
littletable-0.7 2015-08-15 22 weekly downloads
littletable-0.4 2011-06-29 22 weekly downloads
littletable-0.3 2010-10-25 11 weekly downloads
README 2015-12-13 3.1 kB 11 weekly downloads
littletable - a Python module to give ORM-like access to a collection of objects The littletable module provides a low-overhead, schema-less, in-memory database access to a collection of user objects. littletable provides a DataObject class for ad hoc creation of semi-immutable objects that can be stored in a littletable Table. In addition to basic ORM-style insert/remove/query/delete access to the contents of a Table, littletable offers: • simple indexing for improved retrieval performance, and optional enforcing key uniqueness • access to objects using indexed attributes • simplified joins using '+' operator syntax between annotated Tables • the result of any query or join is a new first-class littletable Table littletable Tables do not require an upfront schema definition, but simply work off of the attributes in the stored values, and those referenced in any query parameters. Here is a simple littletable data storage/retrieval example: from littletable import Table, DataObject customers = Table('customers') customers.create_index("id", unique=True) customers.insert(DataObject(id="0010", name="George Jetson")) customers.insert(DataObject(id="0020", name="Wile E. Coyote")) customers.insert(DataObject(id="0030", name="Jonny Quest")) catalog = Table('catalog') catalog.create_index("sku", unique=True) catalog.insert(DataObject(sku="ANVIL-001", descr="1000lb anvil", unitofmeas="EA",unitprice=100)) catalog.insert(DataObject(sku="BRDSD-001", descr="Bird seed", unitofmeas="LB",unitprice=3)) catalog.insert(DataObject(sku="MAGNT-001", descr="Magnet", unitofmeas="EA",unitprice=8)) catalog.insert(DataObject(sku="MAGLS-001", descr="Magnifying glass", unitofmeas="EA",unitprice=12)) wishitems = Table('wishitems') wishitems.create_index("custid") wishitems.create_index("sku") wishitems.insert(DataObject(custid="0020", sku="ANVIL-001")) wishitems.insert(DataObject(custid="0020", sku="BRDSD-001")) wishitems.insert(DataObject(custid="0020", sku="MAGNT-001")) wishitems.insert(DataObject(custid="0030", sku="MAGNT-001")) wishitems.insert(DataObject(custid="0030", sku="MAGLS-001")) # print a particular customer name # (unique indexes will return a single item; non-unique # indexes will return a list of all matching items) print customers.id["0030"].name # print all items sold by the pound for item in catalog.query(unitofmeas="LB"): print item.sku, item.descr # print all items that cost more than 10 for item in catalog.where(lambda o : o.unitprice>10): print item.sku, item.descr, item.unitprice # join tables to create queryable wishlists collection wishlists = customers.join_on("id") + wishitems.join_on("custid") + catalog.join_on("sku") # print all wishlist items with price > 10 bigticketitems = wishlists().where(lambda ob : ob.unitprice > 10) for item in bigticketitems: print item # list all wishlist items in descending order by price for item in wishlists().sort("unitprice desc"): print item
Source: README, updated 2015-12-13

Thanks for helping keep SourceForge clean.

Screenshot instructions:
Red Hat Linux   Ubuntu

Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Briefly describe the problem (required):

Upload screenshot of ad (required):
Select a file, or drag & drop file here.

Please provide the ad click URL, if possible:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks