--- id: morphys version: "1.0" license: MIT license_treatment: permissive maintenance: abandoned --- # morphys — Smart conversions between unicode and bytes types for common cases License: permissive · Maintenance: abandoned · Downloads: 196.6K/mo ## What it is and what it does Morphys is a lightweight utility library for handling the inconsistency between unicode and bytes types in Python 2, where non-ASCII characters can cause unexpected errors. It provides two main conversion functions—ensure_bytes() and ensure_unicode()—that intelligently convert between types only when necessary, and a StrMorpher class that wraps a string to behave as either type on demand. The library also supports custom encodings and defaults to utf-8. While the package remains compatible with Python 3, it has received no maintenance since 2017-01-10 and was designed primarily for Python 2's unicode/bytes complexity, making it largely obsolete for new projects. Use it for: - Normalize inconsistent string types from libraries that return either bytes or unicode unpredictably - Handle legacy codebases that mix unicode and bytes strings without explicit type checking - Wrap strings in StrMorpher when code needs to accept both bytes and unicode interchangeably - Ensure consistent string type handling before passing data to functions with strict type requirements ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Morphys provides utility functions to convert between unicode and bytes types, handling encoding/decoding transparently and returning objects unchanged if already the correct type. No. The package is abandoned (last update 2017-01-06) and designed primarily for Python 2. While it has no known vulnerabilities and installs easily, modern Python 3 projects have no practical need for this library. Only consider it for maintaining legacy Python 2 codebases. ## Install pip install morphys uv add morphys poetry add morphys ## Installing morphys Before you install: Installation is frictionless with no runtime dependencies. However, the package has been abandoned since its single release with no updates since 2017-01-06, making it unsuitable for active projects. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal restrictions, suitable for both open-source and proprietary projects. Quickstart: pip install morphys from morphys import ensure_bytes, ensure_unicode result = ensure_unicode(b'hello') result = ensure_bytes('hello') Verify before relying: - Whether ensure_bytes and ensure_unicode handle all edge cases with non-ASCII content reliably - Whether StrMorpher's lazy conversion approach works correctly across all contexts - Current compatibility with modern Python 3 versions beyond the unspecified support claim ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 196.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags unicode bytes conversion, string type coercion, ensure bytes unicode, python 2 string handling, smart string conversion, bytes unicode wrapper, encoding decoding utilities, python-2-legacy, string-handling [View on SkillFed](https://skillfed.io/packages/morphys) · [View on PyPI](https://pypi.org/project/morphys/)