Git Product home page Git Product logo

pyunqlite's Introduction

pyUnQLite

TODO

  • Add AES-256 support to unqlite.

ATTENTION

This AES-256 version is not the OFFICIAL product which can be obtained from http://unqlite.org/support.html If you really need encryption unqlite in production, maybe official version is better.

Introduction

A UnQLite NoSQL DB for python. Using cython for adapter.

An this is unofficial python bindings for UnQLite, an embeddable NoSQL database engine.

If you don't like amalgamation style, I wrote a script to extract source code from unqlite.c: https://github.com/buaabyl/pyUnQLite/tree/master/unpack-unqlite

I don't like official python bindings, so decided to use new way.

This bindings support python buildin 'dict' interface, such as

db['key'] = value
if 'key' in db:
    print '"key" exist'
for k in db:
    v = db[k]
    print k, v
    
if 'key' in db:
    del db['key']

Example 1 (original use)

import pyunqlite

db = pyunqlite.UnQLite()
db.open('/tmp/test.db')

db.store('foo', 'bar')
print db.fetch('foo')  # => 'bar'

db.delete('foo')

db.close()

Example 2 (dict like use)

import pyunqlite

#sqlite3 like
db = pyunqlite.connect('test.unqlite')

#dict like set and delete
db['exist'] = 'hello world'
db['notexist'] = '1'
db.commit()

del db['notexist']
print 'check "exist" in db:', 'exist' in db
print 'check "notexist" in db:', 'notexist' in db

#dict like iter
print 'ITER:'
for k in db:
    print k, ':', db[k]

db.rollback()

#dict like iter
print 'ITER:'
for k in db:
    print k, ':', db[k]

which will print out

check "exist" in db: True
check "notexist" in db: False
ITER:
exist : hello world
ITER:
notexist : 1
exist : hello world

Installation

$ # pip
$ pip install cython
$ # or setuptools
$ easy_install -Z cython
$
$ cd path/to/pyunqlite/source/code/directory
$ python setup.py build
$ python setup.py install
$

Files

Credits

UnQLite

/*
 * Copyright (C) 2012, 2013 Symisc Systems, S.U.A.R.L [M.I.A.G Mrad Chems Eddine <[email protected]>].
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY SYMISC SYSTEMS ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT, ARE DISCLAIMED.  IN NO EVENT SHALL SYMISC SYSTEMS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

I copy the original version from https://bitbucket.org/east301/py-unqlite, version 1f1e3ab-2013.07.06 the creator not update it, so I decided to maintain.

pyunqlite's People

Contributors

buaabyl avatar

Watchers

GASQ Romain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.