lean-explore 0.2.2__py3-none-any.whl → 1.0.0__py3-none-any.whl

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 (55) hide show
  1. lean_explore/__init__.py +14 -1
  2. lean_explore/api/__init__.py +12 -1
  3. lean_explore/api/client.py +60 -80
  4. lean_explore/cli/__init__.py +10 -1
  5. lean_explore/cli/data_commands.py +157 -479
  6. lean_explore/cli/display.py +171 -0
  7. lean_explore/cli/main.py +51 -608
  8. lean_explore/config.py +244 -0
  9. lean_explore/extract/__init__.py +5 -0
  10. lean_explore/extract/__main__.py +368 -0
  11. lean_explore/extract/doc_gen4.py +200 -0
  12. lean_explore/extract/doc_parser.py +499 -0
  13. lean_explore/extract/embeddings.py +371 -0
  14. lean_explore/extract/github.py +110 -0
  15. lean_explore/extract/index.py +317 -0
  16. lean_explore/extract/informalize.py +653 -0
  17. lean_explore/extract/package_config.py +59 -0
  18. lean_explore/extract/package_registry.py +45 -0
  19. lean_explore/extract/package_utils.py +105 -0
  20. lean_explore/extract/types.py +25 -0
  21. lean_explore/mcp/__init__.py +11 -1
  22. lean_explore/mcp/app.py +14 -46
  23. lean_explore/mcp/server.py +20 -35
  24. lean_explore/mcp/tools.py +70 -177
  25. lean_explore/models/__init__.py +9 -0
  26. lean_explore/models/search_db.py +76 -0
  27. lean_explore/models/search_types.py +53 -0
  28. lean_explore/search/__init__.py +32 -0
  29. lean_explore/search/engine.py +655 -0
  30. lean_explore/search/scoring.py +156 -0
  31. lean_explore/search/service.py +68 -0
  32. lean_explore/search/tokenization.py +71 -0
  33. lean_explore/util/__init__.py +28 -0
  34. lean_explore/util/embedding_client.py +92 -0
  35. lean_explore/util/logging.py +22 -0
  36. lean_explore/util/openrouter_client.py +63 -0
  37. lean_explore/util/reranker_client.py +189 -0
  38. {lean_explore-0.2.2.dist-info → lean_explore-1.0.0.dist-info}/METADATA +55 -10
  39. lean_explore-1.0.0.dist-info/RECORD +43 -0
  40. {lean_explore-0.2.2.dist-info → lean_explore-1.0.0.dist-info}/WHEEL +1 -1
  41. lean_explore-1.0.0.dist-info/entry_points.txt +2 -0
  42. lean_explore/cli/agent.py +0 -781
  43. lean_explore/cli/config_utils.py +0 -481
  44. lean_explore/defaults.py +0 -114
  45. lean_explore/local/__init__.py +0 -1
  46. lean_explore/local/search.py +0 -1050
  47. lean_explore/local/service.py +0 -392
  48. lean_explore/shared/__init__.py +0 -1
  49. lean_explore/shared/models/__init__.py +0 -1
  50. lean_explore/shared/models/api.py +0 -117
  51. lean_explore/shared/models/db.py +0 -396
  52. lean_explore-0.2.2.dist-info/RECORD +0 -26
  53. lean_explore-0.2.2.dist-info/entry_points.txt +0 -2
  54. {lean_explore-0.2.2.dist-info → lean_explore-1.0.0.dist-info}/licenses/LICENSE +0 -0
  55. {lean_explore-0.2.2.dist-info → lean_explore-1.0.0.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lean-explore
3
- Version: 0.2.2
4
- Summary: A project to explore and rank Lean mathematical declarations.
3
+ Version: 1.0.0
4
+ Summary: A search engine for Lean 4 declarations.
5
5
  Author-email: Justin Asher <justinchadwickasher@gmail.com>
6
6
  License: Apache License
7
7
  Version 2.0, January 2004
@@ -208,7 +208,7 @@ License: Apache License
208
208
  Project-URL: Homepage, https://www.leanexplore.com/
209
209
  Project-URL: Repository, https://github.com/justincasher/lean-explore
210
210
  Keywords: lean,lean4,search,formal methods,theorem prover,math,AI
211
- Classifier: Development Status :: 3 - Alpha
211
+ Classifier: Development Status :: 4 - Beta
212
212
  Classifier: Intended Audience :: Developers
213
213
  Classifier: Intended Audience :: Science/Research
214
214
  Classifier: License :: OSI Approved :: Apache Software License
@@ -223,12 +223,13 @@ Requires-Python: >=3.10
223
223
  Description-Content-Type: text/markdown
224
224
  License-File: LICENSE
225
225
  Requires-Dist: sqlalchemy>=2.0
226
+ Requires-Dist: aiosqlite>=0.19.0
227
+ Requires-Dist: greenlet>=3.0.0
226
228
  Requires-Dist: numpy>=1.20
227
229
  Requires-Dist: faiss-cpu>=1.7
228
- Requires-Dist: sentence-transformers>=2.2.0
229
230
  Requires-Dist: filelock>=3.0.0
230
231
  Requires-Dist: nltk>=3.6
231
- Requires-Dist: rank-bm25>=0.2.2
232
+ Requires-Dist: bm25s>=0.2.0
232
233
  Requires-Dist: httpx>=0.23.0
233
234
  Requires-Dist: pydantic>=2.0
234
235
  Requires-Dist: typer[all]>=0.9.0
@@ -236,10 +237,47 @@ Requires-Dist: toml>=0.10.0
236
237
  Requires-Dist: openai-agents>=0.0.16
237
238
  Requires-Dist: mcp>=1.9.0
238
239
  Requires-Dist: tqdm>=4.60
240
+ Requires-Dist: rich>=13.0.0
239
241
  Requires-Dist: requests>=2.25.0
242
+ Requires-Dist: tenacity>=8.0.0
243
+ Requires-Dist: pooch>=1.8.0
244
+ Provides-Extra: extract
245
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "extract"
246
+ Requires-Dist: networkx>=3.0; extra == "extract"
247
+ Requires-Dist: torch>=2.0.0; extra == "extract"
248
+ Provides-Extra: dev
249
+ Requires-Dist: pytest>=7.0; extra == "dev"
250
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
251
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
252
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
253
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
254
+ Requires-Dist: networkx>=3.0; extra == "dev"
255
+ Requires-Dist: torch>=2.0.0; extra == "dev"
256
+ Requires-Dist: sentence-transformers>=2.2.0; extra == "dev"
240
257
  Dynamic: license-file
241
258
 
242
- # LeanExplore
259
+ <h1 align="center">
260
+ LeanExplore
261
+ </h1>
262
+
263
+ <h3 align="center">
264
+ A search engine for Lean 4 declarations
265
+ </h3>
266
+
267
+ <p align="center">
268
+ <a href="https://pypi.org/project/lean-explore/">
269
+ <img src="https://img.shields.io/pypi/v/lean-explore.svg" alt="PyPI version" />
270
+ </a>
271
+ <a href="https://github.com/justincasher/lean-explore/blob/main/LeanExplore.pdf">
272
+ <img src="https://img.shields.io/badge/Paper-PDF-blue.svg" alt="Read the Paper" />
273
+ </a>
274
+ <a href="https://github.com/justincasher/lean-explore/commits/main">
275
+ <img src="https://img.shields.io/github/last-commit/justincasher/lean-explore" alt="last update" />
276
+ </a>
277
+ <a href="https://github.com/justincasher/lean-explore/blob/main/LICENSE">
278
+ <img src="https://img.shields.io/github/license/justincasher/lean-explore.svg" alt="license" />
279
+ </a>
280
+ </p>
243
281
 
244
282
  A search engine for Lean 4 declarations. This project provides tools and resources for exploring the Lean 4 ecosystem.
245
283
 
@@ -248,6 +286,10 @@ A search engine for Lean 4 declarations. This project provides tools and resourc
248
286
  The current indexed projects include:
249
287
 
250
288
  * Batteries
289
+ * CSLib
290
+ * FLT (Fermat's Last Theorem)
291
+ * FormalConjectures
292
+ * Init
251
293
  * Lean
252
294
  * Mathlib
253
295
  * PhysLean
@@ -255,13 +297,17 @@ The current indexed projects include:
255
297
 
256
298
  This code is distributed under an Apache License (see [LICENSE](LICENSE)).
257
299
 
258
- ### Cite
300
+ ## Contributing
301
+
302
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on code style, testing, and development setup.
303
+
304
+ ## Cite
259
305
 
260
306
  If you use LeanExplore in your research or work, please cite it as follows:
261
307
 
262
308
  **General Citation:**
263
309
 
264
- Justin Asher. (2025). *LeanExplore: A search engine for Lean 4 declarations*. LeanExplore.com. (GitHub: [https://github.com/justincasher/lean-explore](https://github.com/justincasher/lean-explore)).
310
+ Justin Asher. (2025). *LeanExplore: A search engine for Lean 4 declarations*. [https://arxiv.org/abs/2506.11085](https://arxiv.org/abs/2506.11085)
265
311
 
266
312
  **BibTeX Entry:**
267
313
 
@@ -270,7 +316,6 @@ Justin Asher. (2025). *LeanExplore: A search engine for Lean 4 declarations*. Le
270
316
  author = {Asher, Justin},
271
317
  title = {{LeanExplore: A search engine for Lean 4 declarations}},
272
318
  year = {2025},
273
- url = {http://www.leanexplore.com},
274
- note = {GitHub repository: https://github.com/justincasher/lean-explore}
319
+ url = {https://arxiv.org/abs/2506.11085}
275
320
  }
276
321
  ```
@@ -0,0 +1,43 @@
1
+ lean_explore/__init__.py,sha256=HUVaIg0PB32Y-mDDlrndfERlY3hmpqFE-dr6wR_3hl4,683
2
+ lean_explore/config.py,sha256=oZzGbpmOn1h2IZV6O9CNbw-zRasoOb8ejogkOqVp_BY,8464
3
+ lean_explore/api/__init__.py,sha256=twql10w_SSqNbMD3tsCi0KYFp5A5n3UmUKSAfgWtwFc,341
4
+ lean_explore/api/client.py,sha256=udvC28Sa797DxdfiAGRGgPpDMHPp3yN1ymkfwJ-wvi8,3741
5
+ lean_explore/cli/__init__.py,sha256=JRpFfaP3DdPcPZ2MMIjJVw1RJ9gXLc8vBDa77favFlA,405
6
+ lean_explore/cli/data_commands.py,sha256=zjlC_--KiqaueXqdKtRXxU89bKfZZmCAsOD1qJPcVo8,7362
7
+ lean_explore/cli/display.py,sha256=t7qfP8Cdw05KM-kfYmFEeWSHNzyYuBOcvx4aCb5lFv0,5338
8
+ lean_explore/cli/main.py,sha256=feVxTmzH0FMZGP7Urb6X43atlESJIYXgC6DJylgiKp0,3937
9
+ lean_explore/extract/__init__.py,sha256=ZpCPPHjFCRxyHwYxQNhGpbpd_XuZOkgB9qkxa9zSUD0,184
10
+ lean_explore/extract/__main__.py,sha256=Aquy2g-WIU7YO39UZRq0EoHgJWW-uM5G0FSK2OwDuR8,12010
11
+ lean_explore/extract/doc_gen4.py,sha256=lnnc__YRTlSkGE8A432ecvTraWsoicHUDEQYHC5wNaw,6730
12
+ lean_explore/extract/doc_parser.py,sha256=tb3y7409mn5DhPjR2prPh2Cm7QMf3VJy8qfir_-Y4z8,17511
13
+ lean_explore/extract/embeddings.py,sha256=td53atXAAO15E4-MfEO2bVKdKQrz32-EzkfZXDpE-0A,11897
14
+ lean_explore/extract/github.py,sha256=1Zyyl2u1esULJ3KFHHL8F80zcxLDx1Fh8u_gxCmBTi8,3499
15
+ lean_explore/extract/index.py,sha256=cCZsLePSSGqHKINTifGaRp95RjIQQ9q2cxTlYnLlV0Y,10093
16
+ lean_explore/extract/informalize.py,sha256=AtjRQUvvaL22yn_D8Ik0HS3Xv-s6U9mwTv0sWMWs8oM,22209
17
+ lean_explore/extract/package_config.py,sha256=-09icflXgioPzpnXNPhpTPkKixxBmWCLNsxEY50Uq2g,1890
18
+ lean_explore/extract/package_registry.py,sha256=N-M3WYry77P80pjt12lpFcCuPW1M9SgxiCd_N8-EoXw,1565
19
+ lean_explore/extract/package_utils.py,sha256=61d8EgCVdXZ44gfT9OeVwfBYhqjrbPsCwVVjQ2Zvylg,3400
20
+ lean_explore/extract/types.py,sha256=Sp6sYuioTE_Gs0Z0lbq4h7OMyAnaZafdLV8UGtKn-zs,583
21
+ lean_explore/mcp/__init__.py,sha256=YO0RM466ik2jQk8YMDITzkm3AHPtjEhn7Wm7rOusUXo,462
22
+ lean_explore/mcp/app.py,sha256=PJ2HwX6VyTqKejuI1G8Ld4aO9XWp9hT5H8loaA5g0Lc,2173
23
+ lean_explore/mcp/server.py,sha256=Lf3SCn8ghPNkZ3BybHh3VCXn91F-yX6RSRke1rvC7Pk,8234
24
+ lean_explore/mcp/tools.py,sha256=hs2lo66GcvGWbOGFEvFouXKwHrWo7rjftkuHpW4MYIY,4514
25
+ lean_explore/models/__init__.py,sha256=G2Xeld_DADq-hhxm1K1CrEPeAM3ylHU2ckCh42Ogxro,321
26
+ lean_explore/models/search_db.py,sha256=_a6B6FpqUevyHvW4KmNLeziiznIuxftpMUy0AtSDBJE,2673
27
+ lean_explore/models/search_types.py,sha256=VcFGrK5Z12Cg9f2R-Y6GXGlh2SunyBAJaZ5I4DG0AUw,1442
28
+ lean_explore/search/__init__.py,sha256=0k_iHe5xrurepznk7NzMYz10QFbK10ydMlpFlsuyFSc,1216
29
+ lean_explore/search/engine.py,sha256=zP1jvxmknATXjzBDdrACmGhpwsFvtv2zcPOBErOUC-c,23645
30
+ lean_explore/search/scoring.py,sha256=VkH-kpGheX14_tf8uJYBOp0nrG05_JJLmv7_0QdfAQk,4168
31
+ lean_explore/search/service.py,sha256=6CWN-U5jxv7cTzc7ffitgzNMn3k59LfirpteC4xsvSE,1915
32
+ lean_explore/search/tokenization.py,sha256=1EHd3dbJLwnmrj2SmdU1W8WoyCUnzhJB5gzmZLpWifs,1831
33
+ lean_explore/util/__init__.py,sha256=07QNedHV2KNBRMfQKzkw4nbgZn5-W5_YRtqpeUnSokg,896
34
+ lean_explore/util/embedding_client.py,sha256=6XJGJrGTXAiefDr-E1j_SPHTTZMIJYi62PwXXLdSLDQ,3098
35
+ lean_explore/util/logging.py,sha256=hF8YPi-1I6DdC1B_yROXA6u5GG14IIhD0Nym2FfqgRA,649
36
+ lean_explore/util/openrouter_client.py,sha256=C_0HLO5o1seYjGl2zn6897i2onK7CdI6XxtE3cWb3Os,1926
37
+ lean_explore/util/reranker_client.py,sha256=7a5qTA7Dza_E4KvwWL6I5dRLjHrRTB8I2CynKJ0AmKc,6106
38
+ lean_explore-1.0.0.dist-info/licenses/LICENSE,sha256=l4QLw1kIvEOjUktmmKm4dycK1E249Qs2s2AQTYbMXpY,11354
39
+ lean_explore-1.0.0.dist-info/METADATA,sha256=sLZlcyWFOoPRS6MHUjsN0oqgP92KQJj4fEmEbzVbo7k,17084
40
+ lean_explore-1.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
41
+ lean_explore-1.0.0.dist-info/entry_points.txt,sha256=FuKSRE7GmI9B_kM-xoiWEJj2dQ4upqhHnw8qH1vcjW8,59
42
+ lean_explore-1.0.0.dist-info/top_level.txt,sha256=h51BKWrFvB7iym-IlaNAAHX5MZfA8Gmg-aDuXGo0fQ8,13
43
+ lean_explore-1.0.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ lean-explore = lean_explore.cli.main:app