Skip to main content

Pythonic search engine based on PyLucene.

Project description

image image image image build image CodeQL image ty

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 examples 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", count=None)

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.4.tar.gz (33.5 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.4-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file lupyne-3.4.tar.gz.

File metadata

  • Download URL: lupyne-3.4.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for lupyne-3.4.tar.gz
Algorithm Hash digest
SHA256 10b8b4e57ffe88e31048733af5e2dbee3f9fcc16431d102e40e9d10bf7a29b6a
MD5 8ee28f26656e0e9e5bab57c84bfaa5dc
BLAKE2b-256 eff2e71adf9f494609432d3deb1c6546bf9d405d176271e7423395a44fbda9f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupyne-3.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: lupyne-3.4-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for lupyne-3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 55ea46d5e62ab9ebe4ce325ea0062d87f4abb249580e144ddc7d9eff0a9fc78e
MD5 adfd86e59713d5d2d712428e275bc97c
BLAKE2b-256 884a493ffbc23f542c8f7c762bd17b09d7765407491dc9fa08c52f4e49da5373

See more details on using hashes here.

Provenance

The following attestation bundles were made for lupyne-3.4-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