Pythonic search engine based on PyLucene.
Project description
Lupyne is a search engine based on PyLucene, the Python extension for accessing Java Lucene. Lucene is a relatively low-level toolkit, and PyLucene wraps it through automatic code generation. So although Java idioms are translated to Python idioms where possible, the resulting interface is far from Pythonic. See ./docs/examples.ipynb for comparisons with the Lucene API.
Lupyne also provides GraphQL and RESTful search services, based on Starlette. Note Solr and Elasticsearch are popular options for Lucene-based search, if no further (Python) customization is needed. So while the services are suitable for production usage, their primary motivation is to be an extensible example.
Not having to initially choose between an embedded library and a server not only provides greater flexibility, it can provide better performance, e.g., batch indexing offline and remote searching live. Additionally only lightweight wrappers with extended behavior are used wherever possible, so falling back to using PyLucene directly is always an option, but should never be necessary for performance.
Usage
PyLucene requires initializing the VM.
import lucene
lucene.initVM()
Indexes are accessed through an IndexSearcher (read-only), IndexWriter, or the combined Indexer.
from lupyne import engine
searcher = engine.IndexSearcher('index/path')
hits = searcher.search('text:query')
See ./lupyne/services/README.md for services usage.
Installation
pip install lupyne[graphql,rest]
PyLucene is not pip installable.
- Install instructions
- Docker image:
docker pull coady/pylucene - Homebrew formula:
brew install coady/tap/pylucene
Dependencies
- PyLucene >=10
- strawberry-graphql (if graphql option)
- fastapi (if rest option)
Tests
100% branch coverage.
pytest [--cov]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lupyne-3.3.1.tar.gz.
File metadata
- Download URL: lupyne-3.3.1.tar.gz
- Upload date:
- Size: 33.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a49a1447638ac428c1e4ec783e44cc029d2a366c72cb9190fd5fffd423893035
|
|
| MD5 |
2ebfbf347dede8dc913a70684f4d8e9e
|
|
| BLAKE2b-256 |
56da0e2332ece38bcd1413268f3fbe5e71ed1c02cf8926c4672f3a886c03ddde
|
Provenance
The following attestation bundles were made for lupyne-3.3.1.tar.gz:
Publisher:
release.yml on coady/lupyne
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lupyne-3.3.1.tar.gz -
Subject digest:
a49a1447638ac428c1e4ec783e44cc029d2a366c72cb9190fd5fffd423893035 - Sigstore transparency entry: 661830185
- Sigstore integration time:
-
Permalink:
coady/lupyne@1ff7a5c422f008f5f6140c4938529d7f8d6fc2cc -
Branch / Tag:
refs/heads/rel - Owner: https://github.com/coady
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1ff7a5c422f008f5f6140c4938529d7f8d6fc2cc -
Trigger Event:
push
-
Statement type:
File details
Details for the file lupyne-3.3.1-py3-none-any.whl.
File metadata
- Download URL: lupyne-3.3.1-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9c5f4e4361acfe83040dea05d2244b92515b0b169ba04944ebae13e2e9b132b
|
|
| MD5 |
619c60848e7ae134add09bce7f364046
|
|
| BLAKE2b-256 |
a39a9c5e2c3b4e78d9381a49657b491e691fee206fc9493973315b18acd6f384
|
Provenance
The following attestation bundles were made for lupyne-3.3.1-py3-none-any.whl:
Publisher:
release.yml on coady/lupyne
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lupyne-3.3.1-py3-none-any.whl -
Subject digest:
a9c5f4e4361acfe83040dea05d2244b92515b0b169ba04944ebae13e2e9b132b - Sigstore transparency entry: 661830190
- Sigstore integration time:
-
Permalink:
coady/lupyne@1ff7a5c422f008f5f6140c4938529d7f8d6fc2cc -
Branch / Tag:
refs/heads/rel - Owner: https://github.com/coady
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1ff7a5c422f008f5f6140c4938529d7f8d6fc2cc -
Trigger Event:
push
-
Statement type: