lupyne


Namelupyne JSON
Version 3.3 PyPI version JSON
download
home_pageNone
SummaryPythonic search engine based on PyLucene.
upload_time2024-10-20 17:11:41
maintainerNone
docs_urlhttps://pythonhosted.org/lupyne/
authorNone
requires_python>=3.9
licenseCopyright 2022 Aric Coady Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords lucene pylucene
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![image](https://img.shields.io/pypi/v/lupyne.svg)](https://pypi.org/project/lupyne/)
![image](https://img.shields.io/pypi/pyversions/lupyne.svg)
[![image](https://pepy.tech/badge/lupyne)](https://pepy.tech/project/lupyne)
![image](https://img.shields.io/pypi/status/lupyne.svg)
[![build](https://github.com/coady/lupyne/actions/workflows/build.yml/badge.svg)](https://github.com/coady/lupyne/actions/workflows/build.yml)
[![image](https://codecov.io/gh/coady/lupyne/branch/main/graph/badge.svg)](https://codecov.io/gh/coady/lupyne/)
[![CodeQL](https://github.com/coady/lupyne/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/coady/lupyne/actions/workflows/github-code-scanning/codeql)
[![image](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![image](https://mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)

Lupyne is a search engine based on [PyLucene](https://lucene.apache.org/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](https://www.starlette.io). 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.

```python
import lucene

lucene.initVM()
```

Indexes are accessed through an `IndexSearcher` (read-only), `IndexWriter`, or the combined `Indexer`.

```python
from lupyne import engine

searcher = engine.IndexSearcher('index/path')
hits = searcher.search('text:query')
```

See `./lupyne/services/README.md` for services usage.

## Installation
```console
% pip install lupyne[graphql,rest]
```

PyLucene is not `pip` installable.
* [Install instructions](https://lucene.apache.org/pylucene/install.html)
* [Docker](https://hub.docker.com) image: `docker pull coady/pylucene`
* [Homebrew](https://brew.sh) formula: `brew install coady/tap/pylucene`

## Dependencies
* PyLucene >=9.12
* strawberry-graphql (if graphql option)
* fastapi (if rest option)

## Tests
100% branch coverage.

```console
% pytest [--cov]
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "lupyne",
    "maintainer": null,
    "docs_url": "https://pythonhosted.org/lupyne/",
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "lucene, pylucene",
    "author": null,
    "author_email": "Aric Coady <aric.coady@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/51/47/0dee77ff14422116323d68df05e8ca52a26d8d5160d804c78313001f0089/lupyne-3.3.tar.gz",
    "platform": null,
    "description": "[![image](https://img.shields.io/pypi/v/lupyne.svg)](https://pypi.org/project/lupyne/)\n![image](https://img.shields.io/pypi/pyversions/lupyne.svg)\n[![image](https://pepy.tech/badge/lupyne)](https://pepy.tech/project/lupyne)\n![image](https://img.shields.io/pypi/status/lupyne.svg)\n[![build](https://github.com/coady/lupyne/actions/workflows/build.yml/badge.svg)](https://github.com/coady/lupyne/actions/workflows/build.yml)\n[![image](https://codecov.io/gh/coady/lupyne/branch/main/graph/badge.svg)](https://codecov.io/gh/coady/lupyne/)\n[![CodeQL](https://github.com/coady/lupyne/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/coady/lupyne/actions/workflows/github-code-scanning/codeql)\n[![image](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![image](https://mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)\n\nLupyne is a search engine based on [PyLucene](https://lucene.apache.org/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.\n\nLupyne also provides GraphQL and RESTful search services, based on [Starlette](https://www.starlette.io). 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.\n\nNot 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.\n\n## Usage\nPyLucene requires initializing the VM.\n\n```python\nimport lucene\n\nlucene.initVM()\n```\n\nIndexes are accessed through an `IndexSearcher` (read-only), `IndexWriter`, or the combined `Indexer`.\n\n```python\nfrom lupyne import engine\n\nsearcher = engine.IndexSearcher('index/path')\nhits = searcher.search('text:query')\n```\n\nSee `./lupyne/services/README.md` for services usage.\n\n## Installation\n```console\n% pip install lupyne[graphql,rest]\n```\n\nPyLucene is not `pip` installable.\n* [Install instructions](https://lucene.apache.org/pylucene/install.html)\n* [Docker](https://hub.docker.com) image: `docker pull coady/pylucene`\n* [Homebrew](https://brew.sh) formula: `brew install coady/tap/pylucene`\n\n## Dependencies\n* PyLucene >=9.12\n* strawberry-graphql (if graphql option)\n* fastapi (if rest option)\n\n## Tests\n100% branch coverage.\n\n```console\n% pytest [--cov]\n```\n",
    "bugtrack_url": null,
    "license": "Copyright 2022 Aric Coady  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
    "summary": "Pythonic search engine based on PyLucene.",
    "version": "3.3",
    "project_urls": {
        "Changelog": "https://github.com/coady/lupyne/blob/main/CHANGELOG.md",
        "Documentation": "https://coady.github.io/lupyne",
        "Homepage": "https://github.com/coady/lupyne",
        "Issues": "https://github.com/coady/lupyne/issues"
    },
    "split_keywords": [
        "lucene",
        " pylucene"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88bb214ce3452e6d4facbf0f02927afc7dbbded80e8a74f495fe0f1a77df41e7",
                "md5": "a59c324b61c0fa1f0cf5ba1611f94080",
                "sha256": "f92efff08926a5691ab5d4b81d128f12569d4c8c8016c0dc7332a1cdb3a5662e"
            },
            "downloads": -1,
            "filename": "lupyne-3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a59c324b61c0fa1f0cf5ba1611f94080",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 27692,
            "upload_time": "2024-10-20T17:11:39",
            "upload_time_iso_8601": "2024-10-20T17:11:39.762174Z",
            "url": "https://files.pythonhosted.org/packages/88/bb/214ce3452e6d4facbf0f02927afc7dbbded80e8a74f495fe0f1a77df41e7/lupyne-3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51470dee77ff14422116323d68df05e8ca52a26d8d5160d804c78313001f0089",
                "md5": "7d87e0562247e2442ca10fc102c95bea",
                "sha256": "9d231896754041c67cf8276a2e23a713fad53740ed1919e750c53cbff9305229"
            },
            "downloads": -1,
            "filename": "lupyne-3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "7d87e0562247e2442ca10fc102c95bea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 33964,
            "upload_time": "2024-10-20T17:11:41",
            "upload_time_iso_8601": "2024-10-20T17:11:41.961954Z",
            "url": "https://files.pythonhosted.org/packages/51/47/0dee77ff14422116323d68df05e8ca52a26d8d5160d804c78313001f0089/lupyne-3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-20 17:11:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "coady",
    "github_project": "lupyne",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "lupyne"
}
        
Elapsed time: 3.18928s