GithubHelp home page GithubHelp logo

python bindings about rocksdb HOT 13 CLOSED

facebook avatar facebook commented on April 25, 2024
python bindings

from rocksdb.

Comments (13)

dhruba avatar dhruba commented on April 25, 2024

The rocksdb C++ api is far more richer than the leveldb api. But we have (sadly) failed to enhance the C api in the same way. If you would like to bring the C api in par with C++ api, that will be a great contribution to the rocksdb github repo.

from rocksdb.

sepeth avatar sepeth commented on April 25, 2024

Great then, I am on it :)

from rocksdb.

igorcanadi avatar igorcanadi commented on April 25, 2024

@sepeth Feel free to change leveldb_* in c.h to rocksdb_* and send us a pull request :)

from rocksdb.

juneng603 avatar juneng603 commented on April 25, 2024

👍

@sepeth if you want to some hands for your contributions, I could be with you. :)

from rocksdb.

sepeth avatar sepeth commented on April 25, 2024

@igorcanadi I sent it :)

@junyoungKim Great :) I started with renames, and I will keep c-api branch updated in my fork as I progress. We can continue from there, I think.

from rocksdb.

juneng603 avatar juneng603 commented on April 25, 2024

@sepeth ok, I've checked your branch for the jobs. Lets think about how we can implement it in a best way.

from rocksdb.

forhappy avatar forhappy commented on April 25, 2024

I find that rocksdb's C API is much the same with leveldb's C API, I have written a python leveldb binding based on its C API before(https://github.com/forhappy/cpy-leveldb), so I can make it for rocksdb much easier, I'm on it too ;-).

from rocksdb.

stephan-hof avatar stephan-hof commented on April 25, 2024

Hi @sepeth have you considered other methods for wrapping ?

For example Cython has great capabilities to wrap c++ code and the generated code works under python2 and python3

Only drawback, it generates code for cPython only. For a more 'interpreter-independent' way you should also check out CFFI. The 'wrap-performance' on pypy is outstanding (because the JIT knows of the C-functions and types and calls them directly) and on cPython comparable to ctypes.

However I don't know the status of CFFI for Jython/IronPython, but if you really target this two interpreters you should also check if they support ctypes properly.

from rocksdb.

ramanala avatar ramanala commented on April 25, 2024

Hello @sepeth , Any idea on when the python bindings for RocksDB will be available?

from rocksdb.

sepeth avatar sepeth commented on April 25, 2024

@ramanala hello, hardest part of it is to complete C api, I believe. I've been doing somethings on that part (but some other things in my life kept me away from doing it), and still stuck with merge operator. In the mean time, I am playing with rocksdb from python. It seems easy to do with ctypes.

@stephan-hof Thank you. I am also considering CFFI, beside ctypes. and also pypy seems to suggest CFFI too.

from rocksdb.

stephan-hof avatar stephan-hof commented on April 25, 2024

Hi guys, I also started python bindings for rocksdb.
Code here https://github.com/stephan-hof/pyrocksdb and the docs here http://pyrocksdb.readthedocs.org/

I'm using cython to wrap the C++ bindings directly.
I know this makes it impossible to use them under pypy, but I had a couple of reasons to do it

  • Experience with Cython (was using it to wrap other c++ libraries).
  • Cython has good capabilities to wrap C++, for example automatic exception conversion.
  • No dependencies on rocksdb C-API. As mentioned above the C-API lacks behind the features of the C++ driver and it seems to me the new features are implemented in C++ first.

The driver is still not complete yet, for example a python prefix_extractor is not possible, but the basic operations are already possible. Everything mentioned in the docs (like merge operator) should work.

Give it a try, I would be happy for everybody who would like to join the development.

from rocksdb.

igorcanadi avatar igorcanadi commented on April 25, 2024

Closing the issue since it's stale. Thank you everybody for contributing to python bindings!

from rocksdb.

thedrow avatar thedrow commented on April 25, 2024

Has someone created a CFFI extension yet?

from rocksdb.

Related Issues (20)

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.