Skip to main content

Convert a string to bytes type or str type

Project description

textconv

A bulletproof way of converting a string to a byte string or a text string.

APIs are designed to encode or decode raise-free. In most cases, input object will be either a text string (str type) or a byte string (bytes type), and default encoding is 'utf-8'.

Usage:

from textconv.text import to_text, to_bytes

# To text string
text_string = to_text(b'caf\xc3\xa9')

# To byte string
byte_string = to_bytes(u'caf\xe9', encoding="latin-1")

# A raise-free version of `str(obj)`
# if a non-string object is  provided
text_string = to_text(obj)

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

textconv-0.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

textconv-0.0.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file textconv-0.0.1.tar.gz.

File metadata

  • Download URL: textconv-0.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.6

File hashes

Hashes for textconv-0.0.1.tar.gz
Algorithm Hash digest
SHA256 12268a768096d4830b292b089d5d89eb97236ec3a278540dae45782006a3aa65
MD5 29b6ba68fb06894c8fc710330c59c9ba
BLAKE2b-256 7c7569d49e397109fff133eb6fe813945915f77df02e2007ec4b688430ec41a8

See more details on using hashes here.

File details

Details for the file textconv-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: textconv-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.6

File hashes

Hashes for textconv-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cdf495f093a6b5eb8b19f30610720579579ab588e2a82206b17156a8850b5bd
MD5 4b06dfd15c9a2acc6839077ac1a3c276
BLAKE2b-256 d709ecea9d67d08e0ad5bc6a93f72f6174fe881ee28e90877f2533193dbe84a1

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