All Questions
Tagged with compression python-3.x
12 questions
2
votes
2
answers
207
views
Checking file header for magic number in Python
I wrote this to check files for successful compression with LZ4.
Any advice is welcome.
Particularly regarding raising exceptions and error handling.
...
4
votes
1
answer
379
views
Huffman encoding as Unix style command line utility
After watching Tom Scott explain Huffman coding in this YouTube video, I wanted to implement it myself. I want to use this project to further my understanding of Python. Additionally this tool should ...
6
votes
2
answers
336
views
Compressing large jpeg images
I'm working with thousands of large image files in a regularly updated library. The following script does the job (on average reduces my file size ~95%) but costs me around 25 seconds to compress one ...
3
votes
1
answer
96
views
File compressor
I have written a file compressor in python. The program generates a file filled with sequences of the same character with a random length, and compresses that file. I would like feedback on code ...
4
votes
1
answer
123
views
Google drive backup robot
I have a lot of files. I care about those files. I also care about good programming practices and learning proper Python. Given the described context, it seemed appropriate to implement my own ...
2
votes
2
answers
2k
views
Reading a gzipped file with JSON data for thousands of users
I'm a newbie in Python.
I need to read a GZ file contains thousands of users.
But I think my code is not optimized in this case. Could anyone can help me? What should I do to improve performance? Or ...
2
votes
1
answer
8k
views
Read gzipped JSON file from URL
I am requesting a JSON file that's gzipped. First, I download file:
...
7
votes
1
answer
1k
views
Python 3.x Hexdump
I posted a small hexdump generator function from a program I've been writing not long ago and applied what a reviewer suggested since then. The goal was to lazily hexdump bytes objects (byte strings, ...
3
votes
1
answer
5k
views
Compress and decompress a string from a file
I need to compress some text, I'm wondering if my program could be made more efficient. The only things I could think of would be the 'import re' and turning the filename input and read part as a ...
3
votes
2
answers
10k
views
Simple string compression in Python
This is my solution to exercise 1.6 in Cracking the Coding Interview. I am interested in receiving feedback on the coding style and time/space complexity.
The exercise statement is:
Implement a ...
6
votes
1
answer
405
views
Prefix free compression and decompression
I have written a prefix-free compressor that assigns the shortest bit-strings to the most common characters. It works very well for natural language as some characters (SPACE, "a", "e" ...) are much ...
19
votes
2
answers
35k
views
Simple backup script in Python
Since rsync lacks compression and I'm not a big fan of rdiff, I thought I'd try my own little backup script. Since I'm very ...