Metadata-Version: 1.1
Name: kenji
Version: 0.3.1
Summary: simple sqlite-backed graph datastore
Home-page: http://github.com/eugene-eeo/kenji
Author: Eugene Eeo
Author-email: packwolf58@gmail.com
License: MIT
Description: .. image:: https://raw.github.com/eugene-eeo/kenji/master/art/logo-300.png
           :alt: Kenji
        
        An embedded social graph datastore with an SQLite3 backend.
        
        Kenji was inspired by both `Neomodel`_ and `Flockdb`_, taking
        the best out of both worlds and putting it into a smaller
        scale library.
        
        Supported Python versions include python 2.6+, 3.3+, as well
        as pypy. Works great with `gevent`_ too.
        
        |Build|
        |Coverage|
        |Version|
        
        Synopsis
        --------
        
        **Relations, simplified**- Kenji stores property-less relations
        between your data. Let your document/key-value/relational datastore
        store all your other documents. Because of the specific problems it
        aims to solve, Kenji's codebase is tiny, just like the apps it's
        meant for. To install, just:
        
        .. code-block:: sh
        
            $ pip install kenji
        
        Or check out `how to install pip`_ and then install the correct package
        if you're on Windows. Then initialize a graph, and play around with it.
        
        .. _how to install pip: http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows
        
        .. code-block:: python
        
            from kenji import Graph, V
            g = Graph(graphs=['knows'])
        
            g.store(V(2).knows(1))
            for i in range(2, 5):
                g.store(V(1).knows(i))
        
        Let's see what kind of queries can we make against
        the data we've stored in the DB:
        
        .. code-block:: python
        
            assert g.exists(V(1).knows(2))
            assert list(g.select(V(1).knows)) == [2,3,4]
            assert g.select(V().knows(1)).first == 2
        
        What about asking questions like who are the people
        that 1's friends know?
        
        .. code-block:: python
        
            assert list(g.select(V(1).knows)
                          .traverse('knows')) == [1]
        
        We can also bundle up changes in a transaction, because
        kenji is based on an RDBMS backend:
        
        .. code-block:: python
        
            with graph.transaction() as tr:
                tr.store(V(1).knows(3))
                tr.delete(V(1).knows(2))
        
        FAQ
        ---
        
        1. **Is Kenji thread-safe?** Kenji is thread safe, as long as you
        use it with the constraints of the SQLite library. According to
        the SQLite docs, `threads are evil`.
        
        2. **What about transactions?** Currently there is no guaranteed
        method of making atomic transactions thread-safe, primarily because
        they aren't thread safe in the SQLite3 library as well. We can
        sacrifice atomicity for thread safety but then again, that means
        that you won't really have a transaction.
        
        3. **Is Kenji a property graph?** No, it is merely a social graph.
        If you need properties in edges between nodes then you should
        consider other graphs like Neo4j.
        
        
        .. _gevent: http://www.gevent.org
        .. _Neomodel: http://github.com/robinedwards/neomodel
        .. _FlockDB: http://github.com/twitter/flockdb
        .. |Build| image:: http://img.shields.io/travis/eugene-eeo/kenji.svg
           :target: https://travis-ci.org/eugene-eeo/kenji
        .. |Coverage| image:: http://img.shields.io/coveralls/eugene-eeo/kenji.svg
           :target: https://coveralls.io/r/eugene-eeo/kenji
        .. |Version| image:: http://img.shields.io/pypi/v/kenji.svg
           :target: https://pypi.python.org/pypi/kenji
        
Keywords: database graph
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Database
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Operating System :: OS Independent
