Format Iterables
Project description
list-fmt
Format iterables into human readable text.
Installation
pip install list-fmt
Basic Usage
>>> from listfmt import join_with
>>> L = ["one", "two", "three"]
>>> join_with(L, join_last = " and ")
'one, two and three'
>>>
>>> from listfmt import strjoin
>>> strjoin(", ", [1, 2, 3])
'1, 2, 3'
>>>
>>> from list import ordered_list
>>> print(ordered_list(["one", "two", "three"], style = "A"))
A. one
B. two
C. three
>>>
>>> from listfmt import unordered_list
>>> print(unordered_list(["one", "two", ["a", "b"], "three"], recursive = True))
* one
* two
* a
* b
* three
>>>
Links
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
list-fmt-0.0.1.tar.gz
(3.6 kB
view details)
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 list-fmt-0.0.1.tar.gz.
File metadata
- Download URL: list-fmt-0.0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c571bc94393c303f4e520ad1539304b834d082865d7de5534d9e122bc5ee7a01
|
|
| MD5 |
7777ccfb73a8caea2ba4a18e3521adf3
|
|
| BLAKE2b-256 |
369f34840595e2e44a7dcba705d56fafac2d2532d5d6a1ea25a2e4ef085e6532
|
File details
Details for the file list_fmt-0.0.1-py3-none-any.whl.
File metadata
- Download URL: list_fmt-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d36d4ff350a1be03f4a214ccd14160d862f20cf45e68930646b4b388e52887b
|
|
| MD5 |
36d72ea2f1a0f6624d0a57ad59ce8370
|
|
| BLAKE2b-256 |
86359295c63bf677455d3860d21f66e096a7d58d2f18d637a97b52836219d221
|