tantivy-py
Python bindings for Tantivy.
Installation
The bindings can be installed using from pypi using pip:
pip install tantivy
If no binary wheel is present for your operating system the bindings will be build from source, this means that Rust needs to be installed before building can succeed.
Note that the bindings are using PyO3, which only supports python3.
Development
Setting up a development environment can be done in a virtual environment using
nox or using local packages using the provided Makefile.
For the nox setup install the virtual environment and build the bindings using:
python3 -m pip install nox
nox
For the Makefile based setup run:
make
Running the tests is done using:
make test
Usage
The Python bindings have a similar API to Tantivy. To create a index first a schema needs to be built. After that documents can be added to the index and a reader can be created to search the index.
import tantivy
# Declaring our schema.
schema_builder = tantivy.SchemaBuilder()
schema_builder.add_text_field("title", stored=True)
schema_builder.add_text_field("body", stored=True)
schema = schema_builder.build()
# Creating our index (in memory, but filesystem is available too)
index = tantivy.Index(schema)
# Adding one document.
writer = index.writer()
writer.add_document(tantivy.Document(
title=["The Old Man and the Sea"],
body=["""He was an old man who fished alone in a skiff in the Gulf Stream and he had gone eighty-four days now without taking a fish."""],
))
# ... and committing
writer.commit()
# Reload the index to ensure it points to the last commit.
index.reload()
searcher = index.searcher()
query = index.parse_query("fish days", ["title", "body"])
(best_score, best_doc_address) = searcher.search(query, 3).hits[0]
best_doc = searcher.doc(best_doc_address)
assert best_doc["title"] == ["The Old Man and the Sea"]
print(best_doc)
Metadata
Release files for tantivy-mirror 0.17.0
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 | |
|---|---|---|---|---|
| tantivy_mirror-0.17.0.tar.gz | 21.3 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 36.2 MB
Release files / tantivy_mirror-0.17.0.tar.gz
| Download URL | tantivy_mirror-0.17.0.tar.gz |
|---|---|
| Size | 21.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa15d9e5ac35a74c28f14da0ea1d2a132443d71bce2f68b938629687bb1ea0df
|
|
BLAKE2b-256 checksum How to use checksums |
cfba719212ce64930e5a1a408e7deec71a278c39b8fcdf76ebfd81227418c3a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | tantivy_mirror-0.17.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | Linux glibc 2.5+ x86-64 PyPy 3.7 PyPy 3.7 7.3 |
|
SHA-256 checksum How to use checksums |
9dc33f8d24bc212fe8728bda5ba645e282de5a81656ce7e69993052b7af9a87c
|
|
BLAKE2b-256 checksum How to use checksums |
17904fb56e812abdca5b9282f5f208344e4877c27bf8de63b42db7f0bbb8a740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp310-none-win_amd64.whl
| Download URL | tantivy_mirror-0.17.0-cp310-none-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
72c39ce415ebbeae4dd2f16e9acfbe0665ede28bfd1f24e8dc807308d62a8196
|
|
BLAKE2b-256 checksum How to use checksums |
84f3523c9bd8a889f6d39f8ee1cd1f49521ef0384c13b22e908dcabe79a8df20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | tantivy_mirror-0.17.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.10 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
a6b9d65d444c9a394ab0b92286e330108b992ca01b5884f343790fda98ab292c
|
|
BLAKE2b-256 checksum How to use checksums |
92ea33ebdeea7aa7f92f616a06fe91c0315beaf3fcecf7d9935e2bf49628a65a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | tantivy_mirror-0.17.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c0c5b3f0533717c1253586342e5d490ae75fea7aa173324b33fb753f32ba9925
|
|
BLAKE2b-256 checksum How to use checksums |
05bf008eb4390cbdea1f6887e8a434c185284c0f1d0fd4f0611802420d1edda2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp39-none-win_amd64.whl
| Download URL | tantivy_mirror-0.17.0-cp39-none-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5da737f878301f1f00e483b61181646d489625395ef13e5bfabc32028bfa0f32
|
|
BLAKE2b-256 checksum How to use checksums |
663a206b74c5606e0f05932c8d128cad09024b4053df6d1a77c5d63b8fdaa886
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | tantivy_mirror-0.17.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
fd486f271c4fa30d864b99c0021593b2d926e8c437a4b573c7f231061c416493
|
|
BLAKE2b-256 checksum How to use checksums |
9e00cf543d72f844033796a9e9f577a42b767037eba91c320d3c02a0dc748f5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | tantivy_mirror-0.17.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
13e717dd7cd6a95b95ee8f3094e5b6ce29343feb3840eaa27e1e05419fdd960f
|
|
BLAKE2b-256 checksum How to use checksums |
82ad65b1a8516036d934129ef7b59811187d1a55233856d3b0f6456aeada275e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp38-none-win_amd64.whl
| Download URL | tantivy_mirror-0.17.0-cp38-none-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0be49e4f8dc4a9eacc536dd9b6eb3dbc156a24bdec83be9144d3b3dc943dcbc5
|
|
BLAKE2b-256 checksum How to use checksums |
6d2df4084c83d3ad258d802aeddb3412bb2d25900f65d34ce8ad4f5f8c835d7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | tantivy_mirror-0.17.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
57c7c6233202612615c55e6b55ba91c315e15968cab38ae036fac97a53e49662
|
|
BLAKE2b-256 checksum How to use checksums |
5e79314b9216f8353f21af28a844ac2f2e378dc5180efc89140b3a9731dd4ce9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | tantivy_mirror-0.17.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
52e24cda6a1d94a5aa7c82b142a2e23256f27fefd3b8904ced1dfceb3f10124b
|
|
BLAKE2b-256 checksum How to use checksums |
7531afe07ca1909921048d981dd40ca4334af654e62a39381b15f2e93160698f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp37-none-win_amd64.whl
| Download URL | tantivy_mirror-0.17.0-cp37-none-win_amd64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.7 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d6385b470cc1e520bb4b28d334a0c39dc45b0a25364920268a526af2a3b4dd77
|
|
BLAKE2b-256 checksum How to use checksums |
c5f84eb9c7b3d3d5fd9e142817660e8351643e3168dc05723968d5f0a76e0537
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | tantivy_mirror-0.17.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
408a0a6f0b67b69b253bc167c565cd829b39fade72fa15f7686d6889a7770628
|
|
BLAKE2b-256 checksum How to use checksums |
8d69ab3b7acbb975232f82c930dd0138defaa8ac607c1fbbb3c5ff585f47018e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Release files / tantivy_mirror-0.17.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | tantivy_mirror-0.17.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
55a973603fad7889b4e7932a0892f65e6448396b7c66b27341c3a1a33687bef9
|
|
BLAKE2b-256 checksum How to use checksums |
115bb1f034ccca11a51387c0c2f866f11e378f32d56cf2bf4f3cfd166a8d1466
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.17
|
Security for tantivy-mirror 0.17.0
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.