{"id":27578,"library":"adaptix","title":"Adaptix","description":"An extremely flexible and configurable data model conversion library for Python 3.10+, currently at v3.0.0b12. It allows loading, dumping, and conversion between different model types (dataclasses, pydantic, msgspec, SQLAlchemy, etc.) with a powerful recipe-based provider system. The library is in active beta development with frequent releases.","status":"active","version":"3.0.0b12","language":"python","source_language":"en","source_url":"https://github.com/reagento/adaptix","tags":["serialization","conversion","dataclasses","pydantic","msgspec","sqlalchemy","model-conversion"],"install":[{"cmd":"pip install adaptix","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Optional: needed for Pydantic model support","package":"pydantic","optional":true},{"reason":"Optional: needed for msgspec model support","package":"msgspec","optional":true},{"reason":"Optional: needed for SQLAlchemy integration","package":"sqlalchemy","optional":true}],"imports":[{"note":"Recipe is a top-level export, not a submodule.","wrong":"from adaptix.recipe import Recipe","symbol":"Recipe","correct":"from adaptix import Recipe"},{"note":"loader, dumper, converter are in the conversion submodule, not top-level.","wrong":"from adaptix import loader","symbol":"loader, dumper, converter","correct":"from adaptix.conversion import loader, dumper, converter"},{"note":"ProviderNotFoundError is top-level; NoSuitableProvider was renamed in v3.0.0b7.","wrong":"from adaptix.errors import ProviderNotFoundError","symbol":"ProviderNotFoundError","correct":"from adaptix import ProviderNotFoundError"}],"quickstart":{"code":"from dataclasses import dataclass\nfrom adaptix import Recipe\nfrom adaptix.conversion import loader, dumper\n\n@dataclass\nclass User:\n    id: int\n    name: str\n\nrecipe = Recipe()\n\n# Load User from dict\ndata = {'id': 1, 'name': 'Alice'}\nload = recipe.ask(loader, User)\nuser = load(data)\nprint(user)\n\n# Dump User to dict\ndump = recipe.ask(dumper, User)\ndumped = dump(user)\nprint(dumped)","lang":"python","description":"Basic loader and dumper creation using Recipe for a dataclass."},"warnings":[{"fix":"Replace 'NoSuitableProvider' with 'ProviderNotFoundError' in your exception handlers.","message":"The 'NoSuitableProvider' exception was renamed to 'ProviderNotFoundError' in v3.0.0b7. The old name is still available as an alias but will be removed in a future version.","severity":"deprecated","affected_versions":">=3.0.0b7"},{"fix":"Create a single Recipe at application startup and reuse it.","message":"Recipe is immutable and expensive to create. Do not create a new Recipe for every conversion call; reuse the same Recipe instance for the same set of types.","severity":"gotcha","affected_versions":"all"},{"fix":"If you rely on the dumped type being a specific iterable (e.g., set), you must add a custom coercer or post-process the output.","message":"In v3.0.0b9, all iterables are now dumped to tuple (or list for list children). Previously, some iterables were dumped as generators or other types.","severity":"breaking","affected_versions":">=3.0.0b9"},{"fix":"Upgrade to >=3.0.0b7 where Optional coercer redefinition is allowed.","message":"When working with Optional types, a coercer defined for the inner type may not be applied if the destination type is exactly Optional[InnerType]. Use the special handling for Optional.","severity":"gotcha","affected_versions":"<3.0.0b7"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Ensure the type is registered (e.g., for Pydantic models, add the pydantic provider) or add a custom coercer via link.","cause":"The Recipe does not have a provider for the requested conversion, or the type cannot be automatically converted (e.g., unsupported type or missing integration).","error":"adaptix.ProviderNotFoundError: Cannot produce loader for type ..."},{"fix":"Run 'pip install adaptix'.","cause":"adaptix is not installed.","error":"ModuleNotFoundError: No module named 'adaptix'"},{"fix":"Use 'from adaptix.conversion import loader'.","cause":"Imported from wrong location; loader is in adaptix.conversion.","error":"AttributeError: module 'adaptix' has no attribute 'loader'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}