Skip to main content

Several string operation functions for formatting and manipulation

Project description

k3fmt

Action-CI Build Status 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

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

k3fmt-0.1.2.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.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file k3fmt-0.1.2.tar.gz.

File metadata

  • Download URL: k3fmt-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 274a033bb48fe1bb26c21cf5cb09e1cade651ba02605e8fc7c88c7e59ca8bcc7
MD5 8197d5dc1354533433eaa56674abb843
BLAKE2b-256 09ce42109910429018f8aaba0c486f77307768dced288e96102033a1b5e2b9fe

See more details on using hashes here.

File details

Details for the file k3fmt-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: k3fmt-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8fdcfb157b8188806756a64f13ed3869335b6510b818fa89e1dd4696ca8586b9
MD5 ac2480cfea8280ca9a2338b958469027
BLAKE2b-256 2ca990889292bc4b6b9600c4eec182185c9c69d39d96805f84719d380adf3ecf

See more details on using hashes here.

Supported by

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