File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ # /// script
2+ # requires-python = ">=3.13"
3+ # dependencies = [
4+ # "pyyaml",
5+ # "flask",
6+ # "idutils",
7+ # "marshmallow",
8+ # "marshmallow_utils",
9+ # "flask_resources",
10+ # "invenio_records",
11+ # "invenio_db",
12+ # "zenodo-legacy",
13+ # "zenodo-rdm",
14+ # ]
15+ #
16+ # [tool.uv.sources]
17+ # zenodo-rdm = { git = "https://github.com/zenodo/zenodo-rdm.git", subdirectory = "site", rev = "v21.0.2" }
18+ # zenodo-legacy = { git = "https://github.com/zenodo/zenodo-rdm.git", subdirectory = "legacy", rev = "v21.0.2" }
19+ # ///
20+
21+ # This script checks whether Zenodo will accept a CITATION.cff file
22+ from pathlib import Path
23+
24+ import yaml
25+ from zenodo_rdm .github .schemas import CitationMetadataSchema
26+ from zenodo_rdm .legacy .deserializers .schemas import LegacySchema
27+
28+
29+ def main () -> None :
30+ contents = Path ("CITATION.cff" ).read_text ()
31+ data = yaml .safe_load (contents )
32+ legacy_data = {"metadata" : CitationMetadataSchema ().load (data )}
33+ rdm_data = LegacySchema ().load (legacy_data )
34+ print (rdm_data ["metadata" ])
35+
36+
37+ if __name__ == "__main__" :
38+ main ()
You can’t perform that action at this time.
0 commit comments