Text gadgets that help with indentation and a few other gizmos
Project description
snick
Handy gadgets for taming indented text
A small collection of practical utilities for working with indented strings and text formatting:
- Dedent triple-quoted strings without giving up indented code
- Build multi-line output line by line with
Conjoiner - Format data structures like
pprint, but withjson.dumps-style indentation and trailing commas - Strip ANSI codes and stray whitespace from terminal output
- Wrap and indent text blocks for logs and reports
Built on the Python standard library — nothing extra to install.
Quickstart
Requirements
- Python 3.10 or greater
Installation
Install the latest release from PyPI:
pip install snick
Quick taste
import snick
message = snick.dedent(
"""
The Force will be with you.
Always.
"""
)
print(message)
Running this gives:
The Force will be with you.
Always.
To learn about all the features, see the documentation.
Try the demo
The fastest way to see snick in action is to run the interactive demo. No install required:
uvx --from=snick[demo] snick-demo
The demo walks through every feature, one function at a time. Each step shows the source code and its output, then asks whether to continue.
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 snick-3.2.0.tar.gz.
File metadata
- Download URL: snick-3.2.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8711b42a08449ca1ac408f68d6dd536a2d6fbc207ddb31e31802bb19bf6a039
|
|
| MD5 |
fecc416eff3aeee8bec197eb7d5ceb67
|
|
| BLAKE2b-256 |
b93f1f541a1759c6e9dfb804a095c92a6b424a8db1f3aa8158185bf78a707900
|
File details
Details for the file snick-3.2.0-py3-none-any.whl.
File metadata
- Download URL: snick-3.2.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcfd29647c7ed4ed70a14f5b08f5eb667329cb03ba00d97d9ba5716572924e1b
|
|
| MD5 |
f8fd7c49b002eafcca6e4259c92e8788
|
|
| BLAKE2b-256 |
2745517235b9479e666265ac94851a78d6d197b3ca6b77861966de565c0a0bf1
|