Skip to main content

Text gadgets that help with indentation and a few other gizmos

Project description

Latest Version Python Versions Build Status Documentation Status

snick

snick-hero

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 with json.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snick-3.2.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snick-3.2.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

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

Hashes for snick-3.2.0.tar.gz
Algorithm Hash digest
SHA256 a8711b42a08449ca1ac408f68d6dd536a2d6fbc207ddb31e31802bb19bf6a039
MD5 fecc416eff3aeee8bec197eb7d5ceb67
BLAKE2b-256 b93f1f541a1759c6e9dfb804a095c92a6b424a8db1f3aa8158185bf78a707900

See more details on using hashes here.

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

Hashes for snick-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcfd29647c7ed4ed70a14f5b08f5eb667329cb03ba00d97d9ba5716572924e1b
MD5 f8fd7c49b002eafcca6e4259c92e8788
BLAKE2b-256 2745517235b9479e666265ac94851a78d6d197b3ca6b77861966de565c0a0bf1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page