Tools for LibCST related to normalization.
Project description
NormCST
is a Python package providing tools for LibCST related to normalization.
The main contributions are normcst.ParenthesisTransformer, a libcst.CSTTransformer which adds necessary parentheses, and normcst.NoParenthesisTransformer, a libcst.CSTTransformer which removes all parenthesis.
Secondary contributions are found in normcst.black and normcst.utils like roundtrips which verifies whether or not the given node survives a roundtrip (to_string -> parse -> deep_equals).
Quickstart
- Install using
pip- e.g.
pipenv run python -m pip install normcst[all]
- e.g.
- Import and use
- e.g.
import normcstandnode.visit(normcst.ParenthesisTransformer())
- e.g.
- Optionally run tests
- e.g.
pipenv run python -m pytest /path/to/normcst/tests
- e.g.
Personal remarks
2025-09-05
Almost 6 months ago I published this side project and mentioned it in Issue 341. Nothing really changed except that time provides confidence; it didn't fail me ever since. There hasn't been much interest in it either, or reason to complain. Anyways, it's on PyPI now.
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 normcst-0.2.0.tar.gz.
File metadata
- Download URL: normcst-0.2.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36e8ea117709d77e794dabac0da7604d491b90515e60da902eeac854de1e86f6
|
|
| MD5 |
5eb4fca6ad7bc1a770ab566c4b9bc65c
|
|
| BLAKE2b-256 |
2aef9876cd7d3a399884b74dc2dbcc55c8126020e9d58b4d0f8ca09f13d966dd
|
File details
Details for the file normcst-0.2.0-py3-none-any.whl.
File metadata
- Download URL: normcst-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87e65939dc387e8ae58aa884eb7f486d870410b0c9b88116295c04f06e64fe64
|
|
| MD5 |
98a564fd388ff1842a7046502b53c44b
|
|
| BLAKE2b-256 |
2a077b1f10d66bf7d4799968bd8981edd0cea3f80c25af52c3a2aadaf71acabf
|