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

getBible.net now has Two API endpoints... #111

Open
Llewellynvdm opened this issue Nov 9, 2023 · 4 comments
Open

getBible.net now has Two API endpoints... #111

Llewellynvdm opened this issue Nov 9, 2023 · 4 comments

Comments

@Llewellynvdm
Copy link

Greetings Rene, trust you're doing well.

I have very good news, we have just finished what we are calling the query API endpoint: https://query.getbible.net/v2/kjv/1 John 3:16

Have a look at https://getbible.net/docs.

So, this new endpoint is also part of the V2 API and will continue (Lord willing) for a very long time. See the roadmap.

I then thought, well, let's make a basic add scripture to website script and wrote this: https://git.vdm.dev/getBible/loader/src/branch/master/dist/js/getBible.js.

Now, I would like to expand with your help... (if you like).

Currently, it just adds a tooltip, but I think it can do so much more. Let me know what you think... the query API has given back to us the option to each pull verses. I want to improve its reference identifiers as well.

I mean, adding the ability to the API to catch any kind of reference would be ideal.

This new query API is built with Python, and I am willing to show you the code, all you need is an account at: https://git.vdm.dev/, and let me know who you are there... and I will add you. Yes, it is private for security reasons at this time... but when you see how simple it was to get it working, you will be surprised for sure. I mean, the whole API is 140 lines in total.
image
Yes, that is currently the bottom of the API class file.

Well, looking forward to hearing from you, take care!

@Llewellynvdm
Copy link
Author

Ahh I see your already on the system at https://git.vdm.dev/ (for some time already :) well I added you to the getBible Collaborators group, so you should see the private repos. See you there....

@renehamburger
Copy link
Owner

That's a fantastic new feature, @Llewellynvdm! I shall definitely put the move from api.getbible.net to api.getbible.net on the blinx.js roadmap. Right now I am very pressed for time, so it will probably take a few months before I have time to make the change.

Concerning your getBible-loader-script, I have a few initial questions:

  • Does your new query-API support multiple passage reference formats (in English), e.g. "Jn 3" for "John 3"? Or is that something you would want to add in the browser script?
  • What about other languages or references like "John 3:16 and verse 26"? If you wanted to increase the "reference identifier" support, especially across languages, you might need to use something like https://github.com/openbibleinfo/Bible-Passage-Reference-Parser, which blinx.js is built on (and which may be overhauled some time soon).
  • If this is where you would be heading, why not use blinx.js instead, which recognises a wide variety of passage reference formats and does not require the addition of specific HTML wrappers/classes.

@Llewellynvdm
Copy link
Author

Llewellynvdm commented Nov 11, 2023

Hi @renehamburger, that all sounds good, and I'd like to explore some of your ideas and suggestions.

I've created a Python script (only made it public today) that you can find here: https://git.vdm.dev/getBible/booknumber (see below).

This script utilizes these datasets: https://git.vdm.dev/getBible/booknumber/src/branch/master/src/getbible/book_number/data (see below).

They comprise a very comprehensive set of files covering the abbreviations of nearly 56 languages and should enable the derivation of the book number from any abbreviation or reference of a book.

I am using a trie node data structure to load these datasets, allowing for fast and effective retrieval of the book number for nearly any Bible book reference or abbreviation present in our API. The necessity for this to be in Python, as the API is also Python-based, and the requirement for simplicity to facilitate ease of adding additional references and stuff, were key considerations.

I have not yet integrated this into the new query API, but plan to do so soon.

So, to answer your question, I aim for the API to be as agnostic as possible, ensuring that any reference provided will elicit the correct data.

@Llewellynvdm
Copy link
Author

Llewellynvdm commented Nov 12, 2023

I have now moved the search for the book number (so old links are now broken) and the parsing of the reference in to a new package: https://git.vdm.dev/getBible/librarian

Which can installed and used with:

pip install --index-url https://git.vdm.dev/api/packages/getBible/pypi/simple/ getBible-librarian

The data is now at: https://git.vdm.dev/getBible/librarian/src/branch/master/src/getbible/data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants