Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install sqlitedict

How to install sqlitedict

  1. Download and install ActivePython
  2. Buy and install the Business Edition license from account.activestate.com
  3. Open Command Prompt
  4. Type pypm install sqlitedict

sqlitedict contains builds that are only available via PyPM when you have a current ActivePython Business Edition subscription.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0.8
1.0.8 Available View build log
1.0.7 Available View build log
1.0.6 Available View build log
1.0.5 Available View build log
1.0.4 Available View build log
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
Windows (64-bit)
1.0.8
1.0.8 Available View build log
1.0.7 Available View build log
1.0.6 Available View build log
1.0.5 Available View build log
1.0.4 Available View build log
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
Mac OS X (10.5+)
1.0.8
1.0.8 Available View build log
1.0.7 Available View build log
1.0.6 Available View build log
1.0.5 Available View build log
1.0.4 Available View build log
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
Linux (32-bit)
1.0.8
1.0.8 Available View build log
1.0.7 Available View build log
1.0.6 Available View build log
1.0.5 Available View build log
1.0.4 Available View build log
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
Linux (64-bit)
1.0.8
1.0.8 Available View build log
1.0.7 Available View build log
1.0.6 Available View build log
1.0.5 Available View build log
1.0.4 Available View build log
1.0.3 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
 
Author
License
public domain
Depended by
Imports

A lightweight wrapper around Python's sqlite3 database, with a dict-like interface and multi-thread access support:

>>> mydict = SqliteDict('some.db', autocommit=True) # the mapping will be persisted to file `some.db`
>>> mydict['some_key'] = any_picklable_object
>>> print mydict['some_key']
>>> print len(mydict) # etc... all dict functions work

Pickle is used internally to serialize the values. Keys are strings.

If you don't use autocommit (default is no autocommit for performance), then don't forget to call mydict.commit() when done with a transaction.

Features

  • Values can be any picklable objects (uses cPickle with the highest protocol).
  • Support for multiple tables (=dicts) living in the same database file.
  • Support for access from multiple threads to the same connection (needed by e.g. Pyro). Vanilla sqlite3 gives you ProgrammingError: SQLite objects created in a thread can only be used in that same thread.

Concurrent requests are still serialized internally, so this "multithreaded support" doesn't give you any performance benefits. It is a work-around for sqlite limitations in Python.

Installation

The module has no dependencies beyond 2.5 <= Python < 3.0. Install or upgrade with:

sudo easy_install -U sqlitedict

or from the source tar.gz

python sqlitedict.py # run some tests
sudo python setup.py install

Documentation

Standard Python document strings are inside the module:

>>> import sqlitedict
>>> help(sqlitedict)

(but it's just dict with a commit, really).

Comments, bug reports

sqlitedict resides on github. You can file issues or pull requests there.


sqlitedict is released as public domain, you may do with it as you please. Hack away.

Subscribe to package updates

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.