A neat pure-python tool to prepare your static files for deployment
Project description
critic-py
critic is a neat pure-python tool for preparing your static files for deployment
Description
critic was legitimately made out of boredom. Considering my main project at the time was failing, and I had a number of restrictions that finally clamped down on it and made it impossible to use it. So I decided to make something else, to help with issues that might've caused the original problem. And I really wanted to make a CLI tool lmao
critic currently only comes with a minifier, but there are plans for static compression, and analysis. It's mainly meant to be used in a CI environment, because of the destructive potential, but certain functions can be used without requiring a search on how to revert to a previous commit on StackOverflow
Installation
use a package manager like pip to install critic.
This assumes you have pip, if not you can check out a guide by python for installing pip onto your machine
pip install critic-py
Also, this is a package that relies only on the python stdlib, so no need to worry about extensive dependencies!
Usage
Currently, you can only minify CSS, and even then, it's lacking a lot of features. But, it handles nested CS, and I love nested CSS! :heart:
To use it, just type in:
critic minify css
Roadmap
I've got big dreams for this project. Not sure how many of them I'll reach, but I can at least get disappointed in myself when I add yet another feature out of boredom before I've completed one that's been on here since forever
- CSS Parser
- CSS Minification
- Remove comments
- Remove unnecessary whitespace
- Combining duplicate rules
- Combining selectors with duplicate declarations
- Leading zeros, and trailing units (for things like
0.5pxto.5px, and0pxto0respectively)
- Documentation
- Tests for the CLI (With pytest!)
- HTML Parser
- HTML Minification
- Remove Comments
- Remove unnecessary whitespace
- Others I haven't thought of yet
- JS Parsser
- JS Minification
- JS Mangling
- Sourcemaps
- Remove unnecessary whitespace
- Insert semicolons where needed to prevent JS Automatic Semicolon Insertion
Contributing
Check out the Code of Conduct and Contributing guidlines when you want to contribute! For major changes, please open an issue first to discuss you would like to change.
Also, update tests as appropriate
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file critic_py-0.1.0.tar.gz.
File metadata
- Download URL: critic_py-0.1.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3712d7fe58965017cc08a5404afd1e02c055c3a2aa540f762df542c6db00c037
|
|
| MD5 |
c97f002c81a716019488dfd317f4e483
|
|
| BLAKE2b-256 |
7a7bb2fb0cdaad9174a51032616dd192e51d30db1526cb28975d353317a8eb99
|
Provenance
The following attestation bundles were made for critic_py-0.1.0.tar.gz:
Publisher:
release.yml on Arcader717/critic-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
critic_py-0.1.0.tar.gz -
Subject digest:
3712d7fe58965017cc08a5404afd1e02c055c3a2aa540f762df542c6db00c037 - Sigstore transparency entry: 719452282
- Sigstore integration time:
-
Permalink:
Arcader717/critic-py@fe5df3af048d0ff4b6191c6a3e7d629beac7cb23 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Arcader717
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fe5df3af048d0ff4b6191c6a3e7d629beac7cb23 -
Trigger Event:
release
-
Statement type:
File details
Details for the file critic_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: critic_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a595d58c66636cff22d536066cbb6c4372a2901e65b5f68acd04e7c12574642
|
|
| MD5 |
7c6f45a7a6012467614ed20a85c203aa
|
|
| BLAKE2b-256 |
dd8b19ac87cae9b00f893ca0e0e9a6e40d8a565770616b7f00541f3cc9ae27f6
|
Provenance
The following attestation bundles were made for critic_py-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Arcader717/critic-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
critic_py-0.1.0-py3-none-any.whl -
Subject digest:
7a595d58c66636cff22d536066cbb6c4372a2901e65b5f68acd04e7c12574642 - Sigstore transparency entry: 719452283
- Sigstore integration time:
-
Permalink:
Arcader717/critic-py@fe5df3af048d0ff4b6191c6a3e7d629beac7cb23 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Arcader717
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fe5df3af048d0ff4b6191c6a3e7d629beac7cb23 -
Trigger Event:
release
-
Statement type: