Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds getBible to the https://pypi.org/project/getbible/ project #3

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading