widetorah 0.1.0
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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +242 -0
- data/lib/widetorah/client.rb +229 -0
- data/lib/widetorah/version.rb +5 -0
- data/lib/widetorah.rb +4 -0
- metadata +54 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: bcec7f7da1b5efa67ca8bd428dca8af205f54aee194991efba1886134fd38bde
|
|
4
|
+
data.tar.gz: e11118fc079ae080c1dae0ceca6c9f8e22440220e85316d772fc838997453d4a
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: bcd145f1836f60b8e5596ec57db89305e6c0cfa705077511d4e46386d9c62853daf9b7f2e9460192637e0ed246c0dc4b0764ec3753e1bc9e47433a9d40f82b1c
|
|
7
|
+
data.tar.gz: 5fb1019cff8eff92d65629ec1899623731f6e800b6d68edc24488eaf4d352daa366648cb5e27d47198ce4d614fe3a2d73c78713a2ca498a10b7faabe727984af
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WideHoly
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# widetorah
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/widetorah)
|
|
4
|
+
[](https://www.ruby-lang.org/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://rubygems.org/gems/widetorah)
|
|
7
|
+
|
|
8
|
+
Ruby client for the [WideTorah](https://widetorah.com) API. Access 24 books of the Tanakh across 3 sections (Torah, Nevi'im, Ketuvim), 54 weekly parashot, 63 Talmud tractates with daf-level access, Mishnah chapters, Rashi commentary, Jewish holidays, biblical figures, topics, and a Hebrew/Aramaic glossary. Zero runtime dependencies -- uses only Ruby stdlib (`net/http`, `json`, `uri`).
|
|
9
|
+
|
|
10
|
+
WideTorah is a comprehensive Jewish scripture encyclopedia providing structured access to the Tanakh, Talmud Bavli, Mishnah, and rabbinic commentary -- all accessible through a free REST API.
|
|
11
|
+
|
|
12
|
+
> **Explore the Torah at [widetorah.com](https://widetorah.com)** -- [Books](https://widetorah.com/books/), [Parashot](https://widetorah.com/parashot/), [Talmud](https://widetorah.com/talmud/), [Figures](https://widetorah.com/figures/), [Holidays](https://widetorah.com/holidays/)
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Install](#install)
|
|
17
|
+
- [Quick Start](#quick-start)
|
|
18
|
+
- [What You Can Do](#what-you-can-do)
|
|
19
|
+
- [Browse Tanakh Books](#browse-tanakh-books)
|
|
20
|
+
- [Look Up Verses](#look-up-verses)
|
|
21
|
+
- [Search Scripture](#search-scripture)
|
|
22
|
+
- [Follow the Parashah Cycle](#follow-the-parashah-cycle)
|
|
23
|
+
- [Study Talmud](#study-talmud)
|
|
24
|
+
- [Read Rashi Commentary](#read-rashi-commentary)
|
|
25
|
+
- [Explore Jewish Holidays](#explore-jewish-holidays)
|
|
26
|
+
- [Discover Biblical Figures](#discover-biblical-figures)
|
|
27
|
+
- [API Reference](#api-reference)
|
|
28
|
+
- [Learn More About Jewish Scripture](#learn-more-about-jewish-scripture)
|
|
29
|
+
- [WideHoly Scripture Family](#wideholy-scripture-family)
|
|
30
|
+
- [Also Available](#also-available)
|
|
31
|
+
- [License](#license)
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
gem install widetorah
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or add to your Gemfile:
|
|
40
|
+
|
|
41
|
+
```ruby
|
|
42
|
+
gem "widetorah"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quick Start
|
|
46
|
+
|
|
47
|
+
```ruby
|
|
48
|
+
require "widetorah"
|
|
49
|
+
|
|
50
|
+
# Create a client (zero configuration needed)
|
|
51
|
+
client = WideTorah::Client.new
|
|
52
|
+
|
|
53
|
+
# List all 24 books of the Tanakh
|
|
54
|
+
books = client.list_books
|
|
55
|
+
puts books["results"].first["name"] # => "Genesis"
|
|
56
|
+
|
|
57
|
+
# Get Genesis 1:1 in JPS-1917 translation
|
|
58
|
+
verse = client.get_verse("genesis", 1, 1)
|
|
59
|
+
puts verse["results"].first["text"]
|
|
60
|
+
|
|
61
|
+
# Search Torah verses
|
|
62
|
+
results = client.search("covenant")
|
|
63
|
+
results["results"].each { |v| puts v["reference"] }
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## What You Can Do
|
|
67
|
+
|
|
68
|
+
### Browse Tanakh Books
|
|
69
|
+
|
|
70
|
+
The Tanakh contains 24 books organized into three sections: Torah (5 books of Moses), Nevi'im (8 books of Prophets), and Ketuvim (11 books of Writings). Each book includes Hebrew and English names, chapter count, and verse count.
|
|
71
|
+
|
|
72
|
+
```ruby
|
|
73
|
+
# List all Tanakh books
|
|
74
|
+
books = client.list_books
|
|
75
|
+
|
|
76
|
+
# Filter by section
|
|
77
|
+
torah = client.list_books(section: "torah")
|
|
78
|
+
neviim = client.list_books(section: "neviim")
|
|
79
|
+
|
|
80
|
+
# Get details for a specific book
|
|
81
|
+
genesis = client.get_book("genesis")
|
|
82
|
+
puts genesis["hebrew_name"] # => "Bereshit"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Look Up Verses
|
|
86
|
+
|
|
87
|
+
Access every verse in the Tanakh with Hebrew text and English translations. The JPS-1917 (Jewish Publication Society) translation is the default.
|
|
88
|
+
|
|
89
|
+
```ruby
|
|
90
|
+
# Get a specific verse
|
|
91
|
+
verse = client.get_verse("genesis", 1, 1)
|
|
92
|
+
|
|
93
|
+
# Use a different translation
|
|
94
|
+
verse = client.get_verse("psalms", 23, 1, translation: "koren")
|
|
95
|
+
|
|
96
|
+
# List chapters in a book
|
|
97
|
+
chapters = client.list_chapters(book: "exodus")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Search Scripture
|
|
101
|
+
|
|
102
|
+
Full-text search across all Tanakh verses with relevance ranking.
|
|
103
|
+
|
|
104
|
+
```ruby
|
|
105
|
+
# Search for a keyword
|
|
106
|
+
results = client.search("blessing", limit: 10)
|
|
107
|
+
results["results"].each do |verse|
|
|
108
|
+
puts "#{verse["reference"]}: #{verse["text"]}"
|
|
109
|
+
end
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Follow the Parashah Cycle
|
|
113
|
+
|
|
114
|
+
The Torah is divided into 54 weekly portions (parashot) read in synagogues throughout the year. Each parashah includes start and end verse references, associated haftarah readings, and thematic summaries.
|
|
115
|
+
|
|
116
|
+
```ruby
|
|
117
|
+
# List all 54 parashot
|
|
118
|
+
parashot = client.list_parashot
|
|
119
|
+
|
|
120
|
+
# Filter by book
|
|
121
|
+
genesis_portions = client.list_parashot(book: "genesis")
|
|
122
|
+
|
|
123
|
+
# Get Bereshit (first parashah)
|
|
124
|
+
bereshit = client.get_parashah("bereshit")
|
|
125
|
+
puts bereshit["hebrew_name"]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Study Talmud
|
|
129
|
+
|
|
130
|
+
The Talmud Bavli (Babylonian Talmud) consists of 63 tractates organized into 6 sedarim (orders). Access individual daf (folio) pages with Hebrew, English, and Aramaic text.
|
|
131
|
+
|
|
132
|
+
| Seder | Meaning | Tractates |
|
|
133
|
+
|-------|---------|-----------|
|
|
134
|
+
| Zeraim | Seeds | Berakhot and agricultural laws |
|
|
135
|
+
| Moed | Festivals | Shabbat, Pesachim, Yoma |
|
|
136
|
+
| Nashim | Women | Ketubot, Gittin, Kiddushin |
|
|
137
|
+
| Nezikin | Damages | Bava Kamma, Sanhedrin |
|
|
138
|
+
| Kodashim | Holy Things | Zevachim, Menachot |
|
|
139
|
+
| Tohorot | Purities | Niddah |
|
|
140
|
+
|
|
141
|
+
```ruby
|
|
142
|
+
# List tractates
|
|
143
|
+
tractates = client.list_tractates
|
|
144
|
+
|
|
145
|
+
# Filter by seder
|
|
146
|
+
moed = client.list_tractates(seder: "moed")
|
|
147
|
+
|
|
148
|
+
# Get a specific Talmud page (daf)
|
|
149
|
+
daf = client.get_talmud_daf("berakhot", 2, side: "a")
|
|
150
|
+
|
|
151
|
+
# Access Mishnah chapters
|
|
152
|
+
mishnah = client.list_mishnah(tractate: "berakhot")
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Read Rashi Commentary
|
|
156
|
+
|
|
157
|
+
Rashi (Rabbi Shlomo Yitzchaki, 1040-1105) wrote the most widely studied commentary on the Torah. His concise explanations clarify the plain meaning (peshat) of the text.
|
|
158
|
+
|
|
159
|
+
```ruby
|
|
160
|
+
# List Rashi commentaries on Genesis
|
|
161
|
+
rashi = client.list_rashi(book: "genesis")
|
|
162
|
+
|
|
163
|
+
# Filter by chapter
|
|
164
|
+
rashi_ch1 = client.list_rashi(book: "genesis", chapter: 1)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Explore Jewish Holidays
|
|
168
|
+
|
|
169
|
+
Jewish holidays span three categories: biblical (Torah-mandated), rabbinic (Talmud-instituted), and modern (state of Israel).
|
|
170
|
+
|
|
171
|
+
```ruby
|
|
172
|
+
# List all holidays
|
|
173
|
+
holidays = client.list_holidays
|
|
174
|
+
|
|
175
|
+
# Filter by category
|
|
176
|
+
biblical = client.list_holidays(category: "biblical")
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Discover Biblical Figures
|
|
180
|
+
|
|
181
|
+
Profiles of patriarchs, matriarchs, prophets, kings, and other key figures in Jewish scripture.
|
|
182
|
+
|
|
183
|
+
```ruby
|
|
184
|
+
# List figures by era
|
|
185
|
+
patriarchs = client.list_figures(era: "patriarchs")
|
|
186
|
+
|
|
187
|
+
# Get details for Abraham
|
|
188
|
+
abraham = client.get_figure("abraham")
|
|
189
|
+
puts abraham["hebrew_name"]
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## API Reference
|
|
193
|
+
|
|
194
|
+
| Method | Description |
|
|
195
|
+
|--------|-------------|
|
|
196
|
+
| `list_books(section:)` | List Tanakh books, filter by section |
|
|
197
|
+
| `get_book(slug)` | Get book details |
|
|
198
|
+
| `list_translations` | List available translations |
|
|
199
|
+
| `list_chapters(book:)` | List chapters |
|
|
200
|
+
| `get_verse(book, chapter, verse, translation:)` | Get a specific verse |
|
|
201
|
+
| `search(query, limit:)` | Search verses |
|
|
202
|
+
| `list_parashot(book:)` | List 54 weekly portions |
|
|
203
|
+
| `get_parashah(slug)` | Get parashah details |
|
|
204
|
+
| `list_tractates(seder:)` | List Talmud tractates |
|
|
205
|
+
| `get_talmud_daf(tractate, daf, side:)` | Get a Talmud daf page |
|
|
206
|
+
| `list_mishnah(tractate:)` | List Mishnah chapters |
|
|
207
|
+
| `list_rashi(book:, chapter:)` | List Rashi commentaries |
|
|
208
|
+
| `list_holidays(category:)` | List Jewish holidays |
|
|
209
|
+
| `list_figures(era:)` | List biblical figures |
|
|
210
|
+
| `get_figure(slug)` | Get figure details |
|
|
211
|
+
| `list_topics` | List thematic topics |
|
|
212
|
+
| `list_glossary` | List glossary terms |
|
|
213
|
+
|
|
214
|
+
## Learn More About Jewish Scripture
|
|
215
|
+
|
|
216
|
+
- **Browse**: [Books](https://widetorah.com/books/) -- [Parashot](https://widetorah.com/parashot/) -- [Talmud](https://widetorah.com/talmud/)
|
|
217
|
+
- **Study**: [Figures](https://widetorah.com/figures/) -- [Holidays](https://widetorah.com/holidays/) -- [Glossary](https://widetorah.com/glossary/)
|
|
218
|
+
- **API**: [REST API Docs](https://widetorah.com/developers/) -- [OpenAPI Spec](https://widetorah.com/api/openapi.json)
|
|
219
|
+
|
|
220
|
+
## WideHoly Scripture Family
|
|
221
|
+
|
|
222
|
+
Part of the [WideHoly](https://wideholy.com) multi-religion scripture platform.
|
|
223
|
+
|
|
224
|
+
| Site | Domain | Focus |
|
|
225
|
+
|------|--------|-------|
|
|
226
|
+
| WideBible | [widebible.com](https://widebible.com) | 66 books, 31,102 verses, KJV/ASV/BBE/YLT, cross-references |
|
|
227
|
+
| WideQuran | [widequran.com](https://widequran.com) | 114 surahs, 6,236 ayahs, hadith collections, tafsir |
|
|
228
|
+
| **WideTorah** | [widetorah.com](https://widetorah.com) | **Tanakh, Talmud tractates, parashot, Rashi commentary** |
|
|
229
|
+
| WideGita | [widegita.com](https://widegita.com) | 18 chapters, 700 verses, Upanishads, Yoga Sutras |
|
|
230
|
+
| WideSutra | [widesutra.com](https://widesutra.com) | Tipitaka, Pali Canon, Mahayana sutras, Buddhist figures |
|
|
231
|
+
| WideHoly | [wideholy.com](https://wideholy.com) | Cross-religion search, verse comparison, shared topics |
|
|
232
|
+
|
|
233
|
+
## Also Available
|
|
234
|
+
|
|
235
|
+
| Platform | Install | Link |
|
|
236
|
+
|----------|---------|------|
|
|
237
|
+
| **PyPI** | `pip install widetorah` | [PyPI](https://pypi.org/project/widetorah/) |
|
|
238
|
+
| **npm** | `npm install widetorah` | [npm](https://www.npmjs.com/package/widetorah) |
|
|
239
|
+
|
|
240
|
+
## License
|
|
241
|
+
|
|
242
|
+
MIT
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "json"
|
|
5
|
+
require "uri"
|
|
6
|
+
|
|
7
|
+
module WideTorah
|
|
8
|
+
# HTTP client for the WideTorah REST API.
|
|
9
|
+
#
|
|
10
|
+
# Zero runtime dependencies -- uses only Ruby stdlib (net/http, json, uri).
|
|
11
|
+
#
|
|
12
|
+
# client = WideTorah::Client.new
|
|
13
|
+
# books = client.list_books
|
|
14
|
+
# verse = client.get_verse("genesis", 1, 1)
|
|
15
|
+
# results = client.search("covenant")
|
|
16
|
+
#
|
|
17
|
+
class Client
|
|
18
|
+
DEFAULT_BASE_URL = "https://widetorah.com/api/v1/torah"
|
|
19
|
+
DEFAULT_TIMEOUT = 10
|
|
20
|
+
|
|
21
|
+
def initialize(base_url: DEFAULT_BASE_URL, timeout: DEFAULT_TIMEOUT)
|
|
22
|
+
@base_url = base_url.chomp("/")
|
|
23
|
+
@timeout = timeout
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# --- Books ----------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
# List all 24 books of the Tanakh.
|
|
29
|
+
#
|
|
30
|
+
# @param section [String, nil] filter by "torah", "neviim", or "ketuvim"
|
|
31
|
+
# @return [Hash] paginated list of books
|
|
32
|
+
def list_books(section: nil, **params)
|
|
33
|
+
get("/books/", { section: section }.merge(params))
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Get book details by slug (e.g. "genesis", "psalms").
|
|
37
|
+
#
|
|
38
|
+
# @param slug [String] book URL slug
|
|
39
|
+
# @return [Hash] book details with name, hebrew_name, section, chapter_count
|
|
40
|
+
def get_book(slug)
|
|
41
|
+
get("/books/#{slug}/")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# --- Translations ---------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
# List available Torah translations (JPS-1917, Koren, Masoretic Hebrew).
|
|
47
|
+
#
|
|
48
|
+
# @return [Hash] paginated list of translations
|
|
49
|
+
def list_translations(**params)
|
|
50
|
+
get("/translations/", params)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# --- Chapters -------------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
# List chapters, optionally filtered by book slug.
|
|
56
|
+
#
|
|
57
|
+
# @param book [String, nil] book slug to filter by
|
|
58
|
+
# @return [Hash] paginated list of chapters
|
|
59
|
+
def list_chapters(book: nil, **params)
|
|
60
|
+
get("/chapters/", { book__slug: book }.merge(params))
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# --- Verses ---------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
# Get a specific Torah verse by book, chapter, and verse number.
|
|
66
|
+
#
|
|
67
|
+
# @param book [String] book slug (e.g. "genesis", "exodus")
|
|
68
|
+
# @param chapter [Integer] chapter number
|
|
69
|
+
# @param verse [Integer] verse number
|
|
70
|
+
# @param translation [String] translation code (default: "jps-1917")
|
|
71
|
+
# @return [Hash] verse data with text, text_hebrew, reference
|
|
72
|
+
def get_verse(book, chapter, verse, translation: "jps-1917")
|
|
73
|
+
get("/verses/", {
|
|
74
|
+
chapter__book__slug: book,
|
|
75
|
+
chapter__number: chapter,
|
|
76
|
+
number: verse,
|
|
77
|
+
translation__code: translation
|
|
78
|
+
})
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Search Torah verses by keyword.
|
|
82
|
+
#
|
|
83
|
+
# @param query [String] search query string
|
|
84
|
+
# @param limit [Integer] maximum number of results (default: 25)
|
|
85
|
+
# @return [Hash] paginated search results
|
|
86
|
+
def search(query, limit: 25)
|
|
87
|
+
get("/verses/", { search: query, page_size: limit })
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# --- Parashot -------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
# List the 54 weekly Torah portions (parashot).
|
|
93
|
+
#
|
|
94
|
+
# @param book [String, nil] filter by book slug
|
|
95
|
+
# @return [Hash] paginated list of parashot
|
|
96
|
+
def list_parashot(book: nil, **params)
|
|
97
|
+
get("/parashot/", { book__slug: book }.merge(params))
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Get parashah details by slug (e.g. "bereshit", "noach").
|
|
101
|
+
#
|
|
102
|
+
# @param slug [String] parashah slug
|
|
103
|
+
# @return [Hash] parashah details with name, hebrew_name, start/end references
|
|
104
|
+
def get_parashah(slug)
|
|
105
|
+
get("/parashot/#{slug}/")
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# --- Talmud Tractates -----------------------------------------------------
|
|
109
|
+
|
|
110
|
+
# List Talmud tractates (63 volumes across 6 sedarim).
|
|
111
|
+
#
|
|
112
|
+
# @param seder [String, nil] filter by seder name (e.g. "zeraim", "moed")
|
|
113
|
+
# @return [Hash] paginated list of tractates
|
|
114
|
+
def list_tractates(seder: nil, **params)
|
|
115
|
+
get("/tractates/", { seder: seder }.merge(params))
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# --- Talmud Daf -----------------------------------------------------------
|
|
119
|
+
|
|
120
|
+
# Get a Talmud folio page (daf) by tractate, number, and side.
|
|
121
|
+
#
|
|
122
|
+
# @param tractate [String] tractate slug (e.g. "berakhot", "shabbat")
|
|
123
|
+
# @param daf [Integer] daf (folio) number
|
|
124
|
+
# @param side [String] page side -- "a" (recto) or "b" (verso)
|
|
125
|
+
# @return [Hash] daf with text_hebrew, text_english, text_aramaic
|
|
126
|
+
def get_talmud_daf(tractate, daf, side: "a")
|
|
127
|
+
get("/dapim/", {
|
|
128
|
+
tractate__slug: tractate,
|
|
129
|
+
number: daf,
|
|
130
|
+
side: side
|
|
131
|
+
})
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# --- Mishnah --------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
# List Mishnah chapters, optionally filtered by tractate.
|
|
137
|
+
#
|
|
138
|
+
# @param tractate [String, nil] tractate slug to filter by
|
|
139
|
+
# @return [Hash] paginated list of Mishnah chapters
|
|
140
|
+
def list_mishnah(tractate: nil, **params)
|
|
141
|
+
get("/mishnah/", { tractate__slug: tractate }.merge(params))
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# --- Rashi Commentary -----------------------------------------------------
|
|
145
|
+
|
|
146
|
+
# List Rashi commentaries on Torah verses.
|
|
147
|
+
#
|
|
148
|
+
# @param book [String, nil] filter by book slug
|
|
149
|
+
# @param chapter [Integer, nil] filter by chapter number
|
|
150
|
+
# @return [Hash] paginated list of Rashi commentaries
|
|
151
|
+
def list_rashi(book: nil, chapter: nil, **params)
|
|
152
|
+
get("/rashi/", { book__slug: book, chapter: chapter }.merge(params))
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# --- Jewish Holidays ------------------------------------------------------
|
|
156
|
+
|
|
157
|
+
# List Jewish holidays (biblical, rabbinic, modern).
|
|
158
|
+
#
|
|
159
|
+
# @param category [String, nil] filter by category
|
|
160
|
+
# @return [Hash] paginated list of holidays
|
|
161
|
+
def list_holidays(category: nil, **params)
|
|
162
|
+
get("/holidays/", { category: category }.merge(params))
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# --- Biblical Figures -----------------------------------------------------
|
|
166
|
+
|
|
167
|
+
# List biblical figures (patriarchs, prophets, kings, etc.).
|
|
168
|
+
#
|
|
169
|
+
# @param era [String, nil] filter by era (e.g. "patriarchs", "judges")
|
|
170
|
+
# @return [Hash] paginated list of figures
|
|
171
|
+
def list_figures(era: nil, **params)
|
|
172
|
+
get("/figures/", { era: era }.merge(params))
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Get a biblical figure's details by slug.
|
|
176
|
+
#
|
|
177
|
+
# @param slug [String] figure slug
|
|
178
|
+
# @return [Hash] figure details with name, hebrew_name, era, is_prophet
|
|
179
|
+
def get_figure(slug)
|
|
180
|
+
get("/figures/#{slug}/")
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# --- Topics ---------------------------------------------------------------
|
|
184
|
+
|
|
185
|
+
# List thematic topics (covenant, creation, law, etc.).
|
|
186
|
+
#
|
|
187
|
+
# @return [Hash] paginated list of topics
|
|
188
|
+
def list_topics(**params)
|
|
189
|
+
get("/topics/", params)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# --- Glossary -------------------------------------------------------------
|
|
193
|
+
|
|
194
|
+
# List Hebrew/Aramaic glossary terms with definitions.
|
|
195
|
+
#
|
|
196
|
+
# @return [Hash] paginated list of glossary terms
|
|
197
|
+
def list_glossary(**params)
|
|
198
|
+
get("/glossary/", params)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
private
|
|
202
|
+
|
|
203
|
+
def get(path, params = {})
|
|
204
|
+
uri = URI("#{@base_url}#{path}")
|
|
205
|
+
cleaned = params.each_with_object({}) { |(k, v), h| h[k] = v unless v.nil? }
|
|
206
|
+
uri.query = URI.encode_www_form(cleaned) unless cleaned.empty?
|
|
207
|
+
|
|
208
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
209
|
+
http.use_ssl = uri.scheme == "https"
|
|
210
|
+
http.open_timeout = @timeout
|
|
211
|
+
http.read_timeout = @timeout
|
|
212
|
+
|
|
213
|
+
request = Net::HTTP::Get.new(uri)
|
|
214
|
+
request["Accept"] = "application/json"
|
|
215
|
+
request["User-Agent"] = "widetorah-rb/#{VERSION}"
|
|
216
|
+
|
|
217
|
+
response = http.request(request)
|
|
218
|
+
|
|
219
|
+
case response
|
|
220
|
+
when Net::HTTPSuccess
|
|
221
|
+
JSON.parse(response.body)
|
|
222
|
+
when Net::HTTPNotFound
|
|
223
|
+
raise "Not found: #{path}"
|
|
224
|
+
else
|
|
225
|
+
raise "HTTP #{response.code}: #{response.body}"
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
data/lib/widetorah.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: widetorah
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- dobestan
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-03-24 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: API client for widetorah.com. Access 24 books of the Tanakh, 54 parashot,
|
|
14
|
+
63 Talmud tractates with daf pages, Mishnah, Rashi commentary, Jewish holidays,
|
|
15
|
+
biblical figures, topics, and Hebrew/Aramaic glossary. Zero dependencies.
|
|
16
|
+
email:
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- LICENSE
|
|
22
|
+
- README.md
|
|
23
|
+
- lib/widetorah.rb
|
|
24
|
+
- lib/widetorah/client.rb
|
|
25
|
+
- lib/widetorah/version.rb
|
|
26
|
+
homepage: https://widetorah.com
|
|
27
|
+
licenses:
|
|
28
|
+
- MIT
|
|
29
|
+
metadata:
|
|
30
|
+
homepage_uri: https://widetorah.com
|
|
31
|
+
source_code_uri: https://github.com/dobestan/widetorah-rb
|
|
32
|
+
changelog_uri: https://github.com/dobestan/widetorah-rb/blob/main/CHANGELOG.md
|
|
33
|
+
documentation_uri: https://widetorah.com/developers/
|
|
34
|
+
bug_tracker_uri: https://github.com/dobestan/widetorah-rb/issues
|
|
35
|
+
post_install_message:
|
|
36
|
+
rdoc_options: []
|
|
37
|
+
require_paths:
|
|
38
|
+
- lib
|
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '3.0'
|
|
44
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
|
+
requirements:
|
|
46
|
+
- - ">="
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: '0'
|
|
49
|
+
requirements: []
|
|
50
|
+
rubygems_version: 3.0.3.1
|
|
51
|
+
signing_key:
|
|
52
|
+
specification_version: 4
|
|
53
|
+
summary: Ruby SDK for WideTorah — Tanakh, Talmud, parashot, Rashi commentary
|
|
54
|
+
test_files: []
|