semvec/pypi-packages huggingface dataset:
chromesimplecache 0.0.2
Chrome(Linux,Android) cache extractor
Requires Python: >=3.6

# simplecache

![C/C++ CI](https://github.com/shosatojp/simplecache/workflows/C/C++%20CI/badge.svg)

Chrome(Linux,Android) cache extractor.

## Usage

```sh
[usage]
simplecache [OPTIONS]
--list  -l      list all keys
--cache -c      cache directory
--key   -k      key
--out   -o      output path
```

### Get list of cache

```sh
simplecache --cache ~/.cache/google-chrome/Default/Cache/ --list
```

### Save cached file

```sh
simplecache --cache ~/.cache/google-chrome/Default/Cache/ --key https://example.com/image.png --out myimage.png
```

## Python Binding

```sh
pip install chromesimplecache
```

```py
from simplecache import SimpleCacheEntry
import glob
import urllib.parse
import os
import brotli
import gzip
import zlib

cache_dir = os.path.expanduser('~/.cache/google-chrome/Default/Cache/*_0')
out_dir = 'cache'

if not os.path.exists(out_dir):
    os.mkdir(out_dir)

for entry_file in glob.glob(cache_dir):
    e = SimpleCacheEntry(entry_file)
    url = e.get_key()
    print(url)

    filename = urllib.parse.quote(url, safe='')[:255]
    encoding = e.get_header().headers.get('content-encoding', '').strip().lower()
    out_path = os.path.join(out_dir, filename)

    if encoding:
        # decompress with python
        data = e.get_data()
        if encoding == 'gzip':
            data = gzip.decompress(data)
        elif encoding == 'br':
            data = brotli.decompress(data)
        elif encoding == 'deflate':
            data = zlib.decompress(data)

        with open(out_path, 'wb') as f:
            f.write(data)
    else:
        # faster for binary
        e.save(out_path)
```

## Install

Download artifacts from [here](https://github.com/shosatojp/simplecache/actions) or manually build.

## Build

### Build on host

```sh
sudo apt-get install -y g++ python3.8-dev make python3-pip
pip3 install pybind11
make
```

### Build with docker

```sh
sudo docker-compose up --build
```

* Specify python version in `docker-compose.yml` (default python3.8)
daves_utilities 0.0.14
Daves utilities is a collection of useful python functions which I would like to provide to anybody who is interested in using them.

# daves_utilities

## description
Daves utilities is a collection of function which I repeatedly needed but did not find implemented for python.

## installation
`pip install daves_utilities`

## functions
- for_long  
  adds some useful functionalities for long running loops
  - Save progress and return calculation where you left off
  - Input multiple list to iterate over permutation of all input lists
  - Loading bar
- fun_save  
  Saves the output of any function to a pickle file.
  If the function is run again it will check the input parameters against the saved files. If the input-function combination is found again it will read the pickle file instead of rerunning the function.  
  - This function either saves the last run or every run ever completed.
- is_equal  
  Compare two arbitrary python objects. The function will check recursively in any iterable object.
  - Advantage to a comparison with `X is Y` is that the object does not need to be saved on the same Memory location.
- print_structure
  Print the structure of any iterable python object.