Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GarganTexternal tools
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anne-Laure Thomas Derepas
GarganTexternal tools
Commits
709099dd
Commit
709099dd
authored
Sep 11, 2023
by
Loïc Chapron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix isidore and name output file
parent
42b61e63
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
20 deletions
+34
-20
text_HALToGarganText.csv
Streamlit/lang/text_HALToGarganText.csv
+1
-1
text_IsidoreToGarganText.csv
Streamlit/lang/text_IsidoreToGarganText.csv
+7
-7
HAL_To_GarganText.py
Streamlit/pages/HAL_To_GarganText.py
+4
-2
Isidore_To_GarganText.py
Streamlit/pages/Isidore_To_GarganText.py
+17
-6
Istex_To_GarganText.py
Streamlit/pages/Istex_To_GarganText.py
+2
-2
Zotero_To_GarganText.py
Streamlit/pages/Zotero_To_GarganText.py
+3
-2
No files found.
Streamlit/lang/text_HALToGarganText.csv
View file @
709099dd
...
...
@@ -31,5 +31,5 @@ en,perform2," the maximum number of documents"
fr,nb_taken,"Nombres de documents à prendre"
en,nb_taken,"Number of documents to take"
fr,createTSV,"Création du fichier TSV (Cela peut prendre quelque minutes)"
fr,createTSV,"Création du fichier TSV (Cela peut prendre quelque
s
minutes)"
en,createTSV,"Creation of the TSV file (It may take a while)"
Streamlit/lang/text_IsidoreToGarganText.csv
View file @
709099dd
...
...
@@ -2,7 +2,7 @@ locale,key,value
fr,title,"# Isidore vers GarganText"
en,title,"# Isidore To GarganText"
fr,text,"Effectue une recherche Isidore de documents scientifiques et les converti
r
en un fichier TSV."
fr,text,"Effectue une recherche Isidore de documents scientifiques et les converti
t
en un fichier TSV."
en,text,"Do a Isidore scientific documents research and convert it into a TSV file."
fr,keyword,"Mots clés"
...
...
@@ -17,21 +17,21 @@ en,submit,"Submit"
fr,load_api,"Chargement de l'api..."
en,load_api,"Loading API..."
fr,overload_api,"L'API est surchargé, relancer la requête dans quelques secondes"
en,overload'api,"The API is overloaded, please retry the request in a few seconds"
fr,overload_api,"L'API est surchargé, relancer la requête dans quelques secondes
.
"
en,overload'api,"The API is overloaded, please retry the request in a few seconds
.
"
fr,nb_doc,"Nombres de documents : "
en,nb_doc,"Numbers of documents : "
fr,perform1,"Pour des raisons de performence, on limit à "
fr,perform2," le nombre
de document maximum
"
fr,perform1,"Pour des raisons de performence, on limit
e
à "
fr,perform2," le nombre
maximum de documents.
"
en,perform1,"For performance reasons, we limit to "
en,perform2,"
the maximum number of documents
"
en,perform2,"
,the maximum number of documents.
"
fr,nb_taken,"Nombres de documents à prendre"
en,nb_taken,"Number of documents to take"
fr,createTSV,"Création du fichier TSV (Cela peut prendre quelque minutes)"
fr,createTSV,"Création du fichier TSV (Cela peut prendre quelque
s
minutes)"
en,createTSV,"Creation of the TSV file (It may take a while)"
fr,doc_abstract1,"Il y a "
...
...
Streamlit/pages/HAL_To_GarganText.py
View file @
709099dd
...
...
@@ -190,5 +190,7 @@ if st.session_state.stage_isidore > 1:
print
(
st
.
session_state
.
nb_wanted
)
st
.
session_state
.
output
=
create_output
(
st
.
session_state
.
search
,
lang
[
st
.
session_state
.
language
],
st
.
session_state
.
nb_wanted
)
st
.
download_button
(
'Download TSV'
,
st
.
session_state
.
output
,
'output.csv'
)
fileName
=
"HALOutput_"
+
str
(
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d_
%
H:
%
M:
%
S"
))
+
'.csv'
st
.
download_button
(
'Download TSV'
,
st
.
session_state
.
output
,
fileName
)
Streamlit/pages/Isidore_To_GarganText.py
View file @
709099dd
...
...
@@ -7,6 +7,7 @@ import streamlit as st
import
requests
as
req
import
json
import
time
from
datetime
import
datetime
from
json
import
JSONDecodeError
import
src.basic
as
tmp
...
...
@@ -64,11 +65,16 @@ def create_output(search, language, nb_doc):
break
time
.
sleep
(
retryTime
)
print
(
'Retry'
)
tmp
,
nb_tmp
=
createFile
(
txt
,
n
b_doc
%
n
umberReplies
,
language
)
tmp
,
nb_tmp
=
createFile
(
txt
,
numberReplies
,
language
)
output
+=
tmp
nb
+=
nb_tmp
if
nb_doc
%
numberReplies
!=
0
:
txt
=
loadApiIsidorePage
(
search
,
language
,
nb_doc
//
numberReplies
+
1
)
while
(
True
):
txt
=
loadApiIsidorePage
(
search
,
language
,
nb_doc
//
numberReplies
+
1
)
if
txt
!=
0
:
break
time
.
sleep
(
retryTime
)
print
(
'Retry'
)
tmp
,
nb_tmp
=
createFile
(
txt
,
nb_doc
%
numberReplies
,
language
)
output
+=
tmp
nb
+=
nb_tmp
...
...
@@ -139,12 +145,16 @@ def createFile(docs, limit, language):
else
:
abstract
=
tmp
else
:
abstract
=
abstract
[
'$'
]
if
'$'
in
abstract
.
keys
():
abstract
=
abstract
[
'$'
]
else
:
abstract
=
''
if
'types'
in
doc
[
'isidore'
]
.
keys
():
if
type
(
doc
[
'isidore'
][
'types'
][
'type'
]
==
str
)
and
doc
[
'isidore'
][
'types'
][
'type'
]
in
[
'Books'
,
'text'
]:
print
(
i
)
if
type
(
doc
[
'isidore'
][
'types'
][
'type'
])
==
str
and
doc
[
'isidore'
][
'types'
][
'type'
]
in
[
'Books'
,
'text'
]:
nb
+=
1
elif
type
(
doc
[
'isidore'
][
'types'
][
'type'
]
==
dict
)
and
doc
[
'isidore'
][
'types'
][
'type'
][
1
]
in
[
'Books'
,
'text'
]:
elif
type
(
doc
[
'isidore'
][
'types'
][
'type'
]
)
==
dict
and
doc
[
'isidore'
][
'types'
][
'type'
][
'$'
]
in
[
'Books'
,
'text'
]:
nb
+=
1
else
:
print
(
title
)
...
...
@@ -280,4 +290,5 @@ if st.session_state.stage_isidore > 1:
st
.
write
(
st
.
session_state
.
general_text_dict
[
'doc_abstract1'
]
+
str
(
st
.
session_state
.
nb_bad_file
)
+
st
.
session_state
.
general_text_dict
[
'doc_abstract2'
])
st
.
download_button
(
'Download TSV'
,
st
.
session_state
.
output
,
'output.csv'
)
fileName
=
"isidoreOutput_"
+
str
(
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d_
%
H:
%
M:
%
S"
))
+
'.csv'
st
.
download_button
(
'Download TSV'
,
st
.
session_state
.
output
,
fileName
)
Streamlit/pages/Istex_To_GarganText.py
View file @
709099dd
...
...
@@ -91,13 +91,13 @@ file = st.file_uploader(
if
file
:
try
:
name
=
file
.
name
.
split
(
'.'
)[
0
]
+
'.csv'
fileName
=
"istexOutput_"
+
str
(
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d_
%
H:
%
M:
%
S"
))
+
'.csv'
res
,
nb_dup
=
read_zip
(
file
)
if
nb_dup
:
st
.
write
(
st
.
session_state
.
general_text_dict
[
'dup1'
]
+
str
(
nb_dup
)
+
st
.
session_state
.
general_text_dict
[
'dup2'
])
st
.
write
(
st
.
session_state
.
general_text_dict
[
'new_file'
])
st
.
download_button
(
name
,
res
,
n
ame
)
st
.
download_button
(
'Download TSV'
,
res
,
fileN
ame
)
except
Exception
as
e
:
st
.
write
(
st
.
session_state
.
general_text_dict
[
'error'
])
print
(
e
)
...
...
Streamlit/pages/Zotero_To_GarganText.py
View file @
709099dd
...
...
@@ -6,7 +6,7 @@ Loïc Chapron
import
streamlit
as
st
import
requests
as
req
import
json
from
datetime
import
date
from
datetime
import
date
,
datetime
import
src.basic
as
tmp
...
...
@@ -308,7 +308,8 @@ if st.session_state.stage == 2 and st.session_state.format == 'collections':
output
=
createTSVfromCollections
()
st
.
write
(
st
.
session_state
.
general_text_dict
[
'fileTSV1'
]
+
str
(
len
(
output
.
split
(
'
\n
'
))
-
2
)
+
st
.
session_state
.
general_text_dict
[
'fileTSV2'
])
st
.
download_button
(
'Download TSV'
,
output
,
'output.csv'
)
fileName
=
"zoteroOutput_"
+
str
(
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d_
%
H:
%
M:
%
S"
))
+
'.csv'
st
.
download_button
(
'Download TSV'
,
output
,
fileName
)
if
st
.
session_state
.
stage
>
0
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment