bibleome 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. bibleome-0.1.0/LICENSE +202 -0
  2. bibleome-0.1.0/NOTICE +23 -0
  3. bibleome-0.1.0/PKG-INFO +118 -0
  4. bibleome-0.1.0/README.md +88 -0
  5. bibleome-0.1.0/pyproject.toml +52 -0
  6. bibleome-0.1.0/setup.cfg +4 -0
  7. bibleome-0.1.0/src/bibleome/__init__.py +3 -0
  8. bibleome-0.1.0/src/bibleome/app.py +47 -0
  9. bibleome-0.1.0/src/bibleome/cli.py +128 -0
  10. bibleome-0.1.0/src/bibleome/db.py +131 -0
  11. bibleome-0.1.0/src/bibleome/oia.py +130 -0
  12. bibleome-0.1.0/src/bibleome/packs.py +312 -0
  13. bibleome-0.1.0/src/bibleome/routers/__init__.py +1 -0
  14. bibleome-0.1.0/src/bibleome/routers/lexicon.py +68 -0
  15. bibleome-0.1.0/src/bibleome/routers/oia.py +93 -0
  16. bibleome-0.1.0/src/bibleome/routers/passages.py +123 -0
  17. bibleome-0.1.0/src/bibleome/routers/scripture.py +192 -0
  18. bibleome-0.1.0/src/bibleome/routers/search.py +96 -0
  19. bibleome-0.1.0/src/bibleome/routers/system.py +99 -0
  20. bibleome-0.1.0/src/bibleome/schema.py +288 -0
  21. bibleome-0.1.0/src/bibleome/schemas/oia-v1.schema.json +157 -0
  22. bibleome-0.1.0/src/bibleome/seed/sample_seed.json +1 -0
  23. bibleome-0.1.0/src/bibleome/seed_builder.py +148 -0
  24. bibleome-0.1.0/src/bibleome/vectors.py +127 -0
  25. bibleome-0.1.0/src/bibleome/web/app.js +183 -0
  26. bibleome-0.1.0/src/bibleome/web/index.html +54 -0
  27. bibleome-0.1.0/src/bibleome/web/locales/ar.json +22 -0
  28. bibleome-0.1.0/src/bibleome/web/locales/en.json +22 -0
  29. bibleome-0.1.0/src/bibleome/web/locales/ja.json +22 -0
  30. bibleome-0.1.0/src/bibleome/web/locales/zh-HK.json +22 -0
  31. bibleome-0.1.0/src/bibleome/web/style.css +137 -0
  32. bibleome-0.1.0/src/bibleome.egg-info/PKG-INFO +118 -0
  33. bibleome-0.1.0/src/bibleome.egg-info/SOURCES.txt +36 -0
  34. bibleome-0.1.0/src/bibleome.egg-info/dependency_links.txt +1 -0
  35. bibleome-0.1.0/src/bibleome.egg-info/entry_points.txt +2 -0
  36. bibleome-0.1.0/src/bibleome.egg-info/requires.txt +12 -0
  37. bibleome-0.1.0/src/bibleome.egg-info/top_level.txt +1 -0
  38. bibleome-0.1.0/tests/test_bibleome.py +177 -0
