Skip to main content

scout is a restful search server written in python with a focus on using lightweight components:

Scout aims to be a lightweight, RESTful search server in the spirit of ElasticSearch, powered by the SQLite full-text search extension. In addition to search, Scout can be used as a document database, supporting complex filtering operations. Arbitrary files can be attached to documents and downloaded through the REST API.

Scout is simple to use, simple to deploy and just works.

Features:

  • multiple search indexes present in a single database.
  • restful design for easy indexing and searching.
  • simple key-based authentication (optional).
  • lightweight, low resource utilization, minimal setup required.
  • store search content and arbitrary metadata.
  • attach files or BLOBs to indexed documents.
  • BM25 result ranking, porter stemmer.
  • filtering based on metadata values.
  • attachment search and filtering.
  • powered by SQLite FTS5.
  • documentation hosted on rtd.

Installation

Scout requires Python 3.8+ and a version of SQLite compiled with the FTS5 extension (included by default since SQLite 3.9.0, released 2015). You can verify FTS5 support by running:

python -c "import sqlite3; sqlite3.connect(':memory:').execute('CREATE VIRTUAL TABLE t USING fts5(x)')"

If this command fails, your SQLite build does not include FTS5 and you will need to install or compile a version that does.

Scout can be installed from PyPI using pip or from source using git. Should you install from PyPI you will run the latest version, whereas installing from git ensures you have the latest changes.

Alternatively, you can run scout using docker and the provided Dockerfile.

Installation using pip:

pip install scout

You can also install the latest master branch using pip:

pip install -e git+https://github.com/coleifer/scout.git#egg=scout

If you wish to install from source, first clone the code and run setup.py install:

git clone https://github.com/coleifer/scout.git
cd scout/
pip install .

Using either of the above methods will also ensure the project's Python dependencies are installed: flask and peewee.

Check out the documentation for more information about the project.

Running scout

If you installed using pip, you should be able to simply run:

scout /path/to/search-index.db

If you've just got a copy of the source code, you can run:

python scout/ /path/to/search-index.db

Production-ready server

Scout comes with a production-ready WSGI server powered by gevent. To use this server instead, you can run:

scout_wsgi /path/to/search-index.db

Docker

The Docker image runs Scout on port 9004 (rather than the default 8000) using the built-in gevent WSGI server. The database path defaults to /data/search-index.db and is controlled by the SCOUT_DATABASE environment variable. The /data directory is declared as a volume.

To run scout using docker, you can use the provided Dockerfile or simply pull the coleifer/scout image from dockerhub:

docker run -d \
    --name scout \
    -p 9004:9004 \
    -v scout-data:/data \
    coleifer/scout
# scout is now running on localhost:9004

Note: Always mount a volume to /data (as shown above) to persist your search index across container restarts.

Build your own image locally and run it:

cd scout/docker
docker build -t scout .
docker run -d \
    --name my-scout-server \
    -p 9004:9004 \
    -v scout-data:/data \
    scout

Overriding settings

You can pass additional Scout CLI flags by appending them to docker run:

docker run -d \
    -p 9004:9004 \
    -v scout-data:/data \
    coleifer/scout \
    -k my-secret-api-key \
    --paginate-by 100

You can override the database location with the SCOUT_DATABASE environment variable:

docker run -d \
    -p 9004:9004 \
    -e SCOUT_DATABASE=/data/my-index.db \
    -v scout-data:/data \
    coleifer/scout

Migrating an existing database

If you are upgrading from an older Scout version that used FTS4, you can run the migration inside the container:

docker run --rm \
    -v scout-data:/data \
    coleifer/scout --migrate

Release files for scout 4.0.0

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

Source distribution (sdist)

Source distribution for scout 4.0.0
File Size Uploaded
scout-4.0.0.tar.gz 77.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scout 4.0.0
File Interpreter ABI Platform
scout-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 124.2 kB

Release files / scout-4.0.0.tar.gz

Download URL scout-4.0.0.tar.gz
Size 77.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bf8b681b5186dffd329a10551aa4c146f1c37a766d811b4d7bee4042b7c3b34e
BLAKE2b-256 checksum
How to use checksums
6b43b2f389fd0271242a2770859dc2b33a8287dfc234f235a28526a2ecdf5e46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / scout-4.0.0-py3-none-any.whl

Download URL scout-4.0.0-py3-none-any.whl
Size 46.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23fe6550f18e9f6a9d50d597c750b7ed1e7181a84872e1527c026a446a38253c
BLAKE2b-256 checksum
How to use checksums
92bec9b7de1e11ebc1562af167c5e7c23e8783e7a3613646e5bcc700c3f6a0e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.1.0

2 release files

3.0.4

2 release files

3.0.3

1 release file

3.0.2

1 release file

3.0.1

1 release file

3.0.0

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

0.1.0

1 release file

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