youversion-bible-client 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 (26) hide show
  1. youversion_bible_client-0.1.0/LICENSE +21 -0
  2. youversion_bible_client-0.1.0/PKG-INFO +188 -0
  3. youversion_bible_client-0.1.0/README.md +160 -0
  4. youversion_bible_client-0.1.0/pyproject.toml +182 -0
  5. youversion_bible_client-0.1.0/youversion/__init__.py +34 -0
  6. youversion_bible_client-0.1.0/youversion/cli.py +2574 -0
  7. youversion_bible_client-0.1.0/youversion/clients/__init__.py +6 -0
  8. youversion_bible_client-0.1.0/youversion/clients/async_client.py +27 -0
  9. youversion_bible_client-0.1.0/youversion/clients/sync_client.py +821 -0
  10. youversion_bible_client-0.1.0/youversion/config.py +150 -0
  11. youversion_bible_client-0.1.0/youversion/core/__init__.py +18 -0
  12. youversion_bible_client-0.1.0/youversion/core/authenticator.py +109 -0
  13. youversion_bible_client-0.1.0/youversion/core/base_client.py +908 -0
  14. youversion_bible_client-0.1.0/youversion/core/data_processor.py +724 -0
  15. youversion_bible_client-0.1.0/youversion/core/http_client.py +787 -0
  16. youversion_bible_client-0.1.0/youversion/core/interfaces.py +259 -0
  17. youversion_bible_client-0.1.0/youversion/enums.py +21 -0
  18. youversion_bible_client-0.1.0/youversion/models/__init__.py +126 -0
  19. youversion_bible_client-0.1.0/youversion/models/base.py +90 -0
  20. youversion_bible_client-0.1.0/youversion/models/bible.py +165 -0
  21. youversion_bible_client-0.1.0/youversion/models/common.py +164 -0
  22. youversion_bible_client-0.1.0/youversion/models/commons.py +117 -0
  23. youversion_bible_client-0.1.0/youversion/models/events.py +171 -0
  24. youversion_bible_client-0.1.0/youversion/models/friends.py +145 -0
  25. youversion_bible_client-0.1.0/youversion/models/moments.py +81 -0
  26. youversion_bible_client-0.1.0/youversion/utils.py +361 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Taiwo Kareem
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.
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.4
2
+ Name: youversion-bible-client
3
+ Version: 0.1.0
4
+ Summary: A Command line interface for interacting with the YouVersion Bible API
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Keywords: YouVersion Bible,Bible,Youversion,Lifechurch
8
+ Author: Taiwo Kareem
9
+ Author-email: taiwo.kareem36@gmail.com
10
+ Maintainer: Taiwo Kareem
11
+ Maintainer-email: taiwo.kareem36@gmail.com
12
+ Requires-Python: >=3.9
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Requires-Dist: httpx (>=0.25.0)
21
+ Requires-Dist: pydantic (>=2.5.0)
22
+ Requires-Dist: pyjwt (>=2.10.1)
23
+ Requires-Dist: python-dotenv (>=0.19.0)
24
+ Requires-Dist: typing-extensions (>=4.0.0)
25
+ Project-URL: Homepage, https://github.com/tushortz/youversion-bible-client
26
+ Project-URL: Repository, https://github.com/tushortz/youversion-bible-client
27
+ Description-Content-Type: text/markdown
28
+
29
+ # YouVersion Bible API Client
30
+
31
+ This project came about when I was looking to export all my notes from the Youversion Bible app. Please use responsibly.
32
+
33
+
34
+ A comprehensive Python client library for accessing the YouVersion Bible API. This library provides both synchronous and asynchronous interfaces to interact with all YouVersion API endpoints.
35
+
36
+
37
+ ## Installation
38
+
39
+ ```bash
40
+ pip install youversion-bible-client
41
+ ```
42
+
43
+ ## Features
44
+
45
+ - [x] verse of the day
46
+ - [x] moments / feeds
47
+ - [x] notes
48
+ - [x] verse highlights
49
+ - [x] bookmarks
50
+ - [x] plan subscriptions
51
+ - [x] plan progress
52
+ - [x] plan completions
53
+ - [x] verse search
54
+
55
+
56
+ ## Quick start
57
+
58
+ ### Client
59
+
60
+ ## Examples
61
+
62
+ ### Create sync client
63
+
64
+ The sync client is a wrapper on top of the asynchronous client. See [DOCS.md](./DOCS.md) on examples on how to use
65
+
66
+ ```py
67
+ from youversion.clients import SyncClient
68
+
69
+ client = SyncClient()
70
+
71
+ # get verse of the day
72
+ client.verse_of_the_day()
73
+ ```
74
+
75
+ ### creating async client
76
+
77
+ ```py
78
+ import asyncio
79
+ from youversion.clients import AsyncClient
80
+
81
+ async def main():
82
+ # Using async context manager (recommended)
83
+ async with AsyncClient() as client:
84
+ # Get verse of the day
85
+ votd = await client.verse_of_the_day()
86
+ ```
87
+
88
+
89
+ ### Verse of the day
90
+
91
+ ```py
92
+ # get's the current day's votd
93
+ result = client.verse_of_the_day()
94
+
95
+ # get's specified votd
96
+ client.verse_of_the_day(day=365)
97
+ ```
98
+
99
+ ### Moments
100
+
101
+ #### Get moments
102
+
103
+ Moments fall into different categories such as `bookmark`, `highlight`, `note`, `image`, `badge`, `plan_subscription`, `plan_completion`, `plan_segment_completion`, `friendship`
104
+
105
+ Moments take optional page parameters. default is page 1
106
+
107
+ ```py
108
+ client.badges()
109
+ client.bookmarks()
110
+ client.friendships()
111
+ client.highlights()
112
+ client.moments()
113
+ client.my_images()
114
+ client.notes()
115
+ client.plan_completions()
116
+ client.plan_progress()
117
+ client.plan_subscriptions()
118
+ ```
119
+
120
+ #### Create a moment
121
+
122
+ ```py
123
+ # Some fields are optional or provide default values.
124
+ # infer those from the method type hints
125
+ # version_id for example kjv = 1
126
+ client.create_moment(
127
+ {
128
+ "kind": "note",
129
+ "content": "My genesis 10:2 note body",
130
+ "references": [
131
+ {"human": "genesis 10:2", "version_id": 1, "usfm": ["GEN.10.2"]}
132
+ ],
133
+ "title": "My genesis 10:2 note",
134
+ "status": "private",
135
+ "body": "My genesis 10:2 note body",
136
+ "color": "ff0000",
137
+ "labels": ["test"],
138
+ "language_tag": "en",
139
+ }
140
+ )
141
+ ```
142
+
143
+ ### Bible
144
+
145
+ #### Verse search
146
+
147
+ ```py
148
+ client.search_bible("christ died for us")
149
+ ```
150
+
151
+ #### Get bible chapter
152
+
153
+ ```py
154
+ client.get_bible_chapter(reference="GEN.1")
155
+ ```
156
+
157
+ ### Bible versions
158
+
159
+ ```py
160
+ client.get_bible_versions()
161
+
162
+ # you can specify a 3 digit language tag. e.g. ita for italian
163
+ # default is eng (english)
164
+ client.get_bible_versions(language_tag="eng")
165
+
166
+ # You can also get a single bible version detail
167
+ client.get_bible_version(version_id=1)
168
+ ```
169
+
170
+ ### Bible Audio
171
+
172
+ ```py
173
+ # version id defaults to 1 (kjv)
174
+ client.get_audio_chapter(reference="GEN.1")
175
+ client.get_audio_chapter(reference="GEN.1", version_id=1)
176
+
177
+ # Get audio version details
178
+ client.get_audio_version(audio_id=1)
179
+ ```
180
+
181
+
182
+ ### Friends
183
+
184
+ #### Send friend request
185
+
186
+ ```py
187
+ client.send_friend_request(user_id=123456789)
188
+ ```
@@ -0,0 +1,160 @@
1
+ # YouVersion Bible API Client
2
+
3
+ This project came about when I was looking to export all my notes from the Youversion Bible app. Please use responsibly.
4
+
5
+
6
+ A comprehensive Python client library for accessing the YouVersion Bible API. This library provides both synchronous and asynchronous interfaces to interact with all YouVersion API endpoints.
7
+
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pip install youversion-bible-client
13
+ ```
14
+
15
+ ## Features
16
+
17
+ - [x] verse of the day
18
+ - [x] moments / feeds
19
+ - [x] notes
20
+ - [x] verse highlights
21
+ - [x] bookmarks
22
+ - [x] plan subscriptions
23
+ - [x] plan progress
24
+ - [x] plan completions
25
+ - [x] verse search
26
+
27
+
28
+ ## Quick start
29
+
30
+ ### Client
31
+
32
+ ## Examples
33
+
34
+ ### Create sync client
35
+
36
+ The sync client is a wrapper on top of the asynchronous client. See [DOCS.md](./DOCS.md) on examples on how to use
37
+
38
+ ```py
39
+ from youversion.clients import SyncClient
40
+
41
+ client = SyncClient()
42
+
43
+ # get verse of the day
44
+ client.verse_of_the_day()
45
+ ```
46
+
47
+ ### creating async client
48
+
49
+ ```py
50
+ import asyncio
51
+ from youversion.clients import AsyncClient
52
+
53
+ async def main():
54
+ # Using async context manager (recommended)
55
+ async with AsyncClient() as client:
56
+ # Get verse of the day
57
+ votd = await client.verse_of_the_day()
58
+ ```
59
+
60
+
61
+ ### Verse of the day
62
+
63
+ ```py
64
+ # get's the current day's votd
65
+ result = client.verse_of_the_day()
66
+
67
+ # get's specified votd
68
+ client.verse_of_the_day(day=365)
69
+ ```
70
+
71
+ ### Moments
72
+
73
+ #### Get moments
74
+
75
+ Moments fall into different categories such as `bookmark`, `highlight`, `note`, `image`, `badge`, `plan_subscription`, `plan_completion`, `plan_segment_completion`, `friendship`
76
+
77
+ Moments take optional page parameters. default is page 1
78
+
79
+ ```py
80
+ client.badges()
81
+ client.bookmarks()
82
+ client.friendships()
83
+ client.highlights()
84
+ client.moments()
85
+ client.my_images()
86
+ client.notes()
87
+ client.plan_completions()
88
+ client.plan_progress()
89
+ client.plan_subscriptions()
90
+ ```
91
+
92
+ #### Create a moment
93
+
94
+ ```py
95
+ # Some fields are optional or provide default values.
96
+ # infer those from the method type hints
97
+ # version_id for example kjv = 1
98
+ client.create_moment(
99
+ {
100
+ "kind": "note",
101
+ "content": "My genesis 10:2 note body",
102
+ "references": [
103
+ {"human": "genesis 10:2", "version_id": 1, "usfm": ["GEN.10.2"]}
104
+ ],
105
+ "title": "My genesis 10:2 note",
106
+ "status": "private",
107
+ "body": "My genesis 10:2 note body",
108
+ "color": "ff0000",
109
+ "labels": ["test"],
110
+ "language_tag": "en",
111
+ }
112
+ )
113
+ ```
114
+
115
+ ### Bible
116
+
117
+ #### Verse search
118
+
119
+ ```py
120
+ client.search_bible("christ died for us")
121
+ ```
122
+
123
+ #### Get bible chapter
124
+
125
+ ```py
126
+ client.get_bible_chapter(reference="GEN.1")
127
+ ```
128
+
129
+ ### Bible versions
130
+
131
+ ```py
132
+ client.get_bible_versions()
133
+
134
+ # you can specify a 3 digit language tag. e.g. ita for italian
135
+ # default is eng (english)
136
+ client.get_bible_versions(language_tag="eng")
137
+
138
+ # You can also get a single bible version detail
139
+ client.get_bible_version(version_id=1)
140
+ ```
141
+
142
+ ### Bible Audio
143
+
144
+ ```py
145
+ # version id defaults to 1 (kjv)
146
+ client.get_audio_chapter(reference="GEN.1")
147
+ client.get_audio_chapter(reference="GEN.1", version_id=1)
148
+
149
+ # Get audio version details
150
+ client.get_audio_version(audio_id=1)
151
+ ```
152
+
153
+
154
+ ### Friends
155
+
156
+ #### Send friend request
157
+
158
+ ```py
159
+ client.send_friend_request(user_id=123456789)
160
+ ```
@@ -0,0 +1,182 @@
1
+ [project]
2
+ name = "youversion-bible-client"
3
+ version = "0.1.0"
4
+ description = "A Command line interface for interacting with the YouVersion Bible API"
5
+ authors = [
6
+ {name = "Taiwo Kareem", email = "taiwo.kareem36@gmail.com"}
7
+ ]
8
+ maintainers = [
9
+ {name = "Taiwo Kareem", email = "taiwo.kareem36@gmail.com"}
10
+ ]
11
+ license = "MIT"
12
+ readme = "README.md"
13
+ keywords = ["YouVersion Bible", "Bible", "Youversion", "Lifechurch"]
14
+ requires-python = ">=3.9"
15
+ dependencies = [
16
+ "httpx>=0.25.0",
17
+ "python-dotenv>=0.19.0",
18
+ "pydantic>=2.5.0",
19
+ "pyjwt>=2.10.1",
20
+ "typing-extensions>=4.0.0",
21
+ ]
22
+
23
+ [project.urls]
24
+ Homepage = "https://github.com/tushortz/youversion-bible-client"
25
+ Repository = "https://github.com/tushortz/youversion-bible-client"
26
+
27
+ [project.scripts]
28
+ youversion = "youversion.cli:main"
29
+ add-theme = "youversion.cli:poetry_cmd_add_theme"
30
+ badges = "youversion.cli:poetry_cmd_badges"
31
+ bookmarks = "youversion.cli:poetry_cmd_bookmarks"
32
+ convert-notes = "youversion.cli:poetry_cmd_convert_notes"
33
+ create-comment = "youversion.cli:poetry_cmd_create_comment"
34
+ create-moment = "youversion.cli:poetry_cmd_create_moment"
35
+ delete-comment = "youversion.cli:poetry_cmd_delete_comment"
36
+ delete-moment = "youversion.cli:poetry_cmd_delete_moment"
37
+ delete-saved-event = "youversion.cli:poetry_cmd_delete_saved_event"
38
+ get-all-saved-event-ids = "youversion.cli:poetry_cmd_get_all_saved_event_ids"
39
+ get-audio-chapter = "youversion.cli:poetry_cmd_get_audio_chapter"
40
+ get-audio-version = "youversion.cli:poetry_cmd_get_audio_version"
41
+ get-bible-chapter = "youversion.cli:poetry_cmd_get_bible_chapter"
42
+ get-bible-configuration = "youversion.cli:poetry_cmd_get_bible_configuration"
43
+ get-bible-version = "youversion.cli:poetry_cmd_get_bible_version"
44
+ get-bible-versions = "youversion.cli:poetry_cmd_get_bible_versions"
45
+ get-event-configuration = "youversion.cli:poetry_cmd_get_event_configuration"
46
+ get-event-details = "youversion.cli:poetry_cmd_get_event_details"
47
+ get-image-upload-url = "youversion.cli:poetry_cmd_get_image_upload_url"
48
+ get-images = "youversion.cli:poetry_cmd_get_images"
49
+ get-localization-items = "youversion.cli:poetry_cmd_get_localization_items"
50
+ get-moment-colors = "youversion.cli:poetry_cmd_get_moment_colors"
51
+ get-moment-details = "youversion.cli:poetry_cmd_get_moment_details"
52
+ get-moment-labels = "youversion.cli:poetry_cmd_get_moment_labels"
53
+ get-moments = "youversion.cli:poetry_cmd_get_moments"
54
+ get-moments-configuration = "youversion.cli:poetry_cmd_get_moments_configuration"
55
+ get-recommended-languages = "youversion.cli:poetry_cmd_get_recommended_languages"
56
+ get-saved-events = "youversion.cli:poetry_cmd_get_saved_events"
57
+ get-theme-description = "youversion.cli:poetry_cmd_get_theme_description"
58
+ get-themes = "youversion.cli:poetry_cmd_get_themes"
59
+ get-verse-colors = "youversion.cli:poetry_cmd_get_verse_colors"
60
+ get-video-details = "youversion.cli:poetry_cmd_get_video_details"
61
+ get-videos = "youversion.cli:poetry_cmd_get_videos"
62
+ hide-verse-colors = "youversion.cli:poetry_cmd_hide_verse_colors"
63
+ highlights = "youversion.cli:poetry_cmd_highlights"
64
+ images = "youversion.cli:poetry_cmd_images"
65
+ like-moment = "youversion.cli:poetry_cmd_like_moment"
66
+ moments = "youversion.cli:poetry_cmd_moments"
67
+ notes = "youversion.cli:poetry_cmd_notes"
68
+ plan-completions = "youversion.cli:poetry_cmd_plan_completions"
69
+ plan-progress = "youversion.cli:poetry_cmd_plan_progress"
70
+ plan-subscriptions = "youversion.cli:poetry_cmd_plan_subscriptions"
71
+ register-device = "youversion.cli:poetry_cmd_register_device"
72
+ remove-theme = "youversion.cli:poetry_cmd_remove_theme"
73
+ save-event = "youversion.cli:poetry_cmd_save_event"
74
+ search-bible = "youversion.cli:poetry_cmd_search_bible"
75
+ search-events = "youversion.cli:poetry_cmd_search_events"
76
+ search-plans = "youversion.cli:poetry_cmd_search_plans"
77
+ search-users = "youversion.cli:poetry_cmd_search_users"
78
+ send-friend-request = "youversion.cli:poetry_cmd_send_friend_request"
79
+ set-theme = "youversion.cli:poetry_cmd_set_theme"
80
+ unlike-moment = "youversion.cli:poetry_cmd_unlike_moment"
81
+ unregister-device = "youversion.cli:poetry_cmd_unregister_device"
82
+ update-moment = "youversion.cli:poetry_cmd_update_moment"
83
+ votd = "youversion.cli:poetry_cmd_votd"
84
+
85
+ [tool.poetry]
86
+ packages = [{ include = "youversion" }]
87
+ exclude = [
88
+ "documentation/**/*",
89
+ "documentation",
90
+ "examples/**/*",
91
+ "examples",
92
+ "tests/**/*",
93
+ "tests",
94
+ "htmlcov/**/*",
95
+ "htmlcov",
96
+ "env/**/*",
97
+ "env",
98
+ "*.pyc",
99
+ "__pycache__/**/*",
100
+ "*.egg-info",
101
+ ".pytest_cache/**/*",
102
+ ".mypy_cache/**/*",
103
+ "bandit-report.json",
104
+ "main.py",
105
+ "note_to_markdown.py",
106
+ "run_tests.py",
107
+ ]
108
+
109
+ [tool.poetry.group.dev.dependencies]
110
+ pytest = "^8.2.0"
111
+ pytest-cov = "^4.0.0"
112
+ pytest-asyncio = "^0.21.0"
113
+ black = "^23.0.0"
114
+ ruff = "^0.1.0"
115
+ sphinx = "^7.4.0"
116
+ sphinx-rtd-theme = "^3.0.0"
117
+
118
+ [build-system]
119
+ requires = ["poetry-core"]
120
+ build-backend = "poetry.core.masonry.api"
121
+
122
+
123
+ [tool.black]
124
+ line-length = 88
125
+ target-version = ['py39']
126
+ include = '\.pyi?$'
127
+ extend-exclude = '''
128
+ /(
129
+ # directories
130
+ \.eggs
131
+ | \.git
132
+ | \.hg
133
+ | \.mypy_cache
134
+ | \.tox
135
+ | \.venv
136
+ | build
137
+ | dist
138
+ )/
139
+ '''
140
+
141
+ [tool.ruff]
142
+ target-version = "py39"
143
+ line-length = 88
144
+ select = [
145
+ "E", # pycodestyle errors
146
+ "W", # pycodestyle warnings
147
+ "F", # pyflakes
148
+ "I", # isort
149
+ "B", # flake8-bugbear
150
+ "C4", # flake8-comprehensions
151
+ "UP", # pyupgrade
152
+ ]
153
+ ignore = [
154
+ "E501", # line too long, handled by black
155
+ "B008", # do not perform function calls in argument defaults
156
+ "C901", # too complex
157
+ ]
158
+
159
+ [tool.ruff.per-file-ignores]
160
+ "__init__.py" = ["F401"]
161
+
162
+ [tool.ruff.isort]
163
+ known-first-party = ["youversion"]
164
+
165
+ [tool.coverage.run]
166
+ source = ["youversion"]
167
+ omit = [
168
+ "youversion/cli.py",
169
+ "*/tests/*",
170
+ "*/test_*.py",
171
+ ]
172
+
173
+ [tool.coverage.report]
174
+ exclude_lines = [
175
+ "pragma: no cover",
176
+ "def __repr__",
177
+ "raise AssertionError",
178
+ "raise NotImplementedError",
179
+ "if __name__ == .__main__.:",
180
+ "if TYPE_CHECKING:",
181
+ "@abstractmethod",
182
+ ]
@@ -0,0 +1,34 @@
1
+ """YouVersion Bible Client Library
2
+
3
+ A Python client library for accessing the YouVersion Bible API.
4
+ Supports both synchronous and asynchronous operations.
5
+
6
+ Example usage:
7
+
8
+ Synchronous:
9
+ from youversion import SyncClient
10
+
11
+ with SyncClient() as client:
12
+ votd = client.verse_of_the_day()
13
+ print(votd)
14
+
15
+ Asynchronous:
16
+ import asyncio
17
+ from youversion import AsyncClient
18
+
19
+ async def main():
20
+ async with AsyncClient() as client:
21
+ votd = await client.verse_of_the_day()
22
+ print(votd)
23
+
24
+ asyncio.run(main())
25
+ """
26
+
27
+ from .clients import AsyncClient, SyncClient
28
+
29
+ # Backward compatibility aliases
30
+ AClient = AsyncClient
31
+ Client = SyncClient
32
+
33
+ __version__ = "0.3.0"
34
+ __all__ = ["AsyncClient", "SyncClient", "AClient", "Client"]