semvec/pypi-packages huggingface dataset:
Classless 0.0.2
Easily curry multiple functions to a given list of arguments without using classes
License: BSD
Keywords: class meta

Classless
=============

Get all the benefits of making your functions methods on a class
without actually having define them methods on a class! 

**Classless** allows you, instead,
to pass a list of functions to ```gen_class```
and curry them on the specified attributes.

Example:

.. code-block:: python

    from classless import gen_class
    
    def fun_stuff(db, name, x):
        q = db.get(name)
        return int(q) + x
    
    def cool_stuff(q, z, name, y, db):
        db.insert(name, (q, z, y))
    
    def awesome_adventure(w, name):
        if w > 5:
            return name
        else:
            raise Exception("I don't approve of the name {}".format(name))
    
    
    MyPretendClass = gen_class(methods=(fun_stuff,
                                        cool_stuff,
    				    awesome_adventure),
    		           init_attrs=['db', 'name'])

and then we use ``MyPretendClass`` just like any regular class:

.. code-block:: python

    obj = MyPretendClass(name='NiceName', db=some_connection)
    obj.awesome_adventure(25) # Calls awesome_adventure with name='NiceName'
                              # and w=25
    
    obj.cool_stuff(1,2,3) # == cool_stuff(1, 2, 'NiceName', 3, some_connection)
    
        
    obj.fun_stuff('Dr. X') # == fun_stuff(x='Dr. X', name='NiceName',
                           #              db=some_connection)
where ``obj`` just holds the list of ``methods`` curried on the ``init_attrs``.

We could have defined ``MyRealClass`` as so and get identical behaviour:

.. code-block:: python

    class MyRealClass(object):
        def __init__(self, db, name):
            self.db = db
    	self.name = name
    
        def fun_stuff(x):
            q = self.db.get(self.name)
            return int(q) + x
        
        def cool_stuff(q, z, y):
            self.db.insert(self.name, (q, z, y))
        
        def awesome_adventure(w):
            if w > 5:
                return self.name
            else:
                raise Exception("I don't approve of the name {}".format(self.name))

But, then every one of those methods is tied down to a given class, and can't be used as regular functions, without first constructing ``MyRealClass``.
rethinkengine 0.1.0
RethinkDB Object-Document Mapper
License: BSD
Keywords: rethinkdb object-document mapper

rethinkengine
=============

RethinkDB Object-Document Mapper written in Python

Rethinkengine is currently in development and not ready for production use.

Running unit tests
------------------

[![Build Status](https://travis-ci.org/bwind/rethinkengine.png?branch=master)](https://travis-ci.org/bwind/rethinkengine) [![Coverage Status](https://coveralls.io/repos/bwind/rethinkengine/badge.png)](https://coveralls.io/r/bwind/rethinkengine)

In the root of the repository you'll find `runtests.sh`, which will run all the tests and show coverage stats. Requires packages `nose` and `coverage` to be installed. Rethinkengine aims to be compatible with Python versions 2.6 and 2.7. Python 3 support will be added later.

Connecting to RethinkDB
-----------------------

    from rethinkengine import connect
    connect('dbname')

If `dbname` doesn't exist, it will be created for you.

Defining Documents
------------------

    from rethinkengine import *

    class User(Document):
        name = StringField()
        colors = ListField()

    # Create the table
    User.table_create()

Storing data
------------

    u = User(name='John', colors=['red', 'blue'])
    u.save()

    u.colors = []
    u.save()

Retrieving data
---------------

    for u in User.objects.all():
        print u.name, u.colors

    for u in User.objects.filter(name='John'):
        print u.name, u.colors

    for u in User.objects.all().order_by('name'):
        print u.name, u.colors