Skip to content
Snippets Groups Projects
Commit a10f9bc8 authored by Georges Gressot's avatar Georges Gressot :speech_balloon:
Browse files

new

parent feb22792
Branches
Tags
No related merge requests found
%% Cell type:code id: tags:
```
# @title String fields
Nom_du_labo = '' # @param {"type":"string","placeholder":"Par exemple : isis"}
Code_labo = '' # @param {"type":"string","placeholder":"Par exemple : 207480"}
# @title Date fields
Date_de_début = '2016-01-01' # @param {type:"date"}
Date_de_fin = '' # @param {type:"date"}
```
%% Cell type:code id: tags:
```
import requests
import io
import pandas as pd
# The API endpoint
url = "https://api.archives-ouvertes.fr/search/UNIV-STRASBG/?fq=structId_i:" + \
Code_labo + "&rows=20000&wt=csv&fq=publicationDate_tdate:%5B" + Date_de_début +\
"T00:00:00Z%20TO%20" + Date_de_fin + "T00:00:00Z%5D&fq=-doiId_s"
# A GET request to the API
response = requests.get(url)
df = pd.read_csv(io.StringIO(response.text))
try:
test = df.halId_s
print("Cliquez sur le lien suivant pour télécharger votre extraction : {}".format(url))
except:
print("Vérifiez vos saisies ou recommencez plus tard.")
exit()
```
%% Output
Cliquez sur le lien suivant pour télécharger votre extraction : https://api.archives-ouvertes.fr/search/UNIV-STRASBG/?fq=structId_i:207480&rows=20000&wt=csv&fq=publicationDate_tdate:%5B2016-01-01T00:00:00Z%20TO%202024-11-20T00:00:00Z%5D&fq=-doiId_s
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment