paperminertoolkit 1.0.0__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 (85) hide show
  1. paperminertoolkit-1.0.0/LICENSE +21 -0
  2. paperminertoolkit-1.0.0/PKG-INFO +126 -0
  3. paperminertoolkit-1.0.0/README.md +76 -0
  4. paperminertoolkit-1.0.0/paperminertoolkit/__init__.py +10 -0
  5. paperminertoolkit-1.0.0/paperminertoolkit/_version.py +11 -0
  6. paperminertoolkit-1.0.0/paperminertoolkit/cli.py +1053 -0
  7. paperminertoolkit-1.0.0/paperminertoolkit/corpus/__init__.py +1 -0
  8. paperminertoolkit-1.0.0/paperminertoolkit/corpus/database.py +1542 -0
  9. paperminertoolkit-1.0.0/paperminertoolkit/corpus/documents.py +313 -0
  10. paperminertoolkit-1.0.0/paperminertoolkit/corpus/filtering.py +1390 -0
  11. paperminertoolkit-1.0.0/paperminertoolkit/corpus/metadata.py +532 -0
  12. paperminertoolkit-1.0.0/paperminertoolkit/extraction/__init__.py +1 -0
  13. paperminertoolkit-1.0.0/paperminertoolkit/extraction/compression.py +486 -0
  14. paperminertoolkit-1.0.0/paperminertoolkit/extraction/extract.py +573 -0
  15. paperminertoolkit-1.0.0/paperminertoolkit/extraction/models.py +784 -0
  16. paperminertoolkit-1.0.0/paperminertoolkit/extraction/recipes.py +241 -0
  17. paperminertoolkit-1.0.0/paperminertoolkit/extraction/scrape.py +737 -0
  18. paperminertoolkit-1.0.0/paperminertoolkit/extraction/store.py +244 -0
  19. paperminertoolkit-1.0.0/paperminertoolkit/extraction/tokenizer.py +313 -0
  20. paperminertoolkit-1.0.0/paperminertoolkit/providers/__init__.py +1 -0
  21. paperminertoolkit-1.0.0/paperminertoolkit/providers/arxiv.py +760 -0
  22. paperminertoolkit-1.0.0/paperminertoolkit/providers/base.py +514 -0
  23. paperminertoolkit-1.0.0/paperminertoolkit/providers/biorxiv.py +561 -0
  24. paperminertoolkit-1.0.0/paperminertoolkit/providers/chemrxiv.py +1115 -0
  25. paperminertoolkit-1.0.0/paperminertoolkit/providers/core.py +423 -0
  26. paperminertoolkit-1.0.0/paperminertoolkit/providers/crossref.py +649 -0
  27. paperminertoolkit-1.0.0/paperminertoolkit/providers/elsevier.py +455 -0
  28. paperminertoolkit-1.0.0/paperminertoolkit/providers/medrxiv.py +548 -0
  29. paperminertoolkit-1.0.0/paperminertoolkit/providers/openalex.py +471 -0
  30. paperminertoolkit-1.0.0/paperminertoolkit/providers/pubmed.py +1272 -0
  31. paperminertoolkit-1.0.0/paperminertoolkit/providers/registry.py +521 -0
  32. paperminertoolkit-1.0.0/paperminertoolkit/providers/rxiv.py +936 -0
  33. paperminertoolkit-1.0.0/paperminertoolkit/providers/unpaywall.py +162 -0
  34. paperminertoolkit-1.0.0/paperminertoolkit/resources/recipes.json +1670 -0
  35. paperminertoolkit-1.0.0/paperminertoolkit/settings.py +661 -0
  36. paperminertoolkit-1.0.0/paperminertoolkit/workflows/__init__.py +1 -0
  37. paperminertoolkit-1.0.0/paperminertoolkit/workflows/download.py +1748 -0
  38. paperminertoolkit-1.0.0/paperminertoolkit/workflows/enrichment.py +1906 -0
  39. paperminertoolkit-1.0.0/paperminertoolkit/workflows/imports.py +121 -0
  40. paperminertoolkit-1.0.0/paperminertoolkit/workflows/search.py +877 -0
  41. paperminertoolkit-1.0.0/paperminertoolkit/workflows/topics.py +2837 -0
  42. paperminertoolkit-1.0.0/paperminertoolkit/workflows/utilities.py +73 -0
  43. paperminertoolkit-1.0.0/paperminertoolkit.egg-info/PKG-INFO +126 -0
  44. paperminertoolkit-1.0.0/paperminertoolkit.egg-info/SOURCES.txt +83 -0
  45. paperminertoolkit-1.0.0/paperminertoolkit.egg-info/dependency_links.txt +1 -0
  46. paperminertoolkit-1.0.0/paperminertoolkit.egg-info/entry_points.txt +2 -0
  47. paperminertoolkit-1.0.0/paperminertoolkit.egg-info/requires.txt +29 -0
  48. paperminertoolkit-1.0.0/paperminertoolkit.egg-info/top_level.txt +1 -0
  49. paperminertoolkit-1.0.0/pyproject.toml +105 -0
  50. paperminertoolkit-1.0.0/setup.cfg +4 -0
  51. paperminertoolkit-1.0.0/tests/test_arxiv.py +437 -0
  52. paperminertoolkit-1.0.0/tests/test_biorxiv.py +593 -0
  53. paperminertoolkit-1.0.0/tests/test_chemrxiv.py +696 -0
  54. paperminertoolkit-1.0.0/tests/test_cli.py +1039 -0
  55. paperminertoolkit-1.0.0/tests/test_compression.py +379 -0
  56. paperminertoolkit-1.0.0/tests/test_core.py +194 -0
  57. paperminertoolkit-1.0.0/tests/test_corpus.py +842 -0
  58. paperminertoolkit-1.0.0/tests/test_crossref.py +435 -0
  59. paperminertoolkit-1.0.0/tests/test_docstrings.py +109 -0
  60. paperminertoolkit-1.0.0/tests/test_documents.py +231 -0
  61. paperminertoolkit-1.0.0/tests/test_download.py +2743 -0
  62. paperminertoolkit-1.0.0/tests/test_elsevier.py +225 -0
  63. paperminertoolkit-1.0.0/tests/test_enrichment.py +1881 -0
  64. paperminertoolkit-1.0.0/tests/test_extract.py +411 -0
  65. paperminertoolkit-1.0.0/tests/test_filtering.py +755 -0
  66. paperminertoolkit-1.0.0/tests/test_imports.py +209 -0
  67. paperminertoolkit-1.0.0/tests/test_medrxiv.py +512 -0
  68. paperminertoolkit-1.0.0/tests/test_metadata.py +321 -0
  69. paperminertoolkit-1.0.0/tests/test_models.py +480 -0
  70. paperminertoolkit-1.0.0/tests/test_openalex.py +279 -0
  71. paperminertoolkit-1.0.0/tests/test_package_layout.py +47 -0
  72. paperminertoolkit-1.0.0/tests/test_provider.py +369 -0
  73. paperminertoolkit-1.0.0/tests/test_pubmed.py +604 -0
  74. paperminertoolkit-1.0.0/tests/test_recipes.py +243 -0
  75. paperminertoolkit-1.0.0/tests/test_record_contract.py +153 -0
  76. paperminertoolkit-1.0.0/tests/test_rxiv.py +174 -0
  77. paperminertoolkit-1.0.0/tests/test_scrape.py +901 -0
  78. paperminertoolkit-1.0.0/tests/test_search.py +1790 -0
  79. paperminertoolkit-1.0.0/tests/test_settings.py +541 -0
  80. paperminertoolkit-1.0.0/tests/test_sources.py +187 -0
  81. paperminertoolkit-1.0.0/tests/test_store.py +336 -0
  82. paperminertoolkit-1.0.0/tests/test_tokenizer.py +258 -0
  83. paperminertoolkit-1.0.0/tests/test_topics.py +913 -0
  84. paperminertoolkit-1.0.0/tests/test_unpaywall.py +118 -0
  85. paperminertoolkit-1.0.0/tests/test_utilities.py +105 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SMTG-Bham
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.4
2
+ Name: paperminertoolkit
3
+ Version: 1.0.0
4
+ Summary: A package for extracting structured information from scientific papers with configurable language and vision models.
5
+ Author-email: Oskar Soulas <oskar.soulas@gmail.com>, Louie <louies@hotmail.co.uk>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/SMTG-Bham/PaperMinerToolkit
8
+ Project-URL: Repository, https://github.com/SMTG-Bham/PaperMinerToolkit
9
+ Project-URL: Issues, https://github.com/SMTG-Bham/PaperMinerToolkit/issues
10
+ Keywords: research,scientific-papers,materials,text-mining,llm
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
18
+ Classifier: Topic :: Text Processing
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: click
23
+ Requires-Dist: headroom-ai[image,ml]<0.36,>=0.35
24
+ Requires-Dist: openai
25
+ Requires-Dist: numpy
26
+ Requires-Dist: pandas
27
+ Requires-Dist: pillow
28
+ Requires-Dist: pymupdf
29
+ Requires-Dist: pypdf
30
+ Requires-Dist: requests
31
+ Requires-Dist: regex
32
+ Requires-Dist: scipy
33
+ Requires-Dist: joblib
34
+ Requires-Dist: matplotlib
35
+ Requires-Dist: scikit-learn
36
+ Requires-Dist: tiktoken>=0.13.0
37
+ Requires-Dist: tqdm
38
+ Requires-Dist: transformers
39
+ Provides-Extra: test
40
+ Requires-Dist: pytest; extra == "test"
41
+ Requires-Dist: pytest-cov; extra == "test"
42
+ Requires-Dist: ruff; extra == "test"
43
+ Provides-Extra: docs
44
+ Requires-Dist: myst-nb<2,>=1.2; extra == "docs"
45
+ Requires-Dist: pydata-sphinx-theme<0.21,>=0.16; extra == "docs"
46
+ Requires-Dist: sphinx<10,>=8; extra == "docs"
47
+ Requires-Dist: sphinx-click<7,>=6; extra == "docs"
48
+ Requires-Dist: sphinxcontrib-mermaid<2,>=1; extra == "docs"
49
+ Dynamic: license-file
50
+
51
+ <p align="center">
52
+ <picture>
53
+ <source media="(prefers-color-scheme: dark)" srcset="assets/Paper_Miner_Toolkit_banner_dark.svg">
54
+ <img src="assets/Paper_Miner_Toolkit_banner_light.svg" alt="PaperMinerToolkit banner" width="640">
55
+ </picture>
56
+ </p>
57
+
58
+ <p align="center">
59
+ <a href="https://github.com/SMTG-Bham/PaperMinerToolkit/actions/workflows/tests.yml"><img src="https://github.com/SMTG-Bham/PaperMinerToolkit/actions/workflows/tests.yml/badge.svg?branch=main" alt="Tests"></a>
60
+ <a href="https://codecov.io/gh/SMTG-Bham/PaperMinerToolkit"><img src="https://codecov.io/gh/SMTG-Bham/PaperMinerToolkit/branch/main/graph/badge.svg" alt="Coverage"></a>
61
+ <a href="https://pypi.org/project/paperminertoolkit/"><img src="https://img.shields.io/pypi/v/paperminertoolkit?logo=pypi&amp;logoColor=white" alt="PyPI version"></a>
62
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/Python-3.11%2B-3776AB?logo=python&amp;logoColor=white" alt="Python 3.11 or newer"></a>
63
+ <a href="https://paperminertoolkit.readthedocs.io/en/latest/"><img src="https://img.shields.io/badge/Docs-Read%20the%20Docs-8CA1AF?logo=readthedocs&amp;logoColor=white" alt="Documentation"></a>
64
+ </p>
65
+
66
+ # PaperMinerToolkit
67
+
68
+ PaperMinerToolkit builds scientific-paper corpora and extracts structured, recipe-defined data with configurable text and vision models. It searches Elsevier/Scopus, CORE, OpenAlex, PubMed, arXiv, medRxiv, bioRxiv, and chemRxiv; supplements paper metadata from Crossref, OpenAlex, PubMed, arXiv, medRxiv, bioRxiv, and chemRxiv, and imports an author's works from Crossref; downloads abstracts, full text, and PDFs; supports persistent regex and LDA topic filters; and stores source content and pipeline state in SQLite.
69
+
70
+ The complete user guide, CLI reference, Python API, HPC instructions, and rendered notebooks live in the [documentation source](https://paperminertoolkit.readthedocs.io/en/latest/). The repository is ready for Read the Docs; a hosted link will be added after the project is imported.
71
+
72
+ ## Installation
73
+
74
+ PaperMinerToolkit requires Python 3.11 or newer:
75
+
76
+ ```bash
77
+ git clone https://github.com/SMTG-Bham/PaperMinerToolkit.git
78
+ cd PaperMinerToolkit
79
+ python -m pip install -e .
80
+ ```
81
+
82
+ ## Quickstart
83
+
84
+ Configure a text model and any search/download credentials you need, then run a small workflow:
85
+
86
+ ```bash
87
+ pmt config model text --provider openai --model YOUR_TEXT_MODEL
88
+
89
+ pmt search "lithium solid electrolyte" papers.db \
90
+ --source openalex --count 25
91
+ pmt enrich papers.db
92
+ pmt download papers.db --format abstract
93
+
94
+ pmt scrape papers.db sse \
95
+ --mode abstract \
96
+ --output temp_scraped_materials.csv
97
+
98
+ pmt store papers.db \
99
+ temp_scraped_materials.csv \
100
+ materials.csv \
101
+ sse \
102
+ --assume-yes
103
+ ```
104
+
105
+ Use `pmt corpus stats papers.db` to inspect stored content and `pmt status papers.db` to inspect pipeline progress.
106
+
107
+ ## Documentation
108
+
109
+ Install and build the Sphinx site locally:
110
+
111
+ ```bash
112
+ python -m pip install -e '.[docs]'
113
+ make -C docs html
114
+ ```
115
+
116
+ Open `docs/_build/html/index.html`. Notebook templates for OpenAI, Anthropic, local Qwen/vLLM, LDA model selection, temporal trends, and hybrid filtering are under `docs/examples/`.
117
+
118
+ ## Testing
119
+
120
+ ```bash
121
+ python -m pip install -e '.[test]'
122
+ ruff check paperminertoolkit tests
123
+ pytest
124
+ ```
125
+
126
+ PaperMinerToolkit is currently alpha software. Keep the corpus database, recipe, model configuration, intermediate extraction CSV, and final results together so a workflow can be reviewed and reproduced.
@@ -0,0 +1,76 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="assets/Paper_Miner_Toolkit_banner_dark.svg">
4
+ <img src="assets/Paper_Miner_Toolkit_banner_light.svg" alt="PaperMinerToolkit banner" width="640">
5
+ </picture>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://github.com/SMTG-Bham/PaperMinerToolkit/actions/workflows/tests.yml"><img src="https://github.com/SMTG-Bham/PaperMinerToolkit/actions/workflows/tests.yml/badge.svg?branch=main" alt="Tests"></a>
10
+ <a href="https://codecov.io/gh/SMTG-Bham/PaperMinerToolkit"><img src="https://codecov.io/gh/SMTG-Bham/PaperMinerToolkit/branch/main/graph/badge.svg" alt="Coverage"></a>
11
+ <a href="https://pypi.org/project/paperminertoolkit/"><img src="https://img.shields.io/pypi/v/paperminertoolkit?logo=pypi&amp;logoColor=white" alt="PyPI version"></a>
12
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/Python-3.11%2B-3776AB?logo=python&amp;logoColor=white" alt="Python 3.11 or newer"></a>
13
+ <a href="https://paperminertoolkit.readthedocs.io/en/latest/"><img src="https://img.shields.io/badge/Docs-Read%20the%20Docs-8CA1AF?logo=readthedocs&amp;logoColor=white" alt="Documentation"></a>
14
+ </p>
15
+
16
+ # PaperMinerToolkit
17
+
18
+ PaperMinerToolkit builds scientific-paper corpora and extracts structured, recipe-defined data with configurable text and vision models. It searches Elsevier/Scopus, CORE, OpenAlex, PubMed, arXiv, medRxiv, bioRxiv, and chemRxiv; supplements paper metadata from Crossref, OpenAlex, PubMed, arXiv, medRxiv, bioRxiv, and chemRxiv, and imports an author's works from Crossref; downloads abstracts, full text, and PDFs; supports persistent regex and LDA topic filters; and stores source content and pipeline state in SQLite.
19
+
20
+ The complete user guide, CLI reference, Python API, HPC instructions, and rendered notebooks live in the [documentation source](https://paperminertoolkit.readthedocs.io/en/latest/). The repository is ready for Read the Docs; a hosted link will be added after the project is imported.
21
+
22
+ ## Installation
23
+
24
+ PaperMinerToolkit requires Python 3.11 or newer:
25
+
26
+ ```bash
27
+ git clone https://github.com/SMTG-Bham/PaperMinerToolkit.git
28
+ cd PaperMinerToolkit
29
+ python -m pip install -e .
30
+ ```
31
+
32
+ ## Quickstart
33
+
34
+ Configure a text model and any search/download credentials you need, then run a small workflow:
35
+
36
+ ```bash
37
+ pmt config model text --provider openai --model YOUR_TEXT_MODEL
38
+
39
+ pmt search "lithium solid electrolyte" papers.db \
40
+ --source openalex --count 25
41
+ pmt enrich papers.db
42
+ pmt download papers.db --format abstract
43
+
44
+ pmt scrape papers.db sse \
45
+ --mode abstract \
46
+ --output temp_scraped_materials.csv
47
+
48
+ pmt store papers.db \
49
+ temp_scraped_materials.csv \
50
+ materials.csv \
51
+ sse \
52
+ --assume-yes
53
+ ```
54
+
55
+ Use `pmt corpus stats papers.db` to inspect stored content and `pmt status papers.db` to inspect pipeline progress.
56
+
57
+ ## Documentation
58
+
59
+ Install and build the Sphinx site locally:
60
+
61
+ ```bash
62
+ python -m pip install -e '.[docs]'
63
+ make -C docs html
64
+ ```
65
+
66
+ Open `docs/_build/html/index.html`. Notebook templates for OpenAI, Anthropic, local Qwen/vLLM, LDA model selection, temporal trends, and hybrid filtering are under `docs/examples/`.
67
+
68
+ ## Testing
69
+
70
+ ```bash
71
+ python -m pip install -e '.[test]'
72
+ ruff check paperminertoolkit tests
73
+ pytest
74
+ ```
75
+
76
+ PaperMinerToolkit is currently alpha software. Keep the corpus database, recipe, model configuration, intermediate extraction CSV, and final results together so a workflow can be reviewed and reproduced.
@@ -0,0 +1,10 @@
1
+ """Expose package version and currently loaded PaperMinerToolkit settings."""
2
+
3
+ from paperminertoolkit._version import __version__ as __version__
4
+
5
+ from paperminertoolkit.settings import (load_settings as load_settings,
6
+ update_elsevier_key as update_elsevier_key,
7
+ update_openai_key as update_openai_key)
8
+
9
+ SETTINGS = load_settings()
10
+ locals().update(SETTINGS)
@@ -0,0 +1,11 @@
1
+ """Hold the PaperMinerToolkit version as a dependency-free constant.
2
+
3
+ The version lives in its own module so that packaging can read it by static
4
+ parse and so that low-level modules such as :mod:`paperminertoolkit.providers.base` can
5
+ build a user agent from it without importing the package root, which would
6
+ pull in settings and the whole provider stack.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ __version__ = '1.0.0'