Git Product home page Git Product logo

filerepack's Introduction

About

This tool and library were written to optimize Microsoft Word / Libreoffice ZIP based files. It uses 7-Zip, jpegoptim and pngquant and recompresses not only host zip file but also all images and other suitable files inside it.

Installation

At the command line:

$ pip install filerepack

Or, if you don't have pip installed:

$ easy_install filerepack

If you want to install from the latest sources, you can do:

$ git clone https://github.com/ivbeg/filerepack.git
$ cd  filerepack
$ python setup.py filerepack

Command line

Usage: frepacker.py FILENAME

docx to csv convertor (http://github.com/ivbeg/filesrepack) Repacks ZIP and ZIP'based files and images for better compression

Use command: "frepacker.py <filename>" to run recompression.

Examples

frepacker.py CP_CONTRACT_160166.docx

Recompresses CP_CONTRACT_160166.docx including all zip files, images and so on

Code

Repacks presentation file "some_presentation.pptx
>>> from filerepack import FileRepacker
>>> rp = FileRepacker()
>>> stats = rp.repack_zip_file(filename="some_presentation.pptx")
Recursively repacks all images .jpg and .png files in directory "some_media_path"
>>> from filerepack import FileRepacker
>>> rp = FileRepacker()
>>> stats = rp.pack_images('some_media_path', recursive=True)

Requirements

It works in both Windows and Linux environments. You need to install zip, 7Zip, jpegoptim and pngquant tools in your OS PATH settings.

Acknowledgements

filerepack's People

Contributors

ivbeg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.