Skip to content

CallMeAlexO/jcalg1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JCALG1

A python module to interface with Jeremy Collake's JCALG1 compression algorithm.

Getting started

Installation

Either clone the github repo

git clone https://github.com/CallMeAlexO/jcalg1.git
cd jcalg1
python setup.py install

Or use pip

pip install jcalg1

Usage

I planned to make JCALG1 as similar as possible to zlib, for consistancy. There are two functions: compress and decompress.

import jcalg1

text = """
Mary had a little lamb,
Little lamb, little lamb,
Mary had a little lamb
Whose fleece was white as snow.

And everywhere that Mary went,
Mary went, Mary went,
Everywhere that Mary went
The lamb was sure to go.""".encode('utf-8')

compressed = jcalg1.compress(text, level=9, skip_checksum=False)
decompressed = jcalg1.decompress(compressed)

print(decompressed == text)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • The algorithm's original author - Jeremy Collake, who gave me permission to share this on github. Thank you Jeremy!

About

Python wrapper for jcalg1

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published