grobid-client-python 0.0.9__tar.gz → 0.0.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/PKG-INFO +9 -6
  2. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/Readme.md +7 -3
  3. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client/grobid_client.py +26 -4
  4. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client_python.egg-info/PKG-INFO +9 -6
  5. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/pyproject.toml +2 -1
  6. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/.github/workflows/ci-build.yml +0 -0
  7. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/.github/workflows/ci-release.yml +0 -0
  8. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/.gitignore +0 -0
  9. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/LICENSE +0 -0
  10. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/MANIFEST.in +0 -0
  11. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/config.json +0 -0
  12. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/example.py +0 -0
  13. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client/__init__.py +0 -0
  14. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client/client.py +0 -0
  15. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client_python.egg-info/SOURCES.txt +0 -0
  16. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client_python.egg-info/dependency_links.txt +0 -0
  17. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client_python.egg-info/entry_points.txt +0 -0
  18. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client_python.egg-info/requires.txt +0 -0
  19. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/grobid_client_python.egg-info/top_level.txt +0 -0
  20. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/requirements.txt +0 -0
  21. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/20180928112135.png +0 -0
  22. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/20180928112138.csv +0 -0
  23. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_out/0046d83a-edd6-4631-b57c-755cdcce8b7f.tei.xml +0 -0
  24. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_out/test_1/0f318087-b211-4ace-8ac9-3d9372a73c1c.tei.xml +0 -0
  25. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_pdf/0046d83a-edd6-4631-b57c-755cdcce8b7f.pdf +0 -0
  26. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_pdf/0046d83a-edd6-4631-b57c-755cdcce8b7f.tei.xml +0 -0
  27. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_txt/reference-strings-1.txt +0 -0
  28. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_txt/reference-strings-2.txt +0 -0
  29. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_txt/reference-strings-3.txt +0 -0
  30. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_txt/reference-strings-4.txt +0 -0
  31. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_txt/reference-strings-5.txt +0 -0
  32. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_txt/reference-strings-6.txt +0 -0
  33. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/resources/test_txt/reference-strings-7.txt +0 -0
  34. {grobid_client_python-0.0.9 → grobid_client_python-0.0.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: grobid-client-python
3
- Version: 0.0.9
3
+ Version: 0.0.12
4
4
  Summary: Simple python client for GROBID REST services
5
5
  Author-email: Patrice Lopez <patrice.lopez@science-miner.com>
6
6
  Maintainer-email: Patrice Lopez <patrice.lopez@science-miner.com>, Luca Foppiano <lucanoro@duck.com>
@@ -212,7 +212,6 @@ Project-URL: Homepage, https://github.com/kermitt2/grobid_client_python
212
212
  Project-URL: Repository, https://github.com/kermitt2/grobid_client_python
213
213
  Project-URL: Changelog, https://github.com/kermitt2/grobid_client_python
214
214
  Description-Content-Type: text/markdown
215
- License-File: LICENSE
216
215
  Requires-Dist: requests
217
216
 
218
217
  [![PyPI version](https://badge.fury.io/py/grobid_client_python.svg)](https://badge.fury.io/py/grobid_client_python)
@@ -237,7 +236,8 @@ You can change the server address by editing the file `config.json`, see below.
237
236
 
238
237
  ## Requirements
239
238
 
240
- This client has been developed and was tested with Python `3.5`-`3.9` and should work with any higher `3.*` versions. It uses `requests` as dependency beyond the Standard Python Library.
239
+ This client has been developed and was tested with Python `3.8`-`3.13` and should work with any higher `3.*` versions.
240
+ It uses `requests` as dependency beyond the Standard Python Library.
241
241
 
242
242
  ## Install
243
243
 
@@ -260,7 +260,7 @@ python3 -m pip install git+https://github.com/kermitt2/grobid_client_python.git
260
260
  ```
261
261
  git clone https://github.com/kermitt2/grobid_client_python
262
262
  cd grobid_client_python
263
- python3 setup.py install
263
+ pip install -e .
264
264
  ```
265
265
 
266
266
  There is nothing more needed to start using the python command lines, see the next section.
@@ -274,7 +274,7 @@ usage: grobid_client [-h] [--input INPUT] [--output OUTPUT] [--config CONFIG]
274
274
  [--n N] [--generateIDs] [--consolidate_header]
275
275
  [--consolidate_citations] [--include_raw_citations]
276
276
  [--include_raw_affiliations] [--force] [--teiCoordinates]
277
- [--verbose]
277
+ [--verbose] [--flavor FLAVOR]
278
278
  service
279
279
 
280
280
  Client for GROBID services
@@ -313,6 +313,9 @@ optional arguments:
313
313
  --segmentSentences segment sentences in the text content of the document
314
314
  with additional <s> elements
315
315
  --verbose print information about processed files in the console
316
+ --flavor specifcy the flavor to be used. Current accepted
317
+ values: `article/light`, `article/light-ref`, `sdo/ietf`,
318
+ however better check [here](https://grobid.readthedocs.io/en/latest/Grobid-specialized-processes/#flavors).
316
319
 
317
320
 
318
321
  ```
@@ -20,7 +20,8 @@ You can change the server address by editing the file `config.json`, see below.
20
20
 
21
21
  ## Requirements
22
22
 
23
- This client has been developed and was tested with Python `3.5`-`3.9` and should work with any higher `3.*` versions. It uses `requests` as dependency beyond the Standard Python Library.
23
+ This client has been developed and was tested with Python `3.8`-`3.13` and should work with any higher `3.*` versions.
24
+ It uses `requests` as dependency beyond the Standard Python Library.
24
25
 
25
26
  ## Install
26
27
 
@@ -43,7 +44,7 @@ python3 -m pip install git+https://github.com/kermitt2/grobid_client_python.git
43
44
  ```
44
45
  git clone https://github.com/kermitt2/grobid_client_python
45
46
  cd grobid_client_python
46
- python3 setup.py install
47
+ pip install -e .
47
48
  ```
48
49
 
49
50
  There is nothing more needed to start using the python command lines, see the next section.
@@ -57,7 +58,7 @@ usage: grobid_client [-h] [--input INPUT] [--output OUTPUT] [--config CONFIG]
57
58
  [--n N] [--generateIDs] [--consolidate_header]
58
59
  [--consolidate_citations] [--include_raw_citations]
59
60
  [--include_raw_affiliations] [--force] [--teiCoordinates]
60
- [--verbose]
61
+ [--verbose] [--flavor FLAVOR]
61
62
  service
62
63
 
63
64
  Client for GROBID services
@@ -96,6 +97,9 @@ optional arguments:
96
97
  --segmentSentences segment sentences in the text content of the document
97
98
  with additional <s> elements
98
99
  --verbose print information about processed files in the console
100
+ --flavor specifcy the flavor to be used. Current accepted
101
+ values: `article/light`, `article/light-ref`, `sdo/ietf`,
102
+ however better check [here](https://grobid.readthedocs.io/en/latest/Grobid-specialized-processes/#flavors).
99
103
 
100
104
 
101
105
  ```
@@ -114,6 +114,7 @@ class GrobidClient(ApiClient):
114
114
  segment_sentences=False,
115
115
  force=True,
116
116
  verbose=False,
117
+ flavor=None
117
118
  ):
118
119
  batch_size_pdf = self.config["batch_size"]
119
120
  input_files = []
@@ -147,6 +148,7 @@ class GrobidClient(ApiClient):
147
148
  segment_sentences,
148
149
  force,
149
150
  verbose,
151
+ flavor
150
152
  )
151
153
  input_files = []
152
154
 
@@ -185,6 +187,7 @@ class GrobidClient(ApiClient):
185
187
  segment_sentences,
186
188
  force,
187
189
  verbose=False,
190
+ flavor=None
188
191
  ):
189
192
  if verbose:
190
193
  print(len(input_files), "files to process in current batch")
@@ -203,6 +206,9 @@ class GrobidClient(ApiClient):
203
206
  selected_process = self.process_pdf
204
207
  if service == 'processCitationList':
205
208
  selected_process = self.process_txt
209
+
210
+ if verbose:
211
+ print(f"Adding {input_file} to the queue.")
206
212
 
207
213
  r = executor.submit(
208
214
  selected_process,
@@ -214,7 +220,10 @@ class GrobidClient(ApiClient):
214
220
  include_raw_citations,
215
221
  include_raw_affiliations,
216
222
  tei_coordinates,
217
- segment_sentences)
223
+ segment_sentences,
224
+ flavor,
225
+ -1,
226
+ -1)
218
227
 
