blocked-table 1.1
Efficient on-disk sorted table format.
blocked-table
This package provides an efficient, 2-level indexed table in pure Python. The index structure allows for billions of keys to be added while retaining low memory usage.
Tables are expected to contain string keys; values are encoded using the 'json' package and optionally compressed using gzip or snappy compression.
usage
Building a table:
import blocked_table
tb = blocked_table.TableBuilder('/tmp/mytable')
for i in range(1000000):
tb.add(str(i), 'Value %d' % i)
del tb
Reading a table:
t = blocked_table.open('/tmp/mytable')
for k, v in t.iteritems(): print k
v = t.lookup('this is a key')
Utility functions:
d = dict([('key %d' % i, 'value %d' % i) for i in range(1000000)])
dictionary_to_table(d, '/tmp/mytable')
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| blocked-table-1.1.tar.gz (md5) | Source | 2011-12-01 | 3KB | 188 | |
- Author: Russell Power
- Home Page: http://rjpower.org/browse.cgi/blocked-table
- License: BSD
-
Categories
- Development Status :: 4 - Beta
- Intended Audience :: Developers
- Intended Audience :: System Administrators
- License :: OSI Approved :: BSD License
- Operating System :: POSIX
- Programming Language :: Python :: 2.5
- Programming Language :: Python :: 2.6
- Programming Language :: Python :: 2.7
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3.0
- Programming Language :: Python :: 3.1
- Programming Language :: Python :: 3.2
- Topic :: Software Development :: Libraries
- Package Index Owner: rjpower
- DOAP record: blocked-table-1.1.xml
