HartreeFoca / BasisSets.jl

Package to parse Basis Sets from Basis Set Exchange API
MIT License
6 stars 0 forks source link

Transforming `JSON` into `Dict` #9

Open Leticia-maria opened 1 month ago

Leticia-maria commented 1 month ago

@ChrisTimperley Have you ever tried using this package to transform JSON files into Dict: https://quinnj.github.io/JSON3.jl/stable/#JSONTables.jl I am having trouble because my JSON file is nested like this:

{
  "2zapa-nr": {
    "display_name": "2ZaPa-NR",
    "other_names": [],
    "description": "Double Zeta augmented + polarization (nonrelativistic)",
    "latest_version": "1",
    "tags": [],
    "basename": "2ZaPa-NR",
    "relpath": "",
    "family": "ranasinghe",
    "role": "orbital",
    "function_types": [
      "gto",
      "gto_spherical"
    ],
    "auxiliaries": {},
    "versions": {
      "0": {
        "file_relpath": "2ZaPa-NR.0.table.json",
        "revdesc": "Data from the original Basis Set Exchange",
        "revdate": "2016-07-11",
        "elements": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18"
        ]
      },
      "1": {
        "file_relpath": "2ZaPa-NR.1.table.json",
        "revdesc": "Data from Supplemental Information of publications",
        "revdate": "2019-06-10",
        "elements": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18"
        ]
      }
    }
  },
  "2zapa-nr-cv": {
    "display_name": "2ZaPa-NR-CV",
    "other_names": [],
    "description": "Double zeta augmented +polarization (nonrelativistic + core-valence)",
    "latest_version": "1",
    "tags": [],
    "basename": "2ZaPa-NR-CV",
    "relpath": "",
    "family": "ranasinghe",
    "role": "orbital",
    "function_types": [
      "gto",
      "gto_spherical"
    ],
    "auxiliaries": {},
    "versions": {
      "0": {
        "file_relpath": "2ZaPa-NR-CV.0.table.json",
        "revdesc": "Data from the original Basis Set Exchange",
        "revdate": "2017-10-11",
        "elements": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18"
        ]
      },
      "1": {
        "file_relpath": "2ZaPa-NR-CV.1.table.json",
        "revdesc": "Data from Supplemental Information of publications (modified)",
        "revdate": "2019-06-11",
        "elements": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18"
        ]
      }
    }
  },
  "3-21g": {
    "display_name": "3-21G",
    "other_names": [],
    "description": "3-21G Split-valence basis set",
    "latest_version": "1",
    "tags": [],
    "basename": "3-21G",
    "relpath": "",
    "family": "pople",
    "role": "orbital",
    "function_types": [
      "gto",
      "gto_cartesian"
    ],
    "auxiliaries": {},
    "versions": {
      "0": {
        "file_relpath": "3-21G.0.table.json",
        "revdesc": "Data from the Original Basis Set Exchange",
        "revdate": "2016-08-25",
        "elements": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18",
          "19",
          "20",
          "21",
          "22",
          "23",
          "24",
          "25",
          "26",
          "27",
          "28",
          "29",
          "30",
          "31",
          "32",
          "33",
          "34",
          "35",
          "36",
          "37",
          "38",
          "39",
          "40",
          "41",
          "42",
          "43",
          "44",
          "45",
          "46",
          "47",
          "48",
          "49",
          "50",
          "51",
          "52",
          "53",
          "54",
          "55"
        ]
      },
      "1": {
        "file_relpath": "3-21G.1.table.json",
        "revdesc": "Data from Gaussian 09",
        "revdate": "2019-02-21",
        "elements": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9",
          "10",
          "11",
          "12",
          "13",
          "14",
          "15",
          "16",
          "17",
          "18",
          "19",
          "20",
          "21",
          "22",
          "23",
          "24",
          "25",
          "26",
          "27",
          "28",
          "29",
          "30",
          "31",
          "32",
          "33",
          "34",
          "35",
          "36",
          "37",
          "38",
          "39",
          "40",
          "41",
          "42",
          "43",
          "44",
          "45",
          "46",
          "47",
          "48",
          "49",
          "50",
          "51",
          "52",
          "53",
          "54",
          "55"
        ]
      }
    }
  },

and it continues... (Link for the file: METADATA.json

Leticia-maria commented 1 month ago

Idea: