It provides with several string operation functions.
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
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
k3fmt-0.1.0.tar.gz
(8.5 kB
view details)
Built Distribution
k3fmt-0.1.0-py3-none-any.whl
(9.2 kB
view details)
File details
Details for the file k3fmt-0.1.0.tar.gz
.
File metadata
- Download URL: k3fmt-0.1.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c05bbe4e62b3e41ba0e71a4c9a00a152964346e489f1707602363cd76cf6a29e |
|
MD5 | d880b53f6bb81cb531067818390be123 |
|
BLAKE2b-256 | 3bde4c667edb3160341034330fdf981d2eda59c4cdc5dde4634974936146961b |
File details
Details for the file k3fmt-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: k3fmt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4578f33438e579cce93b99f425cd4b6c5dd2a2e71cf5dfa9f35fa02ae66da7c6 |
|
MD5 | 014ebec9929b9c031975c1e83baef24a |
|
BLAKE2b-256 | 1212a6609da80d54b4ec4433bbf980b380f2c8a1bcc802749aa729fd32f1916c |