Skip to main content

No project description provided

Project description

https://img.shields.io/pypi/v/dfmt.svg

Overview

dfmt is a Python command line tool that can reformat text, allowing you to go from:

this is a pretty big sentence with lots of words that takes a lot of horizontal space

to:

this is a pretty big sentence with lots
of words that takes a lot of horizontal
space

It can also be used to format paragraphs in comments and doc strings.

Input:

/**
 * This is a very long line in a Doxygen comment that takes a lot of space
 */

Output:

/**
 * This is a very long line in a
 * Doxygen comment that takes a lot of
 * space
 */

Installation

The recommended way is to use pipx to install dfmt. You can also use pip directly if you know what you are doing.

Usage

Send the text to stdin, and dfmt will write the results to stdout.

By default, text is wrapped at 80 characters. You can use the -w,–width option to set a different size.

As such, dfmt can be used in a number of text editors.

How it works

dfmt contains an hard-coded list of known prefixes.

It will start by splitting the input in “regions” that start with the same prefix.

Then it will use the textwrap module from the Python standard library to wrap each region while keeping the existing prefix.

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

dfmt-1.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

dfmt-1.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file dfmt-1.1.0.tar.gz.

File metadata

  • Download URL: dfmt-1.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.3 Linux/5.7.9-arch1-1

File hashes

Hashes for dfmt-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f1a05fbbd57cf756a24fe91104005b6598f992c92b8cb88c91d4b046f52019c6
MD5 51067d00a06099090ef64a3747c9f65d
BLAKE2b-256 3195d4192b0d945d6ae1cda23aa8f61eab912bcab5787fa71302ec3f4cec4ef5

See more details on using hashes here.

File details

Details for the file dfmt-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: dfmt-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.3 Linux/5.7.9-arch1-1

File hashes

Hashes for dfmt-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2701f185306c67fac6c26ceda190a6f3a4d01c54f30a69b17bf7be6f87c48ac4
MD5 813b38860196cc387caca0c42a6a2804
BLAKE2b-256 3c201eb3ffd9c6e15161bb91661d3781b3d13c03b3c2bab002bce314c4352b82

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