codemeticulous validates and converts software metadata with Pydantic v2.
The neutral SoftwareMetadata model is the hub for the currently supported
outbound graph:
codemeta -> software-metadata
-> codemeta
-> cff
-> datacite
CodeMeta v3 is the only supported input format. CFF and DataCite ingestion is
deferred. Conversions return a ConversionResult; its value is the target
model and its ordered issues describe non-fatal information loss.
pip install codemeticulousFor development, install with uv:
uv sync --group devfrom codemeticulous import convert
result = convert(
"codemeta",
"cff",
{
"@type": "SoftwareSourceCode",
"name": "My Tool",
"author": {"@type": "Person", "name": "Example Author"},
},
)
print(result.value)
for issue in result.issues:
print(issue.path, issue.message)Input validation and target construction failures raise ConversionError.
Issues are warnings: they do not make a successful conversion fail.
codemeticulous convert --from codemeta --to cff codemeta.json > CITATION.cff
codemeticulous validate --format cff CITATION.cffConversion issues are printed to stderr while the target document is printed
to stdout. Invalid input, unsupported directions, validation failures, and
serialization failures exit nonzero. validate is independent of conversion
and supports format-specific validation for CodeMeta, CFF, and DataCite.
uv run python -m pytest -q