semvec/pypi-packages huggingface dataset:
pysimplecache 0.0.1
A simple caching library for Python

# Simple Caching Library for Python
[![Build Status](https://travis-ci.org/stajkowski/simple-cache.svg?branch=master)](https://travis-ci.org/stajkowski/simple-cache)

# Summary
Simple caching library for supported providers.  Pass method call to caching provider along with
generated key to populate memcached with the result.  The results will be returned with a boolean value
if there was a cache miss to assist in any metrics generation.

# Versions
0.0.1 - Support for memcached and json conversion

# Getting Started
1. Instantiate the provider:
   ```python
   from simplecache.common.json_conversion import JsonConversion
   from simplecache.providers.memcached import MemcachedProvider

   memcached = MemcachedProvider(JsonConversion(), servers='127.0.0.1')
   ```
2. PUT data into Memcached:
   ```python

   data = {
       'test1': 'value1',
       'test2': 'value2'
   }

    memcached.put('testkey1', 60, data) 
   ```
3. GET data by key from provider.  Optionally: Pass a method for a cache miss to load
data into provider from the result.

   ```python
    class TestClass(object):

        def test_method(self, param1, param2):
            data = {
                'test1': 'value1',
                'test2': 'value2'
            }
            if param1 != 'p1' or param2 != 'p2':
                raise Exception('Unexpected error.')
            return data

    t = TestClass()

    # test local instance of memcached with cache miss
    response, miss = memcached.get(
        'testkey2', 60, t.test_method, param1='p1', param2='p2')
   ```
4. DELETE data by key from provider.
   ```python
    memcached.delete('testkey1')
   ```
script-benchmark-tools 0.6.8
Benchmark Python Scripts
Requires Python: >=3.5, <4
Keywords: table print development display terminal command-line-tools

# Python Script Benchmark Tools

Benchmark script run times, print tables of results and display plots.

## Install

`pip install script_benchmark_tools`

##

See examples folder for usage.

## Sample Output


Proofs
------
insertion_sort [1, 2, 3, 4, 5, 6]
selection_sort [1, 2, 3, 4, 5, 6]

Benchmarks
----------
N = 10
------
|  min          |  avg          |  max          |  func            |  name     |
|---------------|---------------|---------------|------------------|-----------|
|  0.000008106  |  0.000018342  |  0.000201225  |  insertion_sort  |  sarcoma  |
|  0.000008821  |  0.000029361  |  0.001542091  |  selection_sort  |  sarcoma  |

N = 50
------
|  min          |  avg          |  max          |  func            |  name     |
|---------------|---------------|---------------|------------------|-----------|
|  0.000027895  |  0.000030518  |  0.000068188  |  insertion_sort  |  sarcoma  |
|  0.000089884  |  0.000214245  |  0.004812956  |  selection_sort  |  sarcoma  |

N = 100
------
|  min          |  avg          |  max          |  func            |  name     |
|---------------|---------------|---------------|------------------|-----------|
|  0.000061750  |  0.000069265  |  0.000296116  |  insertion_sort  |  sarcoma  |
|  0.000331640  |  0.000390785  |  0.000853777  |  selection_sort  |  sarcoma  |

N = 500
------
|  min          |  avg          |  max          |  func            |  name     |
|---------------|---------------|---------------|------------------|-----------|
|  0.000585079  |  0.000774384  |  0.005968094  |  insertion_sort  |  sarcoma  |
|  0.008999825  |  0.015488691  |  0.050533056  |  selection_sort  |  sarcoma  |

N = 1000
------
|  min          |  avg          |  max          |  func            |  name     |
|---------------|---------------|---------------|------------------|-----------|
|  0.001787901  |  0.009231312  |  0.057305098  |  insertion_sort  |  sarcoma  |
|  0.037415981  |  0.047663388  |  0.092668772  |  selection_sort  |  sarcoma  |

![Benchmark Plot](https://github.com/sarcoma/python-script-benchmark-tools/blob/master/examples/benchmark.png)