Skip to main content

It provides with several string operation functions.

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

Uploaded Source

Built Distribution

k3fmt-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

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

Hashes for k3fmt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c05bbe4e62b3e41ba0e71a4c9a00a152964346e489f1707602363cd76cf6a29e
MD5 d880b53f6bb81cb531067818390be123
BLAKE2b-256 3bde4c667edb3160341034330fdf981d2eda59c4cdc5dde4634974936146961b

See more details on using hashes here.

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

Hashes for k3fmt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4578f33438e579cce93b99f425cd4b6c5dd2a2e71cf5dfa9f35fa02ae66da7c6
MD5 014ebec9929b9c031975c1e83baef24a
BLAKE2b-256 1212a6609da80d54b4ec4433bbf980b380f2c8a1bcc802749aa729fd32f1916c

See more details on using hashes here.

Supported by

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