Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 26, 2024
1 parent 11e8adb commit fac821d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions prepareJsons_and_Bib.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"metadata": {},
"outputs": [],
"source": [
"import datetime,json\n",
"import datetime, json\n",
"import pandas as pd"
]
},
Expand Down Expand Up @@ -52,7 +52,12 @@
"metadata": {},
"outputs": [],
"source": [
"pprint.pprint(confs.to_json(orient='records',date_format=\"iso\",))"
"pprint.pprint(\n",
" confs.to_json(\n",
" orient=\"records\",\n",
" date_format=\"iso\",\n",
" )\n",
")"
]
},
{
Expand All @@ -61,9 +66,11 @@
"metadata": {},
"outputs": [],
"source": [
"result = confs.sort_values(\"date\",ascending=False).to_json(orient=\"records\",date_format='iso')\n",
"result = confs.sort_values(\"date\", ascending=False).to_json(\n",
" orient=\"records\", date_format=\"iso\"\n",
")\n",
"parsed = json.loads(result)\n",
"json.dump(parsed,open(\"_data/sorted_confs.json\",'w'), indent=4) "
"json.dump(parsed, open(\"_data/sorted_confs.json\", \"w\"), indent=4)"
]
},
{
Expand All @@ -80,7 +87,8 @@
"outputs": [],
"source": [
"import requests\n",
"url = 'https://inspirehep.net/api/literature?sort=mostrecent&size=25&page=1&q=a Guillermo.Fidalgo.1&format=bibtex'\n",
"\n",
"url = \"https://inspirehep.net/api/literature?sort=mostrecent&size=25&page=1&q=a Guillermo.Fidalgo.1&format=bibtex\"\n",
"inspire = requests.get(url).text\n",
"# response = requests.get('https://inspirehep.net/api/literature?sort=mostrecent&size=25&page=1&q=Guillermo%20Fidalgo')\n",
"# url = response.json()['links']['bibtex']\n",
Expand Down Expand Up @@ -123,7 +131,7 @@
"metadata": {},
"outputs": [],
"source": [
"with open(\"bibfile.bib\",'w') as f:\n",
"with open(\"bibfile.bib\", \"w\") as f:\n",
" f.write(inspire)\n",
" f.write(zenodo)"
]
Expand Down

0 comments on commit fac821d

Please sign in to comment.