{"id":15447462,"url":"https://github.com/datadavev/naan_reg_json","last_synced_at":"2025-03-28T08:44:15.627Z","repository":{"id":228798188,"uuid":"629062221","full_name":"datadavev/naan_reg_json","owner":"datadavev","description":"NAAN registry to JSON tool with JSON schema and documentation","archived":false,"fork":false,"pushed_at":"2023-05-02T17:59:38.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T09:27:16.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datadavev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-17T14:38:47.000Z","updated_at":"2023-04-17T14:41:36.000Z","dependencies_parsed_at":"2024-03-20T14:54:37.202Z","dependency_job_id":null,"html_url":"https://github.com/datadavev/naan_reg_json","commit_stats":null,"previous_names":["datadavev/naan_reg_json"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datadavev%2Fnaan_reg_json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datadavev%2Fnaan_reg_json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datadavev%2Fnaan_reg_json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datadavev%2Fnaan_reg_json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datadavev","download_url":"https://codeload.github.com/datadavev/naan_reg_json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999318,"owners_count":20707554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T20:06:00.477Z","updated_at":"2025-03-28T08:44:15.603Z","avatar_url":"https://github.com/datadavev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# naan_reg_json\n\n`naan_reg_json` provides a tool for converting NAAN registry ANVL to JSON. It \nincludes JSON-schema with generated docuemntation for private and publicly \nvisible NAAN records.\n\n\n## Usage\n\n```\n$python naan_reg_json.py --help\nusage: naan_reg_json.py [-h] [-s] [-p] [path]\n\nGenerate JSON representation of naan_reg_priv/main_naans. This tool translates the \nNAAN registry file from ANVL to JSON to assist downstream programmatic use. If pydantic \nis installed then the script can output JSON schema describing the JSON respresentation \nof the transformed NAAN entries.\n\npositional arguments:\n  path          Path to naan_reg_priv ANVL file.\n\noptional arguments:\n  -h, --help    show this help message and exit\n  -s, --schema  Generate JSON schema and exit.\n  -p, --public  Output public content only.\n```\n\nFor conversion from ANVL to JSON no additional dependencies are needed beyond Python3.8+. E.g. (portions redacted):\n\n```\n$python naan_reg_json.py ../naan_reg_priv/main_naans\n\n{\n  \"12025\": {\n    \"what\": \"12025\",\n    \"where\": \"http://www.nlm.nih.gov\",\n    \"target\": \"http://www.nlm.nih.gov/$arkpid\",\n    \"when\": \"2001-03-08T00:00:00+00:00\",\n    \"who\": {\n      \"name\": \"US National Library of Medicine\",\n      \"acronym\": null,\n      \"address\": \"#REDACTED#\"\n    },\n    \"na_policy\": {\n      \"orgtype\": \"NP\",\n      \"policy\": \"(:unkn) unknown\",\n      \"tenure\": \"2001\",\n      \"policy_url\": null\n    },\n    \"why\": \"ARK\",\n    \"contact\": {\n      \"name\": \"#REDACTED#\",\n      \"unit\": null,\n      \"tenure\": null,\n      \"email\": \"#REDACTED#\",\n      \"phone\": \"#REDACTED#\"\n    },\n    \"comments\": null,\n    \"provider\": null\n  },\n  ...\n```\n\nA public view of the ANVL to JSON can be generated using the `-p` or `--public` option:\n\n```\n$python naan_reg_json.py -p ../naan_reg_priv/main_naans\n\n{\n  \"12025\": {\n    \"what\": \"12025\",\n    \"where\": \"http://www.nlm.nih.gov\",\n    \"target\": \"http://www.nlm.nih.gov/$arkpid\",\n    \"when\": \"2001-03-08T00:00:00+00:00\",\n    \"who\": {\n      \"name\": \"US National Library of Medicine\",\n      \"acronym\": null\n    },\n    \"na_policy\": {\n      \"orgtype\": \"NP\",\n      \"policy\": \"(:unkn) unknown\",\n      \"tenure\": \"2001\",\n      \"policy_url\": null\n    }\n  },\n```\n\nFor JSON-schema generation, `pydantic` is required:\n```\npip install pydantic\n```\n\nThe public view and full view have different schemas, they can be generated like:\n```\n$python naan_reg_json.py -s \u003e schema/naan_schema.json\n```\nand\n```\n$python naan_reg_json.py -s -p \u003e schema/naan_schema_public.json\n```\n\nSchema documentation can be generated if `json-schema-for-humans` is installed:\n```\npip install json-schema-for-humans\n```\n\nTo generate the schema documentation:\n```\ngenerate-schema-doc --config-file docs_config.yaml ./schema ./schema/\n```\n\n## Acknowledgement\n\nThis work is supported in part by the California Digital Library.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadavev%2Fnaan_reg_json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadavev%2Fnaan_reg_json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadavev%2Fnaan_reg_json/lists"}