<commit_before># Flask-Z3950

[![Build Status](https://travis-ci.org/alexandermendes/Flask-Z3950.svg?branch=master)]
(https://travis-ci.org/alexandermendes/Flask-Z3950)
[![Coverage Status](https://coveralls.io/repos/alexandermendes/Flask-Z3950/badge.svg)]
(https://coveralls.io/github/alexandermendes/Flask-Z3950?branch=master)
[![Code Health](https://landscape.io/github/alexandermendes/Flask-Z3950/master/landscape.svg)]
(https://landscape.io/github/alexandermendes/Flask-Z3950/master)

A [Flask](http://flask.pocoo.org/) plugin for [Z39.50](https://en.wikipedia.org/wiki/Z39.50) integration.


## Installation

Flask-Z3950 is available on PyPi:

```
$ pip install Flask-Z3950
```

## Configuration

Z39.50 connection details can be specified by adding the following variable to
your Flask configuration file:

```
Z3950_DATABASES = {'name': {'host': '', 'db': '', 'port': '', 'user': '', 'password': '', 'syntax': ''}}

Multiple databases can be configured by adding additional dictionaries, for an
example of such a configuration see [settings_test.py](settings_test.py).


## Usage

To initialise the the plugin and start performing Z39.50 searches:

```Python
from flask import Flask
from flask_z3950 import Z3950Manager

app = Flask(__name__)<commit_msg>Close code block in README<commit_after># Flask-Z3950

[![Build Status](https://travis-ci.org/alexandermendes/Flask-Z3950.svg?branch=master)]
(https://travis-ci.org/alexandermendes/Flask-Z3950)
[![Coverage Status](https://coveralls.io/repos/alexandermendes/Flask-Z3950/badge.svg)]
(https://coveralls.io/github/alexandermendes/Flask-Z3950?branch=master)
[![Code Health](https://landscape.io/github/alexandermendes/Flask-Z3950/master/landscape.svg)]
(https://landscape.io/github/alexandermendes/Flask-Z3950/master)

A [Flask](http://flask.pocoo.org/) plugin for [Z39.50](https://en.wikipedia.org/wiki/Z39.50) integration.


## Installation

Flask-Z3950 is available on PyPi:

```
$ pip install Flask-Z3950
```

## Configuration

Z39.50 connection details can be specified by adding the following variable to
your Flask configuration file:

```
Z3950_DATABASES = {'name': {'host': '', 'db': '', 'port': '', 'user': '', 'password': '', 'syntax': ''}}
```

Multiple databases can be configured by adding additional dictionaries, for an
example of such a configuration see [settings_test.py](settings_test.py).


## Usage

To initialise the the plugin and start performing Z39.50 searches:

```Python
from flask import Flask
from flask_z3950 import Z3950Manager

app = Flask(__name__)
{'fraction_non_alphanumeric': 0.15478534856242615, 'fraction_numerical': 0.05041354864119732, 'mean_word_length': 5.546391752577319, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4896973', 'n_tokens_mistral': 977, 'n_tokens_neox': 871, 'n_words': 185}