Git Product home page Git Product logo

compress-with-tinypng's Introduction

使用说明

1. 请先安装 tinify 的依赖库:

python -m pip install tinify

2. 申请 tinify key

https://tinypng.com/developers 申请自己的 key,每个 key 每个月可以压缩 500 个文件。

3. 执行脚本

申请完 key 之后,更新到代码段中的:

tinify.key = "your key" # AppKey

然后带参数执行脚本即可。

[Usage] compress-with-tinypng.py [filepath] [key]

参数一:filepath,必选,可以是文件,也可以是文件夹。

参数二:key,可选,自定义 key,如果输入了第三个参数,则优先使用自定义 key

压缩后的文件,默认输出到当前脚本所在目录下的 tinypng 文件夹中,如果要输出到其他位置,可以自行修改脚本实现。

PS:已使用 Python2.7 和 Python3.4 亲测有效,其他 Python 版本如果有异常,请反馈

compress-with-tinypng's People

Contributors

sylan215 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.