Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fedora-copr/flask-whooshee
Customizable Flask - SQLAlchemy - Whoosh integration
https://github.com/fedora-copr/flask-whooshee
flask sqlalchemy whoosh
Last synced: about 4 hours ago
JSON representation
Customizable Flask - SQLAlchemy - Whoosh integration
- Host: GitHub
- URL: https://github.com/fedora-copr/flask-whooshee
- Owner: fedora-copr
- License: bsd-3-clause
- Created: 2013-02-13T14:51:45.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2024-02-15T16:12:36.000Z (9 months ago)
- Last Synced: 2024-09-19T19:50:51.974Z (about 2 months ago)
- Topics: flask, sqlalchemy, whoosh
- Language: Python
- Size: 198 KB
- Stars: 85
- Watchers: 11
- Forks: 32
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Flask-Whooshee
==============[![Build Status](https://github.com/fedora-copr/flask-whooshee/actions/workflows/main.yml/badge.svg)](https://github.com/fedora-copr/flask-whooshee/actions)
[![PyPI Version](https://img.shields.io/pypi/v/flask-whooshee.svg)](https://pypi.python.org/pypi/flask-whooshee)
[![License](https://img.shields.io/badge/license-BSD-yellow.svg)](https://github.com/fedora-copr/flask-whooshee)*Adds Whoosh integration to Flask-SQLAlchemy.*
Flask-Whooshee provides a more advanced Whoosh integration for Flask.
Its main power is in the ability to index and search joined queries.The project is in early beta stage and is fairly stable.
However, API may still change before 1.0.0 release.Flask-Whooshee is licensed under BSD License.
Note that up until 0.3.0 it was licensed under GPLv2+.Quickstart
----------Install it from PyPI:
```
$ pip install Flask-Whooshee
```Flask-Whooshee supports two different methods of setting up the extension.
You can either initialize it directly, thus binding it to a specific
application instance:```python
app = Flask(__name__)
whooshee = Whooshee(app)
```and the second is to use the factory pattern which will allow you to
configure whooshee at a later point:```python
whooshee = Whooshee()
def create_app():
app = Flask(__name__)
whooshee.init_app(app)
return app
```Now you can create a basic whoosheer:
```python
@whooshee.register_model('title', 'content')
class Entry(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String)
content = db.Column(db.Text)
```and finally you can search the model:
```python
Entry.query.whooshee_search('chuck norris').order_by(Entry.id.desc()).all()
```Links
=====* [Documentation](https://flask-whooshee.readthedocs.io)
* [Source Code](https://github.com/fedora-copr/flask-whooshee)
* [Issues](https://github.com/fedora-copr/flask-whooshee/issues)