{"id":5521,"library":"toml-fmt-common","title":"toml-fmt-common","description":"toml-fmt-common is an internal utility library providing common logic for TOML formatters within the `toml-fmt` project, such as `pyproject-fmt` and `tox-toml-fmt`. While a PyPI package exists (current version 1.3.2), its primary purpose is as a dependency for other tools, not for direct end-user interaction. The development of its code has moved into the `tox-dev/toml-fmt` monorepo, where it is actively maintained as part of a larger ecosystem with frequent releases for its consuming projects.","status":"active","version":"1.3.2","language":"python","source_language":"en","source_url":"https://github.com/tox-dev/toml-fmt/tree/main/toml-fmt-common","tags":["TOML","formatter","utility","internal-library","configuration"],"install":[{"cmd":"pip install toml-fmt-common","lang":"bash","label":"Install PyPI package"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false}],"imports":[],"quickstart":{"code":"# toml-fmt-common is primarily an internal library and not designed for direct end-user import or standalone quickstart usage.","lang":"python","description":"This library is intended for internal use by other `toml-fmt` projects (e.g., `pyproject-fmt`, `tox-toml-fmt`) and does not provide a public API for direct consumption by end-users. Attempting to use it directly may result in unstable or undocumented behavior."},"warnings":[{"fix":"Instead of `toml-fmt-common`, use higher-level tools like `pyproject-fmt` or `tox-toml-fmt` which are designed for user interaction.","message":"This library is explicitly noted as 'meant to only be used by that project' (referring to the toml-fmt umbrella). Direct import and usage by end-users is not recommended and may lead to unexpected behavior or API instability, as its internal structure can change without warning.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For the latest source code and development, refer to `https://github.com/tox-dev/toml-fmt/tree/main/toml-fmt-common`.","message":"The standalone `tox-dev/toml-fmt-common` GitHub repository is deprecated. Its code and development have been migrated into the `tox-dev/toml-fmt` monorepo. While the PyPI package `toml-fmt-common` still exists and is updated, active development happens within the monorepo structure.","severity":"deprecated","affected_versions":"All versions of the standalone repository"},{"fix":"Ensure you are using the latest versions of `pyproject-fmt` or `tox-toml-fmt` to benefit from these internal fixes. Avoid direct manipulation of `toml-fmt-common`'s internals.","message":"Past issues have included panics when encountering non-array nodes in array operations and unintended write checks in `--check` and `--stdout` modes. While fixes have been applied, this highlights the potential for internal logic quirks if directly interacting with the library's components outside of its intended `toml-fmt` ecosystem.","severity":"gotcha","affected_versions":"<= 1.3.1 (fixed in subsequent releases of `pyproject-fmt`/`tox-toml-fmt` that consume `toml-fmt-common`)"}],"env_vars":null,"search_vec":"'/toml-fmt':73 '1.3.2':43 'activ':78 'code':65 'common':4,8,15 'configur':99 'consum':91 'current':41 'depend':50 'dev':72 'develop':62 'direct':56 'ecosystem':85 'end':58 'end-us':57 'exist':40 'fmt':3,7,24,30,35 'formatt':19,94 'frequent':87 'interact':60 'intern':11,97 'internal-librari':96 'larger':84 'librari':13,98 'logic':16 'maintain':79 'monorepo':74 'move':67 'packag':39 'part':81 'primari':45 'project':25,92 'provid':14 'purpos':46 'pypi':38 'pyproject':29 'pyproject-fmt':28 'releas':88 'toml':2,6,18,23,34,93 'toml-fmt':22 'toml-fmt-common':1,5 'tool':53 'tox':33,71 'tox-dev':70 'tox-toml-fmt':32 'user':59 'util':12,95 'version':42 'within':20","created_at":"2026-04-14T01:37:25.542794+00:00","updated_at":"2026-04-16T23:01:19.955275+00:00","problems":[{"fix":"Do not import `toml_fmt_common` directly. Instead, utilize the public interfaces of its consuming projects, such as `pyproject-fmt` or `tox-toml-fmt`, to format TOML files.","cause":"The `toml-fmt-common` library is an internal utility designed as a dependency for other tools, not for direct end-user interaction or standalone import.","error":"ModuleNotFoundError: No module named 'toml_fmt_common'"},{"fix":"To format TOML files, use the dedicated command-line tools or public Python APIs provided by `pyproject-fmt` or `tox-toml-fmt`, which wrap `toml-fmt-common`'s internal logic.","cause":"Users attempting to directly call formatting functions on the `toml_fmt_common` module will encounter an AttributeError because it provides internal components, not a direct public API for formatting.","error":"AttributeError: module 'toml_fmt_common' has no attribute 'format_toml'"},{"fix":"Avoid direct imports of internal components. For TOML formatting needs, use the higher-level tools like `pyproject-fmt` or `tox-toml-fmt` that are built upon `toml-fmt-common`.","cause":"Attempting to import internal classes or submodules from `toml-fmt-common` directly will fail, as these components are part of its internal implementation and not exposed as a stable public API.","error":"ImportError: cannot import name 'TomlFormatter' from 'toml_fmt_common.formatter'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/tox-dev/toml-fmt","docs":"https://github.com/tox-dev/toml-fmt/tree/main/toml-fmt-common#toml-fmt-common","changelog":"https://github.com/tox-dev/toml-fmt/releases","pypi":"https://pypi.org/project/toml-fmt-common/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-13","next_check":"2026-07-12","install_tag":null}}