{"id":21503,"library":"kitchen","title":"kitchen","description":"Kitchen is a Python library containing a cornucopia of useful code, including utilities for text handling, iterables, data structures, and Python version compatibility. Current version 1.2.6 has no active development; the library is in maintenance mode. Release cadence: sporadic, last release 2016.","status":"maintenance","version":"1.2.6","language":"python","source_language":"en","source_url":"https://github.com/ampledata/kitchen","tags":["utilities","compatibility","python2","python3","text","iterables"],"install":[{"cmd":"pip install kitchen","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"For Python 2/3 compatibility utilities","package":"six","optional":false}],"imports":[{"note":"iterate is in iterutils, not text","wrong":"from kitchen.text import iterate","symbol":"iterutils","correct":"from kitchen.iterutils import iterate"},{"note":"Correct import path uses full module path","wrong":"from kitchen.text.converters import to_unicode","symbol":"text_converters","correct":"from kitchen.text import text_converters"}],"quickstart":{"code":"from kitchen.iterutils import iterate\nfrom kitchen.text import text_converters\n\n# Example: iterate over nested lists\nfor item in iterate([1, [2, 3], 4]):\n    print(item)\n\n# Example: convert bytes to unicode\nunicode_str = text_converters.to_unicode(b'hello', encoding='utf-8')\nprint(unicode_str)","lang":"python","description":"Import and use basic utilities from kitchen."},"warnings":[{"fix":"Replace with modern equivalents: use six for compatibility, or native Python 3 features.","message":"kitchen has not been updated since 2016 and is in maintenance mode. Many utilities have been superseded by standard library features (e.g., six, functools). Consider migrating to actively maintained alternatives.","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"Use Python 3's built-in `str` method or `codecs.decode` instead.","message":"The `kitchen.text` module uses old-style unicode handling. In Python 3, avoid using `kitchen.text.text_converters.to_unicode` on native strings as it may raise errors.","severity":"gotcha","affected_versions":"1.2.x"},{"fix":"Correct import: `from kitchen.iterutils import iterate`","message":"Import paths are not always intuitive. Many users mistakenly import `iterate` from `kitchen.text` instead of `kitchen.iterutils`.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from kitchen.text import text_converters`","cause":"Incorrect import path; the module is `kitchen.text.text_converters`.","error":"ModuleNotFoundError: No module named 'kitchen.text.converters'"},{"fix":"Use positional call: `text_converters.to_unicode(b'hello', 'utf-8')`","cause":"Function signature differs between versions; in 1.2.6, `to_unicode` expects `encoding` as second positional argument, not keyword.","error":"TypeError: to_unicode() got an unexpected keyword argument 'encoding'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}