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

Uploaded Python 3

File details

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

File metadata

  • Download URL: k3fmt-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6cee3fc41f394491a04a30fd93ae8fea4c0c80021d471fe48710d2042bce01b4
MD5 4ca2c82a22666e01c54e08f9de283360
BLAKE2b-256 27c5c7c50aec34b7a8e523d332630bf1e2a939228d1b4f17cfd7d3826c2be828

See more details on using hashes here.

File details

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

File metadata

  • Download URL: k3fmt-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ef24069ab9cb2d2f4490423ed0f40b61414e678bcbd0667ca1b1866bba9cc2a
MD5 07a5979290d35f37d0ecf1520e197a1c
BLAKE2b-256 179600434220080a71b138d4cc26e9ebd7e6fcbd17a73604b42920e709c23576

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