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

Uploaded Python 3

File details

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

File metadata

  • Download URL: k3fmt-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 d48043fd0a26067b747741fca4038eaec9bc0eb1b49b866540f5ad663e870aa3
MD5 0a7d162e43d518682578012c935d40d2
BLAKE2b-256 1071b431ba353cfee265021bf5bf350a6c7be44b15d1ac053d2907f8b3a26511

See more details on using hashes here.

File details

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

File metadata

  • Download URL: k3fmt-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 408afeca2da770f490d491cfa251ba38ffc702276f6f8b81bad575c507694df5
MD5 bd35cb44de61453cea145efbd0a0e112
BLAKE2b-256 794505a8f061725d02ce167661cba1065b9ea60ce27d025c0103059ffa9ba574

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