Skip to main content

indexr

https://img.shields.io/pypi/v/indexr.svg https://img.shields.io/travis/kevin91nl/indexr.svg https://readthedocs.org/projects/indexr/badge/

A general purpose indexer written in Python. Licensed under the MIT license.

Features

The indexr.buildr package is capable of constructing an inverted index.

The indexr.utils package contains utilities, such as a tokenization method for converting a text to tokens.

Setup

This package can be installed using pip:

pip install indexr

Examples

In this example, an indexer is constructed for 3 files. The example uses the following 3 files:

0.txt:

The 0th document.

1.txt:

The 1st document.

2.txt:

The 2nd document. Some words: repeat, repeat, repeat.

The following code sample can be found in the demo directory (demo/buildr.py).

# Build the index
index = build_index(files, 'index', force_rebuild=True, indexer=SPIMI(show_progress=True))

# Try to find the word "1st"
print('All found occurrences of "1st":')
print(index.find('1st', frequencies=True), "\n")

# Try to find the word "The"
print('All found occurrences of "The":')
print(index.find('The', frequencies=True), "\n")

# Try to find the word "repeat"
print('All found occurrences of "repeat":')
print(index.find('repeat', frequencies=True), "\n")

It gives the following output:

>>> All found occurrences of "1st":
>>> {'1.txt': 1}
>>>
>>> All found occurrences of "The":
>>> {'0.txt': 1, '1.txt': 1, '2.txt': 1}
>>>
>>> All found occurrences of "repeat":
>>> {'2.txt': 3}

So indeed, it finds 1 occurrence of “1st”, 3 occurrences of “The” (1 occurrence in each file) and 3 occurrences of “repeat” (3 occurrences in one file).

Documentation

https://indexr.readthedocs.org

Credits

Tools used in rendering this package:

History

1.0.1 (2015-12-07)

  • First release, including the BSB algorithm and the SPIMI algorithm.

0.1.0 (2015-12-04)

  • First release on PyPI.

Metadata

Release files for indexr 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for indexr 1.0.1
File Size Uploaded Provenance Actions
indexr-1.0.1.zip 24.9 kB Without provenance Details for indexr-1.0.1.zip

Built distribution (wheel)

Table of built distributions (wheels) for indexr 1.0.1
File Interpreter ABI Platform Actions
indexr-1.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for indexr-1.0.1-py2.py3-none-any.whl

Total release size: 37.6 kB

Release files / indexr-1.0.1.zip

Download URL indexr-1.0.1.zip
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
56f19eea181d251991ac3fec2d944c94278525612e5ab02b5635e2e7cc34beec
BLAKE2b-256 checksum
How to use checksums
b7da8e4845d5559c11483826812c9c814d83cc4eddf515dd4033526c37bee59a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / indexr-1.0.1-py2.py3-none-any.whl

Download URL indexr-1.0.1-py2.py3-none-any.whl
Size 12.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d621513926350694a97d9230e8b6f7dcf72e47f72f2ff6232e1defcadbe41f89
BLAKE2b-256 checksum
How to use checksums
feff05c0f5ee3c658e6d65363aa093c43a0f808f0a0171faaf820e537d547532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for indexr 1.0.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page