grobid-client-python 0.0.12__tar.gz → 0.0.13__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 (44) hide show
  1. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/.github/workflows/ci-build.yml +12 -4
  2. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/PKG-INFO +11 -10
  3. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/Readme.md +10 -9
  4. grobid_client_python-0.0.13/config.json +28 -0
  5. grobid_client_python-0.0.13/grobid_client/grobid_client.py +802 -0
  6. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/grobid_client_python.egg-info/PKG-INFO +11 -10
  7. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/grobid_client_python.egg-info/SOURCES.txt +9 -1
  8. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/pyproject.toml +1 -1
  9. grobid_client_python-0.0.13/pytest.ini +21 -0
  10. grobid_client_python-0.0.13/tests/__init__.py +2 -0
  11. grobid_client_python-0.0.13/tests/conftest.py +64 -0
  12. grobid_client_python-0.0.13/tests/run_tests.py +53 -0
  13. grobid_client_python-0.0.13/tests/test_client.py +225 -0
  14. grobid_client_python-0.0.13/tests/test_config.json +16 -0
  15. grobid_client_python-0.0.13/tests/test_grobid_client.py +441 -0
  16. grobid_client_python-0.0.13/tests/test_integration.py +346 -0
  17. grobid_client_python-0.0.12/config.json +0 -7
  18. grobid_client_python-0.0.12/grobid_client/grobid_client.py +0 -531
  19. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/.github/workflows/ci-release.yml +0 -0
  20. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/.gitignore +0 -0
  21. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/LICENSE +0 -0
  22. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/MANIFEST.in +0 -0
  23. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/example.py +0 -0
  24. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/grobid_client/__init__.py +0 -0
  25. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/grobid_client/client.py +0 -0
  26. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/grobid_client_python.egg-info/dependency_links.txt +0 -0
  27. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/grobid_client_python.egg-info/entry_points.txt +0 -0
  28. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/grobid_client_python.egg-info/requires.txt +0 -0
  29. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/grobid_client_python.egg-info/top_level.txt +0 -0
  30. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/requirements.txt +0 -0
  31. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/20180928112135.png +0 -0
  32. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/20180928112138.csv +0 -0
  33. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_out/0046d83a-edd6-4631-b57c-755cdcce8b7f.tei.xml +0 -0
  34. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_out/test_1/0f318087-b211-4ace-8ac9-3d9372a73c1c.tei.xml +0 -0
  35. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_pdf/0046d83a-edd6-4631-b57c-755cdcce8b7f.pdf +0 -0
  36. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_pdf/0046d83a-edd6-4631-b57c-755cdcce8b7f.tei.xml +0 -0
  37. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_txt/reference-strings-1.txt +0 -0
  38. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_txt/reference-strings-2.txt +0 -0
  39. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_txt/reference-strings-3.txt +0 -0
  40. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_txt/reference-strings-4.txt +0 -0
  41. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_txt/reference-strings-5.txt +0 -0
  42. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_txt/reference-strings-6.txt +0 -0
  43. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/resources/test_txt/reference-strings-7.txt +0 -0
  44. {grobid_client_python-0.0.12 → grobid_client_python-0.0.13}/setup.cfg +0 -0
@@ -26,7 +26,7 @@ jobs:
26
26
  - name: Install dependencies
27
27
  run: |
28
28
  python -m pip install --upgrade pip
29
- pip install --upgrade flake8 pytest pycodestyle pytest-cov
29
+ pip install --upgrade flake8 pytest pycodestyle pytest-cov pytest-mock
30
30
  if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31
31
  - name: Lint with flake8
32
32
  run: |
@@ -34,6 +34,14 @@ jobs:
34
34
  flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35
35
  # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36
36
  flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37