bibleome-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
bibleome-0.1.0/NOTICE ADDED
@@ -0,0 +1,23 @@
1
+ Bibleome
2
+ Copyright 2026 The Bibleome Authors
3
+
4
+ This product includes software developed by the Bibleome open-source project
5
+ (https://github.com/bibleome/bibleome).
6
+
7
+ Third-party Public Domain & Open-License Biblical Data Attribution:
8
+ - Westminster Leningrad Codex (WLC) & OpenScriptures Hebrew Bible (MorphHB):
9
+ Open Scriptures Hebrew Bible Project, CC-BY 4.0 (https://github.com/openscriptures/morphhb)
10
+ - OpenGNT (Greek New Testament morphology & lexical data):
11
+ Eliran Wong / OpenGNT Project, CC-BY-SA 4.0 (https://github.com/eliranwong/OpenGNT)
12
+ - Strong's Hebrew & Greek Lexicon:
13
+ OpenScriptures / Public Domain
14
+ - Treasury of Scripture Knowledge Cross-References:
15
+ OpenBible.info, CC-BY 4.0 (https://www.openbible.info/labs/cross-references/)
16
+ - World English Bible (WEB):
17
+ Public Domain (https://worldenglish.bible/)
18
+ - Chinese Union Version (CUV / 和合本, 1919):
19
+ Public Domain
20
+
21
+ Commercial or copyrighted Bible translations are NOT distributed with this
22
+ repository. Users may import their own legally licensed translations locally
23
+ using the Translation Pack protocol (`bibleome import-pack`).
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: bibleome
3
+ Version: 0.1.0
4
+ Summary: Open-source multilingual computational Bible engine: original Hebrew/Greek genomics, pluggable Translation Packs, optional semantic search, and vendor-neutral OIA study schema.
5
+ Author: The Bibleome Authors
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://bibleome.org
8
+ Project-URL: Demo, https://bibleome.com
9
+ Project-URL: Source, https://github.com/bibleome/bibleome
10
+ Keywords: bible,biblical-studies,hebrew,greek,strongs,oia,usfm,osis,fastapi,sqlite
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Topic :: Religion
15
+ Classifier: Topic :: Text Processing :: Linguistic
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ License-File: NOTICE
20
+ Requires-Dist: fastapi>=0.100
21
+ Requires-Dist: uvicorn>=0.23
22
+ Provides-Extra: mysql
23
+ Requires-Dist: pymysql>=1.1; extra == "mysql"
24
+ Provides-Extra: vectors
25
+ Requires-Dist: numpy>=1.24; extra == "vectors"
26
+ Provides-Extra: dev
27
+ Requires-Dist: httpx>=0.25; extra == "dev"
28
+ Requires-Dist: jsonschema>=4.18; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # Bibleome
32
+
33
+ **Open-source multilingual computational Bible engine**: original Hebrew/Greek genomics (MorphHB + OpenGNT + Strong's + TSK cross-references), pluggable **Translation Packs** for any language (USFM / OSIS / TSV / JSON, including RTL), optional semantic vector search, and a vendor-neutral **OIA (Observation / Interpretation / Application) JSON Schema v1**.
34
+
35
+ - **Website**: [bibleome.org](https://bibleome.org)
36
+ - **Live instance**: [bibleome.com](https://bibleome.com)
37
+ - **GitHub Organization**: [github.com/bibleome](https://github.com/bibleome)
38
+ - **Optional Lamellar OIA plate** (zero-hallucination local LLM study runner): [lamellar26/lamellar-pack-bibleome](https://github.com/lamellar26/lamellar-pack-bibleome)
39
+
40
+ ## Quickstart (3 minutes, zero external DB)
41
+
42
+ ```bash
43
+ pip install bibleome
44
+ bibleome init
45
+ bibleome serve
46
+ ```
47
+
48
+ Open `http://127.0.0.1:8080/` in your browser (or `http://127.0.0.1:8080/docs` for the OpenAPI explorer).
49
+
50
+ ### Docker Compose
51
+
52
+ ```bash
53
+ docker compose up --build
54
+ ```
55
+
56
+ ## Architecture
57
+
58
+ - **Dual database engine**: SQLite-first out of the box (`sqlite:///~/.bibleome/bibleome.db`) with seamless MySQL support (`pip install "bibleome[mysql]"` + `BIBLEOME_DB_URL=mysql://user:pass@host:3306/bibleome`).
59
+ - **Strictly language-neutral core**: No hardcoded bilingual assumptions. Add Japanese, Korean, Spanish, French, Arabic (RTL), Hebrew, Indonesian, or any other translation via standard Translation Packs.
60
+ - **Unified multi-language SPA (`web/`)**: Single frontend with community-contributed `locales/*.json` (`en`, `zh-HK`, `ja`, `ar`), automatic `dir="rtl"` switching, and graceful degradation when optional word alignments, OIA notes, or semantic vectors are not installed.
61
+ - **Copyright firewall (BYO-Bible)**: Only Public Domain / CC-BY seed data (WEB, CUV 1919, MorphHB, OpenGNT, Strong's, OpenBible TSK) is bundled. See [COPYRIGHT_AUDIT.md](COPYRIGHT_AUDIT.md) and [NOTICE](NOTICE).
62
+
63
+ ## Translation Pack Protocol (BYO-Bible)
64
+
65
+ Import any USFM, OSIS XML, TSV, or JSON translation pack:
66
+
67
+ ```text
68
+ my-spanish-pack/
69
+ ├── manifest.json
70
+ └── rv1909.tsv # or *.usfm / *.xml / *.json
71
+ ```
72
+
73
+ Example `manifest.json`:
74
+
75
+ ```json
76
+ {
77
+ "code": "rv1909",
78
+ "name": "Reina-Valera 1909",
79
+ "lang": "es",
80
+ "direction": "ltr",
81
+ "format": "tsv",
82
+ "license": "Public Domain",
83
+ "book_names": { "Gen": "Génesis", "Rom": "Romanos" }
84
+ }
85
+ ```
86
+
87
+ ```bash
88
+ bibleome import-pack ./my-spanish-pack
89
+ ```
90
+
91
+ ## Optional Semantic Vector Search
92
+
93
+ Bibleome starts cleanly with lexical search and zero `.npy` files. To enable vector search:
94
+
95
+ ```bash
96
+ pip install "bibleome[vectors]"
97
+ bibleome build-vectors --out ~/.bibleome/vectors
98
+ bibleome serve --vectors ~/.bibleome/vectors
99
+ ```
100
+
101
+ ## Open OIA JSON Schema v1 (Zero Vendor Lock-in)
102
+
103
+ Any LLM, scholar, or script can validate and import inductive OIA study notes:
104
+
105
+ ```bash
106
+ bibleome validate-oia my_study.json
107
+ curl -X POST http://127.0.0.1:8080/api/oia/import \
108
+ -H "Content-Type: application/json" \
109
+ -d '{"passage_id": 17956, "lang": "en", "model": "my-model", "content": ...}'
110
+ ```
111
+
112
+ Set `BIBLEOME_IMPORT_KEY` to protect the import endpoint with an `X-Import-Key` header.
113
+
114
+ For automated local-GPU zero-hallucination OIA generation with 5 deterministic verification gates, see the independent Lamellar plate [lamellar26/lamellar-pack-bibleome](https://github.com/lamellar26/lamellar-pack-bibleome).
115
+
116
+ ## License
117
+
118
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
@@ -0,0 +1,88 @@
1
+ # Bibleome
2
+
3
+ **Open-source multilingual computational Bible engine**: original Hebrew/Greek genomics (MorphHB + OpenGNT + Strong's + TSK cross-references), pluggable **Translation Packs** for any language (USFM / OSIS / TSV / JSON, including RTL), optional semantic vector search, and a vendor-neutral **OIA (Observation / Interpretation / Application) JSON Schema v1**.
4
+
5
+ - **Website**: [bibleome.org](https://bibleome.org)
6
+ - **Live instance**: [bibleome.com](https://bibleome.com)
7
+ - **GitHub Organization**: [github.com/bibleome](https://github.com/bibleome)
8
+ - **Optional Lamellar OIA plate** (zero-hallucination local LLM study runner): [lamellar26/lamellar-pack-bibleome](https://github.com/lamellar26/lamellar-pack-bibleome)
9
+
10
+ ## Quickstart (3 minutes, zero external DB)
11
+
12
+ ```bash
13
+ pip install bibleome
14
+ bibleome init
15
+ bibleome serve
16
+ ```
17
+
18
+ Open `http://127.0.0.1:8080/` in your browser (or `http://127.0.0.1:8080/docs` for the OpenAPI explorer).
19
+
20
+ ### Docker Compose
21
+
22
+ ```bash
23
+ docker compose up --build
24
+ ```
25
+
26
+ ## Architecture
27
+
28
+ - **Dual database engine**: SQLite-first out of the box (`sqlite:///~/.bibleome/bibleome.db`) with seamless MySQL support (`pip install "bibleome[mysql]"` + `BIBLEOME_DB_URL=mysql://user:pass@host:3306/bibleome`).
29
+ - **Strictly language-neutral core**: No hardcoded bilingual assumptions. Add Japanese, Korean, Spanish, French, Arabic (RTL), Hebrew, Indonesian, or any other translation via standard Translation Packs.
30
+ - **Unified multi-language SPA (`web/`)**: Single frontend with community-contributed `locales/*.json` (`en`, `zh-HK`, `ja`, `ar`), automatic `dir="rtl"` switching, and graceful degradation when optional word alignments, OIA notes, or semantic vectors are not installed.
31
+ - **Copyright firewall (BYO-Bible)**: Only Public Domain / CC-BY seed data (WEB, CUV 1919, MorphHB, OpenGNT, Strong's, OpenBible TSK) is bundled. See [COPYRIGHT_AUDIT.md](COPYRIGHT_AUDIT.md) and [NOTICE](NOTICE).
32
+
33
+ ## Translation Pack Protocol (BYO-Bible)
34
+
35
+ Import any USFM, OSIS XML, TSV, or JSON translation pack:
36
+
37
+ ```text
38
+ my-spanish-pack/
39
+ ├── manifest.json
40
+ └── rv1909.tsv # or *.usfm / *.xml / *.json
41
+ ```
42
+
43
+ Example `manifest.json`:
44
+
45
+ ```json
46
+ {
47
+ "code": "rv1909",
48
+ "name": "Reina-Valera 1909",
49
+ "lang": "es",
50
+ "direction": "ltr",
51
+ "format": "tsv",
52
+ "license": "Public Domain",
53
+ "book_names": { "Gen": "Génesis", "Rom": "Romanos" }
54
+ }
55
+ ```
56
+
57
+ ```bash
58
+ bibleome import-pack ./my-spanish-pack
59
+ ```
60
+
61
+ ## Optional Semantic Vector Search
62
+
63
+ Bibleome starts cleanly with lexical search and zero `.npy` files. To enable vector search:
64
+
65
+ ```bash
66
+ pip install "bibleome[vectors]"
67
+ bibleome build-vectors --out ~/.bibleome/vectors
68
+ bibleome serve --vectors ~/.bibleome/vectors
69
+ ```
70
+
71
+ ## Open OIA JSON Schema v1 (Zero Vendor Lock-in)
72
+
73
+ Any LLM, scholar, or script can validate and import inductive OIA study notes:
74
+
75
+ ```bash
76
+ bibleome validate-oia my_study.json
77
+ curl -X POST http://127.0.0.1:8080/api/oia/import \
78
+ -H "Content-Type: application/json" \
79
+ -d '{"passage_id": 17956, "lang": "en", "model": "my-model", "content": ...}'
80
+ ```
81
+
82
+ Set `BIBLEOME_IMPORT_KEY` to protect the import endpoint with an `X-Import-Key` header.
83
+
84
+ For automated local-GPU zero-hallucination OIA generation with 5 deterministic verification gates, see the independent Lamellar plate [lamellar26/lamellar-pack-bibleome](https://github.com/lamellar26/lamellar-pack-bibleome).
85
+
86
+ ## License
87
+
88
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "bibleome"
7
+ dynamic = ["version"]
8
+ description = "Open-source multilingual computational Bible engine: original Hebrew/Greek genomics, pluggable Translation Packs, optional semantic search, and vendor-neutral OIA study schema."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "Apache-2.0"}
12
+ authors = [{name = "The Bibleome Authors"}]
13
+ keywords = ["bible", "biblical-studies", "hebrew", "greek", "strongs", "oia", "usfm", "osis", "fastapi", "sqlite"]
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: Apache Software License",
17
+ "Operating System :: OS Independent",
18
+ "Topic :: Religion",
19
+ "Topic :: Text Processing :: Linguistic",
20
+ ]
21
+ dependencies = [
22
+ "fastapi>=0.100",
23
+ "uvicorn>=0.23",
24
+ ]
25
+
26
+ [project.optional-dependencies]
27
+ mysql = ["pymysql>=1.1"]
28
+ vectors = ["numpy>=1.24"]
29
+ dev = ["httpx>=0.25", "jsonschema>=4.18"]
30
+
31
+ [project.urls]
32
+ Homepage = "https://bibleome.org"
33
+ Demo = "https://bibleome.com"
34
+ Source = "https://github.com/bibleome/bibleome"
35
+
36
+ [project.scripts]
37
+ bibleome = "bibleome.cli:main"
38
+
39
+ [tool.setuptools.packages.find]
40
+ where = ["src"]
41
+ include = ["bibleome*"]
42
+
43
+ [tool.setuptools.package-data]
44
+ bibleome = [
45
+ "seed/*.json",
46
+ "schemas/*.json",
47
+ "web/*",
48
+ "web/locales/*.json",
49
+ ]
50
+
51
+ [tool.setuptools.dynamic]
52
+ version = {attr = "bibleome.__version__"}
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """Bibleome — open-source multilingual computational Bible engine."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,47 @@
1
+ """FastAPI application factory assembling modular routers and unified multi-language SPA."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from fastapi import FastAPI
7
+ from fastapi.responses import FileResponse
8
+ from fastapi.staticfiles import StaticFiles
9
+
10
+ from . import __version__
11
+ from .db import BibleomeDB
12
+ from .routers import lexicon, oia, passages, scripture, search, system
13
+ from .schema import ensure_schema
14
+ from .vectors import VectorIndex
15
+
16
+ WEB_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "web")
17
+
18
+
19
+ def create_app(db_url: str | None = None, vectors_dir: str | None = None) -> FastAPI:
20
+ app = FastAPI(
21
+ title="Bibleome API",
22
+ version=__version__,
23
+ description="Open-source multilingual computational Bible engine (SQLite + MySQL).",
24
+ )
25
+ db = BibleomeDB(db_url)
26
+ ensure_schema(db)
27
+ app.state.db = db
28
+ app.state.vectors = VectorIndex(vectors_dir)
29
+
30
+ app.include_router(system.router)
31
+ app.include_router(scripture.router)
32
+ app.include_router(lexicon.router)
33
+ app.include_router(passages.router)
34
+ app.include_router(search.router)
35
+ app.include_router(oia.router)
36
+
37
+ if os.path.isdir(WEB_DIR):
38
+ app.mount("/static", StaticFiles(directory=WEB_DIR), name="static")
39
+
40
+ @app.get("/", include_in_schema=False)
41
+ def serve_spa():
42
+ return FileResponse(os.path.join(WEB_DIR, "index.html"))
43
+
44
+ return app
45
+
46
+
47
+ app = create_app()
@@ -0,0 +1,128 @@
1
+ """Command-line interface for Bibleome (`bibleome init | serve | import-pack | build-vectors | validate-oia | doctor`)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import json
7
+ import os
8
+ import sys
9
+
10
+ from . import __version__
11
+ from .db import BibleomeDB, default_db_url
12
+ from .oia import validate_oia_payload
13
+ from .packs import import_translation_pack
14
+ from .schema import ensure_schema
15
+ from .seed_builder import init_seed_db
16
+ from .vectors import VectorIndex, build_vectors
17
+
18
+
19
+ def main(argv: list[str] | None = None) -> int:
20
+ ap = argparse.ArgumentParser(prog="bibleome", description="Bibleome open-source multilingual Bible engine CLI")
21
+ ap.add_argument("--version", action="version", version=f"bibleome {__version__}")
22
+ sub = ap.add_subparsers(dest="cmd")
23
+
24
+ p_init = sub.add_parser("init", help="Initialize database with bundled Public Domain / CC-BY seed data")
25
+ p_init.add_argument("--db", default=None, help="Database URL or SQLite file path")
26
+
27
+ p_serve = sub.add_parser("serve", help="Run Bibleome FastAPI + multilingual SPA web server")
28
+ p_serve.add_argument("--db", default=None, help="Database URL or SQLite file path")
29
+ p_serve.add_argument("--vectors", default=None, help="Optional directory containing verses.npy")
30
+ p_serve.add_argument("--host", default=os.environ.get("BIBLEOME_HOST", "127.0.0.1"))
31
+ p_serve.add_argument("--port", type=int, default=int(os.environ.get("BIBLEOME_PORT", "8080")))
32
+
33
+ p_imp = sub.add_parser("import-pack", help="Import a Translation Pack directory (manifest.json + USFM/OSIS/TSV/JSON)")
34
+ p_imp.add_argument("pack_dir", help="Path to Translation Pack directory")
35
+ p_imp.add_argument("--db", default=None, help="Database URL or SQLite file path")
36
+
37
+ p_vec = sub.add_parser("build-vectors", help="Build optional semantic search vectors (requires numpy)")
38
+ p_vec.add_argument("--db", default=None, help="Database URL or SQLite file path")
39
+ p_vec.add_argument("--out", required=True, help="Output directory for verses.npy")
40
+ p_vec.add_argument("--translation", default=None, help="Optional translation code filter")
41
+ p_vec.add_argument("--dim", type=int, default=256)
42
+
43
+ p_val = sub.add_parser("validate-oia", help="Validate an OIA JSON file against Bibleome OIA Schema v1")
44
+ p_val.add_argument("json_file", help="Path to OIA JSON file")
45
+
46
+ p_doc = sub.add_parser("doctor", help="Inspect database, loaded translations, and optional capabilities")
47
+ p_doc.add_argument("--db", default=None, help="Database URL or SQLite file path")
48
+ p_doc.add_argument("--vectors", default=None, help="Optional vectors directory")
49
+
50
+ args = ap.parse_args(argv)
51
+ if not args.cmd:
52
+ ap.print_help()
53
+ return 0
54
+
55
+ if args.cmd == "init":
56
+ db = BibleomeDB(args.db)
57
+ res = init_seed_db(db)
58
+ print(json.dumps(res, ensure_ascii=False, indent=2))
59
+ return 0
60
+
61
+ if args.cmd == "import-pack":
62
+ db = BibleomeDB(args.db)
63
+ ensure_schema(db)
64
+ res = import_translation_pack(db, args.pack_dir)
65
+ print(json.dumps(res, ensure_ascii=False, indent=2))
66
+ return 0
67
+
68
+ if args.cmd == "build-vectors":
69
+ db = BibleomeDB(args.db)
70
+ res = build_vectors(db, args.out, translation=args.translation, dim=args.dim)
71
+ print(json.dumps(res, ensure_ascii=False, indent=2))
72
+ return 0
73
+
74
+ if args.cmd == "validate-oia":
75
+ with open(args.json_file, encoding="utf-8") as f:
76
+ data = json.load(f)
77
+ ok, errs = validate_oia_payload(data)
78
+ print(json.dumps({"valid": ok, "errors": errs}, ensure_ascii=False, indent=2))
79
+ return 0 if ok else 1
80
+
81
+ if args.cmd == "doctor":
82
+ db = BibleomeDB(args.db or default_db_url())
83
+ ensure_schema(db)
84
+ vidx = VectorIndex(args.vectors)
85
+ trs = db.query_all("SELECT code, name, lang, direction, license FROM translations ORDER BY code")
86
+ v_cnt = db.query_one("SELECT COUNT(*) AS c FROM verses")
87
+ w_cnt = db.query_one("SELECT COUNT(*) AS c FROM words")
88
+ print(
89
+ json.dumps(
90
+ {
91
+ "version": __version__,
92
+ "backend": db.backend,
93
+ "db_url": db.db_url,
94
+ "verses": int(v_cnt["c"]) if v_cnt else 0,
95
+ "words": int(w_cnt["c"]) if w_cnt else 0,
96
+ "translations": trs,
97
+ "semantic_vectors": vidx.available,
98
+ },
99
+ ensure_ascii=False,
100
+ indent=2,
101
+ )
102
+ )
103
+ return 0
104
+
105
+ if args.cmd == "serve":
106
+ import uvicorn
107
+
108
+ if args.db:
109
+ os.environ["BIBLEOME_DB_URL"] = args.db
110
+ if args.vectors:
111
+ os.environ["BIBLEOME_VECTORS_DIR"] = args.vectors
112
+ db = BibleomeDB(args.db)
113
+ ensure_schema(db)
114
+ cnt = db.query_one("SELECT COUNT(*) AS c FROM verses")
115
+ if not cnt or int(cnt["c"]) == 0:
116
+ sys.stderr.write("[bibleome] Empty database detected — initializing bundled Public Domain seed...\n")
117
+ init_seed_db(db)
118
+ from .app import create_app
119
+
120
+ application = create_app(db_url=args.db, vectors_dir=args.vectors)
121
+ uvicorn.run(application, host=args.host, port=args.port)
122
+ return 0
123
+
124
+ return 2
125
+
126
+
127
+ if __name__ == "__main__":
128
+ raise SystemExit(main())