Several string operation functions for formatting and manipulation
Project description
k3fmt
It provides with several string operation functions.
k3fmt is a component of pykit3 project: a python3 toolkit set.
Name
k3fmt
It provides with several string operation functions.
Status
This library is considered production ready.
Install
pip install k3fmt
Synopsis
import k3fmt
lines = [
'hello',
'world',
]
# add left padding to each line in a string
k3fmt.line_pad('\n'.join(lines), ' ' * 4)
# " hello"
# " world"
# format a multi-row line
items = ['name:',
['John',
'j is my nick'
],
'age:',
26,
'experience:',
['2000 THU',
'2006 sina',
'2010 other'
],
]
k3fmt.format_line(items, sep=' | ', aligns='llllll')
# outputs:
# name: | John | age: | 26 | experience: | 2000 THU
# | j is my nick | | | | 2006 sina
# | | | | | 2010 other
Author
Zhang Yanpo (张炎泼) drdr.xp@gmail.com
Copyright and License
The MIT License (MIT)
Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com
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
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 k3fmt-0.1.4.tar.gz.
File metadata
- Download URL: k3fmt-0.1.4.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05e1c27626a21d9e27882a2718a71471faedc3b9031f1eb8323e4eb02127b03d
|
|
| MD5 |
4abccc0211cd1df302fd3c5d8db01324
|
|
| BLAKE2b-256 |
492fce8103225687387c9f60e57d7601ac1d76745a3fc9b8a4ff604578993cf8
|
File details
Details for the file k3fmt-0.1.4-py3-none-any.whl.
File metadata
- Download URL: k3fmt-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bb56eb7e4296c7975ed321661b05b9ad35f65933442f2310dd23e5f029bd0dc
|
|
| MD5 |
6183f78b9bd654b346e0e7cdb9cc544e
|
|
| BLAKE2b-256 |
2668e0116f1d38425da4bca6aebd845975d0b51c045a37a0761eacb75cf4c878
|