{"id":4705,"library":"pyiotools","title":"pyiotools","description":"pyiotools is a Python library that offers various utilities for handling I/O operations, including an IOHandler class for collecting input programmatically, via command-line, or GUI with an API similar to `argparse`. It also includes utilities for caching, serialization, and secret management. The library is actively maintained with frequent minor releases, currently at version 0.3.18, but is explicitly noted as being under active development with a warning that its API may undergo significant breaking changes.","status":"active","version":"0.3.18","language":"en","source_language":"en","source_url":"https://github.com/matthewgdv/iotools","tags":["io","input","argparse-like","caching","serialization","utilities","development-stage"],"install":[{"cmd":"pip install pyiotools","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Top-level classes are exposed directly under the `iotools` namespace.","wrong":"import iotools.IOHandler","symbol":"IOHandler","correct":"from iotools import IOHandler"},{"symbol":"Cache","correct":"from iotools import Cache"},{"symbol":"Secrets","correct":"from iotools import Secrets"},{"symbol":"Serializer","correct":"from iotools import Serializer"},{"symbol":"Console","correct":"from iotools import Console"}],"quickstart":{"code":"import os\nfrom iotools import IOHandler, Cache\n\n# 1. Using IOHandler (similar to argparse)\n# Create an IOHandler instance for input collection\nprogram_io = IOHandler(\n    'my_app', \n    'A simple application demonstrating iotools input handling.'\n)\nprogram_io.add_argument('--name', help='Your name', default='Guest')\nprogram_io.add_argument('--verbose', action='store_true', help='Enable verbose output')\n\n# In a real script, this would parse sys.argv.\n# For programmatic quickstart, we simulate parsed arguments.\nclass MockArgs:\n    def __init__(self, name, verbose):\n        self.name = name\n        self.verbose = verbose\n\n# Use environment variables to make it runnable for testing\nargs = MockArgs(\n    name=os.environ.get('IOT_NAME', 'User'),\n    verbose=os.environ.get('IOT_VERBOSE', 'False').lower() == 'true'\n)\n\nprint(f\"Hello, {args.name}!\")\nif args.verbose:\n    print(\"Verbose output enabled.\")\n\n# 2. Using Cache for persistent data storage\ncache_name = os.environ.get('IOT_CACHE_NAME', 'my_app_data')\nmy_cache = Cache(cache_name)\n\n# Put and get data\nmy_cache.put('favorite_color', os.environ.get('IOT_COLOR', 'blue'))\nprint(f\"Favorite color from cache: {my_cache.get('favorite_color')}\")\n\n# Update data\nmy_cache.put('favorite_color', 'red')\nprint(f\"Updated favorite color: {my_cache.get('favorite_color')}\")\n\n# Pop data\npopped_color = my_cache.pop('favorite_color')\nprint(f\"Popped favorite color: {popped_color}\")\nprint(f\"Is favorite_color still in cache? {my_cache.get('favorite_color', 'Not Found')}\")","lang":"python","description":"This quickstart demonstrates the core `IOHandler` for defining and (simulated) parsing arguments, and the `Cache` utility for simple persistent key-value storage. It uses environment variables to make the example interactive and runnable."},"warnings":[{"fix":"Users should expect frequent API changes and be prepared to update their code with each new release. Monitor the GitHub repository for updates and review release notes carefully.","message":"The `pyiotools` library is explicitly stated as being 'under development'. Its API will likely undergo significant changes that may break existing code, and documentation may not always be up-to-date with the latest changes.","severity":"breaking","affected_versions":"0.x.x (all current versions)"},{"fix":"Ensure `dill` is installed: `pip install dill` if you plan to use `Cache` or `Serializer` features.","message":"The `Cache` and `Serializer` classes utilize `dill` for serialization. While `pyiotools` itself does not list `dill` as a direct dependency on PyPI, it is an implicit dependency for these features. If you use `Cache` or `Serializer`, you might need to install `dill` explicitly.","severity":"gotcha","affected_versions":"0.x.x (all versions using Cache/Serializer)"},{"fix":"Always use a different name for your script files than the libraries you are importing (e.g., `my_script.py` instead of `iotools.py`).","message":"Naming your Python script the same as the imported module (e.g., `iotools.py` importing `from iotools import IOHandler`) can lead to import errors or circular import issues, as Python might try to import your local file instead of the installed package.","severity":"gotcha","affected_versions":"All versions of Python"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}