Skip to main content

Pythonic search engine based on PyLucene.

Project description

image image image image build image CodeQL image image

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.

Dependencies

  • PyLucene >=10
  • strawberry-graphql (if graphql option)
  • fastapi (if rest option)

Tests

100% branch coverage.

pytest [--cov]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lupyne-3.3.1.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lupyne-3.3.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

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

Hashes for lupyne-3.3.1.tar.gz
Algorithm Hash digest
SHA256 a49a1447638ac428c1e4ec783e44cc029d2a366c72cb9190fd5fffd423893035
MD5 2ebfbf347dede8dc913a70684f4d8e9e
BLAKE2b-256 56da0e2332ece38bcd1413268f3fbe5e71ed1c02cf8926c4672f3a886c03ddde

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupyne-3.3.1.tar.gz:

Publisher: release.yml on coady/lupyne

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for lupyne-3.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9c5f4e4361acfe83040dea05d2244b92515b0b169ba04944ebae13e2e9b132b
MD5 619c60848e7ae134add09bce7f364046
BLAKE2b-256 a39a9c5e2c3b4e78d9381a49657b491e691fee206fc9493973315b18acd6f384

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupyne-3.3.1-py3-none-any.whl:

Publisher: release.yml on coady/lupyne

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page