219
228
  results.append(r)
220
229
 
@@ -254,6 +263,7 @@ class GrobidClient(ApiClient):
254
263
  include_raw_affiliations,
255
264
  tei_coordinates,
256
265
  segment_sentences,
266
+ flavor=None,
257
267
  start=-1,
258
268
  end=-1
259
269
  ):
@@ -285,9 +295,11 @@ class GrobidClient(ApiClient):
285
295
  the_data["teiCoordinates"] = self.config["coordinates"]
286
296
  if segment_sentences:
287
297
  the_data["segmentSentences"] = "1"
288
- if start > 0:
298
+ if flavor:
299
+ the_data["flavor"] = flavor
300
+ if start and start > 0:
289
301
  the_data["start"] = str(start)
290
- if end > 0:
302
+ if end and end > 0:
291
303
  the_data["end"] = str(end)
292
304
 
293
305
  try:
@@ -308,7 +320,8 @@ class GrobidClient(ApiClient):
308
320
  tei_coordinates,
309
321
  segment_sentences,
310
322
  start,
311
- end
323
+ end,
324
+ flavor
312
325
  )
313
326
  except requests.exceptions.ReadTimeout:
314
327
  pdf_handle.close()
@@ -368,6 +381,7 @@ class GrobidClient(ApiClient):
368
381
 
