Metadata-Version: 2.1
Name: distobjects
Version: 0.0.1a1
Summary: Python library to easily map Objects to Caching Systems like Redis
Home-page: https://github.com/svrdev27/py-distobjects
License: GPLv3
Download-URL: https://github.com/svrdev27/py-distobjects/archive/v0.0.1-alpha.1.tar.gz
Description: # py-distobjects
        
        **py-distobjects** (Python Distributed Objects) is a Python library to easily map Objects to Caching Systems like Redis.
        
        ### Usage
        - Simply define classes with minimum schema and connect to a backend
        - Create objects from those classes and use them as if they are regualer objects
        - Even Concurrent Access from multiple hosts will work as long as conntected to same backend
        - You can update the object from any Host/Process, you can access the updated values instently from other Hosts/Processes by just reading attribute without explicit refresh/reading
        
        ### Why? when i can use redis directly
        - Same reson as why we use ORMs for Database access when we can use SQL directly
        - No need to worry about keys, values, Serialization, and Deserialization etc. all over the code.
        - It just makes it easily organize/maintain the code by abstracting some functions
        
        ### Creating object in host1
        ```python
        >>> from distobjects import RedisBackend, DObject
        >>> from distobjects.fields import TextField
        >>> import redis
        >>>
        >>> r = redis.Redis(host='redis-server1', port=6379, db=5)
        >>> redis_backend = RedisBackend(client=r)
        >>> class MyStudent(DObject):
        ...    class Meta:
        ...        backend = redis_backend
        ...    first_name = TextField()
        ...    last_name = TextField()
        ...
        >>> student1 = MyStudent("1")
        >>> student1.first_name = "Harry"
        >>> student1.last_name = "James"
        ```
        
        ### Reading object in host2
        ```python
        >>> from distobjects import RedisBackend, DObject
        >>> from distobjects.fields import TextField
        >>> import redis
        >>>
        >>> r = redis.Redis(host='redis-server1', port=6379, db=5)
        >>> redis_backend = RedisBackend(client=r)
        >>> class MyStudent(DObject):
        ...    class Meta:
        ...        backend = redis_backend
        ...    first_name = TextField()
        ...    last_name = TextField()
        ...
        >>> student = MyStudent("1")
        >>> student
        <__main__.MyStudent object at 0x105bc29d0>
        >>> student.first_name
        'Harry'
        >>> student.last_name
        'James'
        ```
        
Keywords: redis,ODM,distributed objects,caching
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
