Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Mar 25, 2017
0 parents commit d75706e
Show file tree
Hide file tree
Showing 5 changed files with 137,849 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.egg-info/
__pycache__/
dist/
*.pyc
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# py-nestle1904

Like py-sblgnt does for the MorphGNT SBLGNT, **py-nestle1904** provides a pip-installable package that combines the Nestle 1904 text with morphology and lemmatisation and a Python API for accessing it.

This way, Python tools built on the Nestle 1904 can include **py-nestle1904** as a requirement to be installed globally or into a virtualenv and no other set up is necessary.

Note that, even though this repo and package contain the Nestle 1904 database, the [Nestle 1904 repo](https://github.com/biblicalhumanities/Nestle1904) remains the authoritative source of the data and all data corrections should be reported there.

All credit for the data belongs to those people acknowledged there.


## How to Use

Firstly, install with

```
pip install py-nestle1904
```

Then in your code...

```
from pynestle1904 import nestle_rows
for row in nestle_rows():
...
```

Each `row` will be a dictionary with the keys:

```
"ref", "text", "parse1", "parse2", "strongs", "lemma", "norm"
```

See the [Nestle 1904 repo](https://github.com/biblicalhumanities/Nestle1904) for details of these fields.

## License

The text and data is in the Public Domain.

The code here is made available under an MIT License.
12 changes: 12 additions & 0 deletions pynestle1904/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os.path

FILENAME = "nestle1904.csv"
FIELD_NAMES = ("ref", "text", "parse1", "parse2", "strongs", "lemma", "norm")

def nestle_rows():
"""
yield a dict for each Nestle 1904 row.
"""
with open(os.path.join(os.path.dirname(__file__), FILENAME)) as f:
for line in f:
yield dict(zip(FIELD_NAMES, line.strip().split("\t")))
Loading

0 comments on commit d75706e

Please sign in to comment.