scruby-full-text
Plugin for Scruby - Full-text search with Manticore Search.
Scruby-Full-Text is a plugin for the Scruby project.
Installation
uv add scruby-full-text
Install Manticore Search
For more information, see the documentation.
- Fedora 42 or later
# Install the repository:
sudo tee /etc/yum.repos.d/manticore.repo << "EOF" > /dev/null
[manticore]
name=Manticore Repository
baseurl=http://repo.manticoresearch.com/repository/manticoresearch/release/centos/10/$basearch
gpgcheck=1
enabled=1
gpgkey=https://repo.manticoresearch.com/GPG-KEY-SHA256-manticore
EOF
# Install Manticore Search:
sudo dnf install manticore manticore-extra
# Install English, German, and Russian lemmatizers:
sudo dnf install manticore-language-packs
# Run Manticore Search:
sudo systemctl start manticore
sudo systemctl enable manticore
sudo systemctl status manticore --no-pager -l
Usage
import anyio
from typing import Any
from pydantic import Field
from scruby import Scruby, ScrubyModel, ScrubySettings
from scruby_full_text import FullTextSearch, FullTextSettings
from pprint import pprint as pp
# Plugins connection.
ScrubySettings.plugins = [
FullTextSearch,
]
class Car(ScrubyModel):
brand: str = Field(strict=True, frozen=True)
model: str = Field(strict=True, frozen=True)
year: int = Field(strict=True, frozen=True)
power_reserve: int = Field(strict=True, frozen=True)
description: str = Field(strict=True)
# key is always at bottom
key: str = Field(
strict=True,
frozen=True,
default_factory=lambda data: f"{data['brand']}:{data['model']}",
)
async def main() -> None:
"""Example."""
# Delete unnecessary tables that remain due to errors
await FullTextSearch.delete_orphaned_tables()
# Get collection `Car`
car_coll = await Scruby.collection(Car)
# Create cars.
for num in range(1, 10):
car = Car(
brand="Mazda",
model=f"EZ-6 {num}",
year=2025,
power_reserve=600,
description="Electric cars are the future of the global automotive industry.",
)
await car_coll.add_doc(car)
# Find one car
car = await car_coll.plugins.fullTextSearch.find_one(
morphology=FullTextSettings.morphology.get("English"), # 'English' or 'en'
full_text_filter=("model", "EZ-6 9"),
# filter_fn=lambda doc: doc.brand == "Mazda",
)
if car is not None:
pp(car)
else:
print("Not Found")
# Fand many cars
car_list = await car_coll.plugins.fullTextSearch.find_many(
morphology=FullTextSettings.morphology.get("en"), # 'en' or 'English'
full_text_filter=("description", "future of automotive"),
# filter_fn=lambda doc: doc.brand == "Mazda",
)
if car_list is not None:
pp(car_list)
else:
print("Not Found")
# Full database deletion.
# Hint: The main purpose is tests.
Scruby.napalm()
if __name__ == "__main__":
anyio.run(main)
Metadata
Release files for scruby-full-text 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scruby_full_text-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for scruby_full_text-0.6.1-py3-none-any.whl |
Release files / scruby_full_text-0.6.1-py3-none-any.whl
| Download URL | scruby_full_text-0.6.1-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4705dbffeee1b0d7aac59d757aa9daaa781896b1640b43a3a6b2503166ccfea5
|
|
BLAKE2b-256 checksum How to use checksums |
50059d451e92c37a3d7d47a14c6d3028142ebcc62ddc33966d0b0685621bf116
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"42","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for scruby-full-text 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.