My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

IMPORTANT: Moved to Github

I've moved this project to github: https://github.com/williamstein/nosqlite

noSQLite is a lightweight zeroconf noSQL document-oriented forking Python SQLite networked authenticated XMLRPC database server. It's written using Python and SQLite to provide a very lightweight and easy way to use SQLite that offers somewhat similar functionality to MongoDB (at least the parts I use), but much more lightweight.

To install:

hg clone https://wstein@nosqlite.googlecode.com/hg/ nosqlite
cd nosqlite
python setup.py develop

See http://nt.sagenb.org/home/pub/55/ for a demo in the context of Sage.

Here is a little demo.

>>> from nosqlite import client, server
>>> s = server(directory='/tmp/a')
>>> c = client(s.port)     # or do this from another session
>>> database = c.db
>>> collection = database.foo; collection
Collection 'db.foo'
>>> collection.insert({'a':123, 'b':'hello'})
>>> list(collection)
[{'a': 123, 'b': 'hello'}]
>>> collection.insert([{'a':i} for i in range(5)])
>>> len(collection)
6
>>> collection.find_one(a=4)
{'a': 4}
>>> collection.find_one(a=123)
{'a': 123, 'b': 'hello'}
>>> list(collection.find('a<3'))
[{'a': 0}, {'a': 1}, {'a': 2}]
>>> collection.insert({'a':-1, 'foo':[1,(2,3),set([3,4])]})   # automatic pickling so store any Python object
>>> collection.find_one(a=-1)
{'a': -1, 'foo': [1, (2, 3), set([3, 4])]}
>>> s.help()
nosqlite server on port 8132 serving "/tmp/a/"
Connect with

	client(8132, 'username', 'xxx')

To securely connect from a remote client, setup an ssh tunnel by
typing on the client:

	ssh -L 8132:localhost:8132 deep.local

then

	client(8132, 'username', 'xxx')

To stop server, delete the server object, call the quit()
method, or kill pid 94181.
----------------------------------------------------------------------
Powered by Google Project Hosting