Skip to main content
Abbreviate
==========

This filter attempts to automatically and intelligently abbreviate strings.

This library contains a dictionary of known abbreviations. Some words have
multiple abbreviations, e.g. Thursday could be abbreviated as any of Thurs,
Thur, Thr, Th, or T depending on context. With no other information, each word
has a "preferred abbreviation" (Thr), however options can push things one way
or another. For words without known abbreviations, a series of heuristics are
applied to shorten them as needed.

The basic `abbreviate` method will only apply preferred abbreviations and
no heuristics. For more advanced applications, the library can be given a
target length and effort, and will attempt to generate the best string
possible. Length can be supplied either as a simple character count, or with a
custom length function. The latter is useful in many graphics applications
without monospaced fonts or constant kerning. By default, abbreviate will not
shorten any exisiting abbreviations (e.g. Thur -> Th), assuming that any
explicit abbreviation was passed as such for a reason.

Issues, updates, pull requests, etc should be directed
`to github <https://github.com/ppannuto/python-abbreviate`__.


State
-----

This tool was written to scratch an immediate itch and is thus quite
incomplete, but with extensibility and somewhat grander ideas in mind.
Architectural thoughts, radical changes to methodology, or just greater
abbreviations are all welcome.

Installation
------------

The easiest method is to simply use pip:

::

(sudo) pip install abbreviate

Usage
-----

TODO

Release files for abbreviate 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abbreviate 0.1.1
File Size Uploaded
abbreviate-0.1.1.tar.gz 5.4 kB Details

Release files / abbreviate-0.1.1.tar.gz

Download URL abbreviate-0.1.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8c69746641d206489bb5d6066f44ac87de855b9293c8ea53ef26cee8b9ab5db7
BLAKE2b-256 checksum
How to use checksums
7c4881640df7777d5213347b5eda5e38d048e30433e4448919b72d2e94414de4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page