semvec/pypi-packages huggingface dataset:
pussycache 1.4
Cache Backend system for python objects
License: BSD
Keywords: cache

Python pussy cache
==================

Python pussy cache is a Cache system for python objects.

Cache backends can be in-memory or redis/ You can even use the django
cache framework with Python-pussy-cache.

Given a one of the cache backends and any Python class you have
define, Python-pussy-cache will cache the results of methods you have
define and will also manage the cache invalidation by timestamp or
with methods you have defined.

[![Build Status](https://secure.travis-ci.org/novapost/python-pussycache.png?branch=master)](https://travis-ci.org/novapost/python-pussycache)
[![python-pussycache](https://pypip.in/v/pussycache/badge.png)](https://crate.io/packages/pussycache/)
[![python-pussycache](https://pypip.in/d/pussycache/badge.png)](https://crate.io/packages/pussycache/)


Here is an example to make the thing clearer

```python
import time
from pussycache.proxy import BaseProxy
from pussycache.cache import BaseCacheBackend
# Here is a simple class where some methods need to be cached

class MyClass(object):

      def a_long_task(self, delta):
          time.sleep(delta)
          return delta

      def forget_about_time(self):
          return None

# We set an in memory cache backend with a TTL of 30 seconds.

cache = BaseCacheBackend(30)

cache_proxy = BaseProxy(MyClass(), cache=cache,
             cached_methods=["a_long_task"],
             invalidate_methods={"forget_about_time": ["a_long_task"]})

cachedinstance = cache_proxy
# your cachedinstance is now
# ready to use. It will just work like a regular MyClass object

print cachedinstance.a_long_task(10)
# 10 seconds later
10
# if we call the same method a second time:
print cachedinstance.a_long_task(10)
10
# result is returned immediatly because it's in the cache
# but
print cachedinstance.a_long_task(3)
3
# with different parameters, the result is not cached yet.
# if you want to invalidate the cache for this method:
print cachedinstance.forget_about_time()
print cachedinstance.a_long_task(10)
# 10 seconds later
10
```

Of course, If you need direct access to the cache backend, you can
call it directly. Let's say you need to invalidate ALL the cache :

```python

cachedinstance._cache.clear()
```

The same apply if you need to call directly the cache:

```python
cachedinstance.\_cache.set("mykey", "my value", 10)
cachedinstance.\_cache.get("mykey")
"my value"
#and 10 seconds later:
cachedinstance.\_cache.get("mykey")
#the value is gone from the cache
```


Tests
-----

To run test, just install tox with ``pip install tox`` and run

    tox
stati-net 0.0.8
Python client with HTTP & UDP & TCP/IP transports for GottWall statistics aggregator
License: BSD

Welcome to stati-python-net's documentation!
============================================

stati-python-net is a python client with HTTP & UDP & TCP/IP  transports for `GottWall metrics aggregation platform <http://github.com/GottWall/GottWall>`_

.. image:: https://secure.travis-ci.org/GottWall/stati-python-net.png
	   :target: https://secure.travis-ci.org/GottWall/stati-python-net

INSTALLATION
------------

To use gottwall  use `pip` or `easy_install`::

  pip install stati-net

or::

  easy_install stati-net


USAGE
-----

HTTPClient
^^^^^^^^^^

.. sourcecode:: python

   # HTTPClient
   from stati_net import HTTPClient

   private_key = "gottwall_privatekey"
   public_key = "project_public_key"
   project = "test_gottwall_project"

   host = "http://127.0.0.1:8890"

   cli = HTTPClient(private_key=private_key,
                    public_key=public_key,
                    project=project,
                    host=host,
                    prefix=None)

   cli.incr(name="orders", value=2, filters={"status": ["Completed", "Waiting"]})


TCP/IP Client
^^^^^^^^^^^^^

.. sourcecode:: python

   # TCP/IP Client
   from stati_net import TCPIPClient

   private_key = "gottwall_privatekey"
   public_key = "project_public_key"
   project = "test_gottwall_project"
   host = "127.0.0.1"
   port = 8097
   client = TCPIPClient(project=project,
                        private_key=private_key,
                        public_key=public_key,
                        host=host, port=port,
                        auth_delimiter="--stream-auth--", #optional
                        chunk_delimiter="--chunk--") #optional

   cli.incr(name="orders", value=2, filters={"status": ["Completed", "Waiting"]})


UDP Client
^^^^^^^^^^

.. sourcecode:: python

   # UDP client
   from stati_net import UDPClient

   private_key = "gottwall_privatekey"
   public_key = "project_public_key"
   project = "test_gottwall_project"
   host = "127.0.0.1"
   port = 8097
   client = UDPClient(project=project,
                      private_key=private_key,
                      public_key=public_key,
                      host=host, port=port,
                      auth_delimiter="--stream-auth--", #optional
                      chunk_delimiter="--chunk--", #optional
                      max_packet_size=1024) #optional

   cli.incr(name="orders", value=2, filters={"status": ["Completed", "Waiting"]})





CONTRIBUTE
----------

We need you help.

#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
   There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.
#. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it).
#. Write a test which shows that the bug was fixed or that the feature works as expected.
#. Send a pull request and bug the maintainer until it gets merged and published.

.. _`the repository`: https://github.com/GottWall/stati-python-net/
dj-dynamic-forms 0.4.dev20140206215248
Dynamic forms for Django - data storage in Postgres Hstore. It is a reusable Django application to create and configure forms through the admin.
License: BSD

dj-dynamic-forms
================

Dynamic forms for Django

**dj-dynamic-forms** lets you create your forms through the Django
admin. You can add and remove form fields as you need them. That makes
it perfect for creating survey or application forms.

It uses ``Postgres Hstore`` extension to store forms data.

This project is fork of
`django-dynamic-forms <https://github.com/Markush2010/django-dynamic-forms>`__
by `Markush2010 <https://github.com/Markush2010>`__ mainly to use
Postgres Hstore by default.

Install
-------

::

    1. pip install -r requirements.txt
    2. pip install dj-dynamic-forms

Postgres extension ``Hstore`` must be installed manually.

::

    CREATE EXTENSION Hstore;

Usage
-----

Add ``'dynamic_forms'`` to the ``INSTALLED_APPS``::

::

    INSTALLED_APPS = (
        ...
        'dynamic_forms',
        ...
    )

Add ``'dynamic_forms.middlewares.FormModelMiddleware'`` to the
``MIDDLEWARE_CLASSES`` (probably at the end)::

::

    MIDDLEWARE_CLASSES = (
        ...
        'dynamic_forms.middlewares.FormModelMiddleware'
    )

You can set ``DYNAMIC_FORMS_EMAIL_RECIPIENTS`` in your settings to a
list of e-mail addresses. Forms being send via e-mail will then be send
to those addresses instead of those defined in ``settings.ADMINS``. Each
recipient will see *all* other recipients. See
`send\_mail <https://docs.djangoproject.com/en/stable/topics/email/#django.core.mail.send_mail>`__
in the officiall documentation.

Example
-------

1. Change into the ``example/`` directory
2. Run ``./manage.py runserver``

The *admin* is available at http://127.0.0.1:8000/admin/.

-  Username: ``admin``
-  Password: ``password``

You can find an example form at http://127.0.0.1:8000/example-form/.

Running the tests
-----------------

1. Change into the ``tests/`` directory
2. Run ``./runtests.sh``