- # - name: Test with pytest
38
- # run: |
39
- # pytest
37
+ - name: Test with pytest
38
+ run: |
39
+ pytest tests/ -v --cov=grobid_client --cov-report=xml --cov-report=term-missing
40
+ - name: Upload coverage to Codecov
41
+ if: matrix.python-version == '3.11'
42
+ uses: codecov/codecov-action@v4
43
+ with:
44
+ file: ./coverage.xml
45
+ flags: unittests
46
+ name: codecov-umbrella
47
+ fail_ci_if_error: false
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: grobid-client-python
3
- Version: 0.0.12
3
+ Version: 0.0.13
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>
@@ -218,15 +218,12 @@ Requires-Dist: requests
218
218
  [![SWH](https://archive.softwareheritage.org/badge/origin/https://github.com/kermitt2/grobid_client_python/)](https://archive.softwareheritage.org/browse/origin/https://github.com/kermitt2/grobid_client_python/)
219
219
  [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
220
220
 
221
- # Simple python client for GROBID REST services
221
+ # Simple Python client for GROBID REST services
222
222
 
223
223
  This Python client can be used to process in an efficient concurrent manner a set of PDF in a given directory by the [GROBID](https://github.com/kermitt2/grobid) service. It includes a command line for processing PDF on a file system and write results in a given output directory and a library for import in other python scripts. The client can also process similarly a list of files with reference strings (one per line) and patents in XML ST36 formats.
224
224
 
225
- ## Before you start
226
-
227
- Please be aware that, at the moment, [grobid does not support Windows](https://grobid.readthedocs.io/en/latest/Troubleshooting/#windows-related-issues).
228
- If you are a Windows user, don't worry. You can still [run grobid
229
- via Docker](https://grobid.readthedocs.io/en/latest/Grobid-docker/).
225
+ > [!IMPORTANT]
226
+ > Please be aware that, at the moment, Grobid supports windows only through Docker containers. See [here](https://grobid.readthedocs.io/en/latest/Grobid-docker/).
230
227
 
231
228
  ## Build and run
232
229
 
@@ -314,11 +311,12 @@ optional arguments:
314
311
  with additional <s> elements
315
312
  --verbose print information about processed files in the console
316
313
  --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).
314
+ values: `article/light`, `article/light-ref`, `sdo/ietf`.
315
+ ```
319
316
 
317
+ > [!TIP]
318
+ > Before using flavors, check [here](https://grobid.readthedocs.io/en/latest/Grobid-specialized-processes/#flavors).
320
319
 
321
- ```
322
320
 
323
321
  Examples:
324
322
 
@@ -367,6 +365,9 @@ See also `example.py`.
367
365
 
368
366
  ## Configuration of the client
369
367
 
368
+ > [!TIP]
369
+ > from version 0.0.12 the `config.json` will be optional, by default the client will connect to the local server.
370
+
370
371
  There are a few parameters that can be set with the `config.json` file.
371
372
 
372
373
  - `grobid_server` indicates the URL of the GROBID server to be used by the client.
@@ -2,15 +2,12 @@
2
2
  [![SWH](https://archive.softwareheritage.org/badge/origin/https://github.com/kermitt2/grobid_client_python/)](https://archive.softwareheritage.org/browse/origin/https://github.com/kermitt2/grobid_client_python/)
3
3
  [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
4
4
 
5
- # Simple python client for GROBID REST services
5
+ # Simple Python client for GROBID REST services
6
6
 
7
7
  This Python client can be used to process in an efficient concurrent manner a set of PDF in a given directory by the [GROBID](https://github.com/kermitt2/grobid) service. It includes a command line for processing PDF on a file system and write results in a given output directory and a library for import in other python scripts. The client can also process similarly a list of files with reference strings (one per line) and patents in XML ST36 formats.
8
8
 
9
- ## Before you start
10
-
11
- Please be aware that, at the moment, [grobid does not support Windows](https://grobid.readthedocs.io/en/latest/Troubleshooting/#windows-related-issues).
12
- If you are a Windows user, don't worry. You can still [run grobid
13
- via Docker](https://grobid.readthedocs.io/en/latest/Grobid-docker/).
9
+ > [!IMPORTANT]
10
+ > Please be aware that, at the moment, Grobid supports windows only through Docker containers. See [here](https://grobid.readthedocs.io/en/latest/Grobid-docker/).
14
11
 
15
12
  ## Build and run
16
13
 
@@ -98,11 +95,12 @@ optional arguments:
98
95
  with additional <s> elements
99
96
  --verbose print information about processed files in the console
100
97
  --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).
98
+ values: `article/light`, `article/light-ref`, `sdo/ietf`.
99
+ ```
103
100
 
101
+ > [!TIP]
102
+ > Before using flavors, check [here](https://grobid.readthedocs.io/en/latest/Grobid-specialized-processes/#flavors).
104
103
 
105
- ```
106
104
 
107
105
  Examples:
108
106
 
@@ -151,6 +149,9 @@ See also `example.py`.
151
149
 
152
150
  ## Configuration of the client
153
151
 
152
+ > [!TIP]
153
+ > from version 0.0.12 the `config.json` will be optional, by default the client will connect to the local server.
154
+
154
155
  There are a few parameters that can be set with the `config.json` file.
155
156
 
156
157
  - `grobid_server` indicates the URL of the GROBID server to be used by the client.
@@ -0,0 +1,28 @@
1
+ {
2
+ "grobid_server": "http://localhost:8070",
3
+ "batch_size": 1000,
4
+ "timeout": 120,
5
+ "sleep_time": 5,
6
+ "coordinates": [
7
+ "title",
8
+ "persName",
9
+ "affiliation",
10
+ "orgName",
11
+ "formula",
12
+ "figure",
13
+ "ref",
14
+ "biblStruct",
15
+ "head",
16
+ "p",
17
+ "s",
18
+ "note"
19
+ ],
20
+ "logging": {
21
+ "level": "INFO",
22
+ "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
23
+ "console": true,
24
+ "file": null,
25
+ "max_file_size": "10MB",
26
+ "backup_count": 3
27
+ }
28
+ }