semvec/pypi-packages huggingface dataset:
django-elephant 1.0.0
A simple cache for Django functions and methods
License: MIT
Keywords: django cache

# django-elephant

[![Build Status](https://travis-ci.org/jairhenrique/django-elephant.svg)](https://travis-ci.org/jairhenrique/django-elephant)
[![PyPI version](https://badge.fury.io/py/django-elephant.svg)](https://badge.fury.io/py/django-elephant)
[![codecov.io](https://codecov.io/github/jairhenrique/django-elephant/coverage.svg?branch=master)](https://codecov.io/github/jairhenrique/django-elephant?branch=master)
[![Code Issues](https://www.quantifiedcode.com/api/v1/project/03084631935244baa8335617d6502d11/badge.svg)](https://www.quantifiedcode.com/app/project/03084631935244baa8335617d6502d11)


*django-elephant is a simple wrapper to cache responses of Django methods or functions*


## Setup

```bash
pip install django-elephant
```

## Usage

#### Basic:

```python
from elephant import memorize

@memorize()
def foo(bar):
    return bar
```


#### Set cache configuration:

```python
from django.core.cache import caches
from elephant import memorize

other_cache = caches['other_cache']

@memorize(
    cache=other_cache
)
def foo(bar):
    return bar
```


#### Set cache timeout:

```python
from elephant import memorize

@memorize(
    timeout=1987
)
def foo(bar):
    return bar
```

#### Set cache key:

```python
from elephant import memorize

def my_custom_key(function, *args, **kwargs):
    return '{}.{}'.format(
        'elephant_'
        function.__name__
    )

@memorize(
    cache_key=my_custom_key
)
def foo(bar):
    return bar
```

## Requirements
- Django>=1.5


## Contribute
- Fork and make a pull request!
ascribe 0.0.9.dev1
ascribe api
License: MIT
Keywords: intellectual property,attribution,ownership,art,blockchain,api digital work,provenance,spool

ascribe SPOOL API Python Wrapper
================================

.. image:: https://travis-ci.org/ascribe/ascribe-api-wrapper.svg
    :target: https://travis-ci.org/ascribe/ascribe-api-wrapper
.. image:: https://codecov.io/github/ascribe/ascribe-api-wrapper/coverage.svg?branch=master
    :target: https://codecov.io/github/ascribe/ascribe-api-wrapper?branch=master

`ascribe ownership REST API <http://docs.ascribe.apiary.io>`_ Python wrapper.


Installation
------------

.. code-block:: python

    pip install ascribe


Example: Registering a Piece
----------------------------

.. code-block:: python
    
    >>> from ascribe import AscribeWrapper
    >>> ascribe_wrapper = AscribeWrapper('your-token')
    >>> piece = {
        'file_url': 'https://s3.eu-central-1.amazonaws.com/bucket/img.jpg',
        'artist_name': 'mystery',
        'title': 'universe',
    }
    >>> ascribe_wrapper.create_piece(piece)
    {'piece': {
        'artist_name': 'mystery',
        'bitcoin_id': 'bitcoin-id',
        'date_created': '2015-01-01',
        'datetime_registered': '2015-11-28T20:42:19.917896Z',
        'license_type': {
            'code': 'default',
            'name': 'All rights reserved',
            'organization': 'ascribe',
            'url': 'https://www.ascribe.io/faq/#legals'
        },
        'title': 'universe',
        'user_registered': 'mystery'
        ...
        ...
    }}


Documentation
-------------

https://ascribe.readthedocs.org