Skip to main content

Using Machine Learning to learn how to Compress

Project description

Build Status PyPI PyPI HitCount

Try it live at https://shrynk.ai

Features

  • ✓ Compress your data smartly based on Machine Learning
  • ✓ Takes User Requirements in the form of weights for size, write_time and read_time
  • ✓ Trains & caches a model based on compression methods available in the system using packaged data
  • CLI for compressing and decompressing

CLI

shrynk compress myfile.json       # will yield e.g. myfile.json.gz or myfile.json.bz2
shrynk decompress myfile.json.gz  # will yield myfile.json

shrynk compress myfile.csv --size 0 --write 1 --read 0

shrynk benchmark myfile.csv                  # shows benchmark results
shrynk benchmark --predict myfile.csv        # will also show the current prediction
shrynk benchmark --save --predict myfile.csv # will add the result to the training data too

Usage

Installation:

pip install shrynk

Then in Python:

from shrynk import save, load
file_path = save(my_df, "mypath.csv")
# e.g. mypath.csv.bz2
loaded_df = load(file_path)

Add your own data

If you want more control you can do the following:

import pandas as pd
from shrynk import PandasCompressor

df = pd.DataFrame({"a": [1, 2, 3]})

pdc = PandasCompressor("default")
pdc.run_benchmarks(df) # adds data to the default

pdc.train_model(size=3, write=1, read=1)

pdc.predict(df)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shrynk-0.1.19.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shrynk-0.1.19-py2.py3-none-any.whl (4.5 MB view details)

Uploaded Python 2Python 3

File details

Details for the file shrynk-0.1.19.tar.gz.

File metadata

  • Download URL: shrynk-0.1.19.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0a0

File hashes

Hashes for shrynk-0.1.19.tar.gz
Algorithm Hash digest
SHA256 5401543b23f7f2c0a36d3a12716fbf1d8721b93624f275dde6d5f605b0817ad1
MD5 b329ec33134596e91f2c2b3dd43adff4
BLAKE2b-256 b59ec4202513edb1466a1425db44d8eaee1ea6e7f66288141c0c4d670370fc2e

See more details on using hashes here.

File details

Details for the file shrynk-0.1.19-py2.py3-none-any.whl.

File metadata

  • Download URL: shrynk-0.1.19-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0a0

File hashes

Hashes for shrynk-0.1.19-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7056395e4c71795467f6f3470f456a8df43ab1f2014bc21b1f507633f0dbb959
MD5 8d5b4712c5aa6283568504a75828ca76
BLAKE2b-256 ce836ede953ad1a1916a799ed1f207f92274f40319a8d4c6b0c312fc73df33b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page