Skip to main content

String joiner library

Project description

String joiner

Small tool to simplify string building.

Description

Have you ever thought it would be nice to have join working as generator-function decorator? So you found one. Write your generator, put StrJoiner on top, simple as that.

Example

from str_joiner import StrJoiner

@StrJoiner()
def make_url(username, host, port = 443, path = None):
    yield 'https://'
    yield username
    yield '@'
    yield host
    yield ':'
    yield port  # str() will be used implicitly
    yield path  # will exclude if None

assert make_url('user', '127.0.0.1') == 'https://user@127.0.0.1:443'

Install

pip install str_joiner

Contributing

We'd love you to contribute! 👋 Checkout the contributing guide for help on how to help us out!

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

str_joiner-0.0.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

str_joiner-0.0.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file str_joiner-0.0.3.tar.gz.

File metadata

  • Download URL: str_joiner-0.0.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for str_joiner-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8208af0fab5fc542ef72437172a63d329c544831385980ad8f8630f4b20a5645
MD5 d55511c35771eb1c48da6d15a8575355
BLAKE2b-256 5660f4dfc31414f096e7f7918783237f811d28ccb33789510cbd3bc3bc2dfc35

See more details on using hashes here.

File details

Details for the file str_joiner-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: str_joiner-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for str_joiner-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b6a29640a55a73e8b75b17c4d117ca066bd5ab39d52ffb9272899e95be2d61de
MD5 c8827a86cb7b05e4739d9f70fa7913e6
BLAKE2b-256 0f4f8be31a2fa433b00519e176074c7ed933a8f93c002049a3731210213470ff

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