369
382
  def main():
370
383
  valid_services = [
384
+ "processFulltextDocumentBlank",
371
385
  "processFulltextDocument",
372
386
  "processHeaderDocument",
373
387
  "processReferences",
@@ -441,11 +455,18 @@ def main():
441
455
  help="print information about processed files in the console",
442
456
  )
443
457
 
458
+ parser.add_argument(
459
+ "--flavor",
460
+ default=None,
461
+ help="Define the flavor to be used for the fulltext extraction",
462
+ )
463
+
444
464
  args = parser.parse_args()
445
465
 
446
466
  input_path = args.input
447
467
  config_path = args.config
448
468
  output_path = args.output
469
+ flavor = args.flavor
449
470
 
450
471
  if args.n is not None:
451
472
  try:
@@ -500,6 +521,7 @@ def main():
500
521
  segment_sentences=segment_sentences,
501
522
  force=force,
502
523
  verbose=verbose,
524
+ flavor=flavor
503
525
  )
504
526
 
505
527
  runtime = round(time.time() - start_time, 3)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: grobid-client-python
3
- Version: 0.0.9
3
+ Version: 0.0.12
4
4
  Summary: Simple python client for GROBID REST services
5
5
  Author-email: Patrice Lopez <patrice.lopez@science-miner.com>
6
6
  Maintainer-email: Patrice Lopez <patrice.lopez@science-miner.com>, Luca Foppiano <lucanoro@duck.com>
@@ -212,7 +212,6 @@ Project-URL: Homepage, https://github.com/kermitt2/grobid_client_python
212
212
  Project-URL: Repository, https://github.com/kermitt2/grobid_client_python
213
213
  Project-URL: Changelog, https://github.com/kermitt2/grobid_client_python
214
214
  Description-Content-Type: text/markdown
215
- License-File: LICENSE
216
215
  Requires-Dist: requests
217
216
 
218
217
  [![PyPI version](https://badge.fury.io/py/grobid_client_python.svg)](https://badge.fury.io/py/grobid_client_python)
@@ -237,7 +236,8 @@ You can change the server address by editing the file `config.json`, see below.
237
236
 
238
237
  ## Requirements
239
238
 
240
- This client has been developed and was tested with Python `3.5`-`3.9` and should work with any higher `3.*` versions. It uses `requests` as dependency beyond the Standard Python Library.
239
+ This client has been developed and was tested with Python `3.8`-`3.13` and should work with any higher `3.*` versions.
240
+ It uses `requests` as dependency beyond the Standard Python Library.
241
241
 
242
242
  ## Install
243
243
 
@@ -260,7 +260,7 @@ python3 -m pip install git+https://github.com/kermitt2/grobid_client_python.git
260
260
  ```
261
261
  git clone https://github.com/kermitt2/grobid_client_python
262
262
  cd grobid_client_python
263
- python3 setup.py install
263
+ pip install -e .
264
264
  ```
265
265
 
266
266
  There is nothing more needed to start using the python command lines, see the next section.
@@ -274,7 +274,7 @@ usage: grobid_client [-h] [--input INPUT] [--output OUTPUT] [--config CONFIG]
274
274
  [--n N] [--generateIDs] [--consolidate_header]
275
275
  [--consolidate_citations] [--include_raw_citations]
276
276
  [--include_raw_affiliations] [--force] [--teiCoordinates]
277
- [--verbose]
277
+ [--verbose] [--flavor FLAVOR]
278
278
  service
279
279
 
280
280
  Client for GROBID services
@@ -313,6 +313,9 @@ optional arguments:
313
313
  --segmentSentences segment sentences in the text content of the document
314
314
  with additional <s> elements
315
315
  --verbose print information about processed files in the console
316
+ --flavor specifcy the flavor to be used. Current accepted
317
+ values: `article/light`, `article/light-ref`, `sdo/ietf`,
318
+ however better check [here](https://grobid.readthedocs.io/en/latest/Grobid-specialized-processes/#flavors).
316
319
 
317
320
 
318
321
  ```
@@ -3,7 +3,7 @@ requires = ["setuptools", "setuptools-scm"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [tool.bumpversion]
6
- current_version = "0.0.9"
6
+ current_version = "0.0.12"
7
7
  commit = "true"
8
8
  tag = "true"
9
9
  tag_name = "v{new_version}"
@@ -30,6 +30,7 @@ dependencies = {file = ["requirements.txt"]}
30
30
 
31
31
  [tool.setuptools]
32
32
  packages=['grobid_client']
33
+ license-files = []
33
34
 
34
35
  [project.urls]
35
36
  Homepage = "https://github.com/kermitt2/grobid_client_python"