Skip to main content

Dogsheep search index

Project description

dogsheep-beta

PyPI Changelog Tests License

Dogsheep search index

Installation

Install this tool like so:

$ pip install dogsheep-beta

Usage

Run the indexer using the dogsheep-beta command-line tool:

$ dogsheep-beta index dogsheep.db config.yml

The config.yml file contains details of the databases and tables that should be indexed:

twitter.db:
    tweets:
        sql: |-
            select
                tweets.id as key,
                'Tweet by @' || users.screen_name as title,
                tweets.created_at as timestamp,
                tweets.full_text as search_1
            from tweets join users on tweets.user = users.id
    users:
        sql: |-
            select
                id as key,
                name || ' @' || screen_name as title,
                created_at as timestamp,
                description as search_1
            from users

This will create a search_index table in the dogsheep.db database populated by data from those SQL queries.

By default the search index that this tool creates will be configured for Porter stemming. This means that searches for words like run will match documents containing runs or running.

If you don't want to use Porter stemming, use the --tokenize none option:

$ dogsheep-beta index dogsheep.db config.yml --tokenize none

You can pass other SQLite tokenize argumenst here, see the SQLite FTS tokenizers documentation.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd dogsheep-beta
python3 -mvenv venv
source venv/bin/activate

Or if you are using pipenv:

pipenv shell

Now install the dependencies and tests:

pip install -e '.[test]'

To run the tests:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dogsheep-beta-0.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

dogsheep_beta-0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file dogsheep-beta-0.2.tar.gz.

File metadata

  • Download URL: dogsheep-beta-0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for dogsheep-beta-0.2.tar.gz
Algorithm Hash digest
SHA256 bd877a38027608dd1b470682bb7975c17138c5d034a8598bb87aed2eada20f2b
MD5 38b87f9caa833c0f3609893d2b337c3b
BLAKE2b-256 cd4f498d17c42928856b23bd2beeea126f3a8827fb3817b73d0b8e8166b62e9d

See more details on using hashes here.

File details

Details for the file dogsheep_beta-0.2-py3-none-any.whl.

File metadata

  • Download URL: dogsheep_beta-0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for dogsheep_beta-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d599bede9403b946d617f8de59a6abfd7459255fb55f78d94bff5b4f338e741
MD5 1c9e3d70d8cf776c797a545ce5d7ed98
BLAKE2b-256 db18612134d6f9b0a360f3bb7b2e96b8be0d817c1e4d49fecb15338f10e714c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page