Skip to content

Commit

Permalink
Adds getBible to the https://pypi.org/project/getbible/ project, and …
Browse files Browse the repository at this point in the history
…updated all documentation and workflows to now point to this package.
  • Loading branch information
Llewellynvdm committed Nov 14, 2023
1 parent a2b9522 commit 7d945d1
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 345 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,10 @@ jobs:
run: |
python -m build
- name: Configure .pypirc
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
echo "[distutils]" > ~/.pypirc
echo "index-servers = getbible" >> ~/.pypirc
echo "[getbible]" >> ~/.pypirc
echo "repository = https://${{ secrets.GITEA_URL }}/api/packages/${{ github.repository_owner }}/pypi" >> ~/.pypirc
echo "username = ${{ secrets.GITEA_USERNAME }}" >> ~/.pypirc
echo "password = ${{ secrets.GITEA_TOKEN }}" >> ~/.pypirc
twine upload dist/*
- name: Push to Gitea
run: python3 -m twine upload --repository getbible dist/*
116 changes: 107 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,119 @@

[![Stable Librarian](https://github.com/getbible/librarian/actions/workflows/stable-librarian.yml/badge.svg)](https://github.com/getbible/librarian/actions/workflows/stable-librarian.yml)

The `getBible Librarian` package is a Python library designed for efficiently retrieving the scripture reference across various translations.
The `getBible` Librarian package is a Python library designed for efficiently retrieving the scripture reference across various translations.

## Installation

```bash
pip install getbible
```

## Features

- [Get Scripture](https://git.vdm.dev/getBible/librarian/src/branch/master/docs/getbible_scripture.md)
- [Get Reference](https://git.vdm.dev/getBible/librarian/src/branch/master/docs/getbible_reference.md)
- [Get Book Number](https://git.vdm.dev/getBible/librarian/src/branch/master/docs/getbible_book_number.md)
### Get Scripture

```python
import json
from getbible import GetBible

# Initialize the class
getbible = GetBible()

# Get the scripture as JSON
scripture_json = getbible.scripture("Genesis 1:1")
print(scripture_json) # Outputs the JSON scripture as a string.

# Get the scripture as dictionary
scripture_dict = getbible.select("Genesis 1:1")
print(json.dumps(scripture_dict, indent=4)) # Pretty-prints the dictionary.
```

#### Using Translation Abbreviations

When utilizing the `GetBible` class to look up a reference, you can use the lowercase abbreviations of the target translation:

```python
import json
from getbible import GetBible

# Initialize the class
getbible = GetBible()

scripture = getbible.select("Genesis 1:1-5", 'aov')
print(json.dumps(scripture, indent=4)) # Pretty-prints the dictionary.
```

In this code snippet, `"aov"` is used as the abbreviation for the Afrikaans Ou Vertaaling.

### Get Reference

```python
from getbible import GetBibleReference

# Initialize the class
get = GetBibleReference()

# Find well form reference
reference = get.ref("Genesis 1:1-5")
print(reference) # Outputs the dataclass [BookReference] { book: int, chapter: int, verses: list }
```

#### Using Translation Abbreviations

When utilizing the `GetBibleReference` class to look up a reference, you can use the lowercase abbreviations of the target translation:

```python
from getbible import GetBibleReference

# Initialize the class
get = GetBibleReference()

reference = get.ref("Genesis 1:1-5", 'kjv')
```

## Installation (pip)
In this code snippet, `"kjv"` is used as the abbreviation for the King James Version to speedup the search.

### Get Book Number

```python
from getbible import GetBibleBookNumber

# Initialize the class
get_book = GetBibleBookNumber()

# Find a book number
book_number = get_book.number("Genesis")
print(book_number) # Outputs the book number of "Genesis" = 1
```

#### Available Translations and Abbreviations

The `GetBibleBookNumber` package supports a range of Bible translations, each identified by a lowercase abbreviation. These abbreviations and the corresponding translation data are stored in the `data` folder.

#### Finding Translation Abbreviations

To find the available translation abbreviations:

1. Go to the `data` [directory in the package](https://git.vdm.dev/getBible/librarian/src/branch/master/src/getbible/data).
2. Each JSON file in this directory corresponds to a different translation.
3. The file name (without the `.json` extension) represents the abbreviation for that translation.

For instance, if you find a file named `kjv.json`, then `kjv` is the abbreviation for the King James Version translation.

#### Using Translation Abbreviations

When utilizing the `GetBibleBookNumber` class to look up a book number, you should use these lowercase abbreviations:

```python
book_number = get_book.number("Gen", "kjv", ["aov", "swahili"])
```

To install the package using pip, see [the documentation](https://git.vdm.dev/getBible/-/packages/pypi/getbible-librarian).
In this code snippet, `"kjv"` is used as the abbreviation for the King James Version, `"aov"` for the Afrikaans Ou Vertaaling, and `"swahili"` for the Swahili Version.

## Installation (git)
## Source Installation (git)

To install `getBible-Librarian`, you need to clone the repository and install the package manually. Ensure you have Python 3.7 or higher installed.
To install `getBible` Librarian, you need to clone the repository and install the package manually. Ensure you have Python 3.7 or higher installed.

```bash
git clone https://git.vdm.dev/getBible/librarian.git
Expand Down Expand Up @@ -44,7 +142,7 @@ python -m unittest

## Contributing

Contributions to the `getBible-Librarian` package are welcome. Please ensure to follow the coding standards and write tests for new features.
Contributions to the `getbible` Librarian package are welcome. Please ensure to follow the coding standards and write tests for new features.

## License

Expand Down
90 changes: 0 additions & 90 deletions docs/getbible_book_number.md

This file was deleted.

79 changes: 0 additions & 79 deletions docs/getbible_deploy_gitea.md

This file was deleted.

Loading

0 comments on commit 7d945d1

Please sign in to comment.