eric.convert_eric_csv_to_json ============================= .. py:module:: eric.convert_eric_csv_to_json .. autoapi-nested-parse:: Convert ERIC open records CSV to JSON. ERIC_open_records.csv must exist in the same directory as this script. ERIC_open_records.json must not exist before running this script. Edit ERIC_open_records.csv in a text editor and change the first line (column headers): id,pdf-url,title,description,e_fulltextauth,source,publicationdateyear,abstractor, peerreviewed,e_yearadded,iesfunded,e_datemodified,publisher,ieslinkpublication,url, sourceid,ieswwcreviewed,ieslinkwwcreviewguide,ieslinkdatasource,subject,author, authorxlink,educationlevel,publicationtype,iesgrantcontractnum, iesgrantcontractnumxlink,language,institution,identifiersgeo,sponsor,identifierstest, issn,iescited,identifierslaw,audience,isbn This removes instances of `_ - ` and duplicates of the form `x - x`. Convert the data in the CSV file to a JSON file. * uv run --script convert_eric_csv_to_json.py Format the JSON file with Python's built-in json.tool: * python3 -m json.tool ERIC_open_records.json ERIC_open_records.json Make a pydantic model from the JSON file: * uv tool run --from=datamodel-code-generator datamodel-codegen --input ERIC_open_records.json --input-file-type json --output eric_models.py Attributes ---------- .. autoapisummary:: eric.convert_eric_csv_to_json.here eric.convert_eric_csv_to_json.msg Module Contents --------------- .. py:data:: here .. py:data:: msg :value: 'Will not overwrite existing file: Uninferable'