Skip to main content

k3fmt

Action-CI Documentation Status Package

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

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.4.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

k3fmt-0.1.4-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

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

Hashes for k3fmt-0.1.4.tar.gz
Algorithm Hash digest
SHA256 05e1c27626a21d9e27882a2718a71471faedc3b9031f1eb8323e4eb02127b03d
MD5 4abccc0211cd1df302fd3c5d8db01324
BLAKE2b-256 492fce8103225687387c9f60e57d7601ac1d76745a3fc9b8a4ff604578993cf8

See more details on using hashes here.

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

Hashes for k3fmt-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0bb56eb7e4296c7975ed321661b05b9ad35f65933442f2310dd23e5f029bd0dc
MD5 6183f78b9bd654b346e0e7cdb9cc544e
BLAKE2b-256 2668e0116f1d38425da4bca6aebd845975d0b51c045a37a0761eacb75cf4c878

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page