Salinic
Salinic - provides modular search. It features a unified API that allows you to plug in different search backends. Currently, it supports Xapian and Solr backends.
Usage
Declare your search schema:
from typing import Optional
from typing_extensions import Annotated
from salinic.field import IdField, KeywordField, TextField
from salinic.schema import Schema
class MyModel(Schema):
"""Index schema"""
id: Annotated[str, IdField(primary_key=True)]
user_id: str
parent_id: str
title: Annotated[str, TextField()]
text: Annotated[Optional[str], TextField()] = None
tags: Annotated[Optional[list[str]], KeywordField()] = []
Index your documents:
from salinic import IndexRW, create_engine
engine = create_engine("xapian:////search_index")
index = IndexRW(engine, schema=MyModel)
for document in all_your_documents():
model = MyModel(
id=str(document.id),
user_id=str(document.user_id),
parent_id=document.parent_id,
title=document.title,
text=document.text,
tags=document.tags
)
index.add(model)
Search your documents:
from salinic import IndexRO, create_engine
engine = create_engine("xapian:////search_index")
index = IndexRO(engine, schema=MyModel)
sq = Search(MyModel).query(" your query string ")
for found in index.search(sq):
print(found) # found is instance of MyModel
The only modification of your for changing to different search
engine backend, is the first argument of the create_engine method e.g. from
"xapian:////search_index" to "solr://localhost:8983/my-index-name".
Metadata
Release files for salinic 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| salinic-0.6.1.tar.gz | 13.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| salinic-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.2 kB
Release files / salinic-0.6.1.tar.gz
| Download URL | salinic-0.6.1.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b88181ce18fa1a434aa39d1b7d96387605e6610c4cda681a03e9bab2a77547e9
|
|
BLAKE2b-256 checksum How to use checksums |
f2562a3cdf342aa8c0ed272a048686819f441439eef7dc79d352e9dfd24fa941
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.1 Linux/6.5.0-1025-azure
|
Release files / salinic-0.6.1-py3-none-any.whl
| Download URL | salinic-0.6.1-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01db1d2861b4fc8b4bf8e451553668479bd229eca4090155e9c760344080ebea
|
|
BLAKE2b-256 checksum How to use checksums |
147a865ebda332f8a6e2e9dd74827174b14c8b5b149c77a3a5f7ca2907265fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.1 Linux/6.5.0-1025-azure
|
Security for salinic 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.