hishel 0.1.5__tar.gz → 1.0.0.dev0__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 (46) hide show
  1. {hishel-0.1.5 → hishel-1.0.0.dev0}/.gitignore +2 -1
  2. {hishel-0.1.5 → hishel-1.0.0.dev0}/CHANGELOG.md +6 -0
  3. hishel-1.0.0.dev0/PKG-INFO +321 -0
  4. hishel-1.0.0.dev0/README.md +214 -0
  5. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/__init__.py +6 -6
  6. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_async_cache.py +3 -3
  7. hishel-1.0.0.dev0/hishel/_core/__init__.py +59 -0
  8. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_core/_async/_storages/_sqlite.py +3 -3
  9. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_core/_base/_storages/_base.py +1 -1
  10. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_core/_base/_storages/_packing.py +5 -5
  11. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_core/_spec.py +89 -2
  12. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_core/_sync/_storages/_sqlite.py +3 -3
  13. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_core/models.py +1 -1
  14. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_sync_cache.py +3 -3
  15. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/httpx.py +6 -6
  16. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/requests.py +5 -5
  17. {hishel-0.1.5 → hishel-1.0.0.dev0}/pyproject.toml +8 -21
  18. hishel-0.1.5/PKG-INFO +0 -258
  19. hishel-0.1.5/README.md +0 -148
  20. hishel-0.1.5/hishel/__init__.py +0 -57
  21. hishel-0.1.5/hishel/_async/__init__.py +0 -5
  22. hishel-0.1.5/hishel/_async/_client.py +0 -30
  23. hishel-0.1.5/hishel/_async/_mock.py +0 -43
  24. hishel-0.1.5/hishel/_async/_pool.py +0 -201
  25. hishel-0.1.5/hishel/_async/_storages.py +0 -768
  26. hishel-0.1.5/hishel/_async/_transports.py +0 -282
  27. hishel-0.1.5/hishel/_controller.py +0 -581
  28. hishel-0.1.5/hishel/_exceptions.py +0 -10
  29. hishel-0.1.5/hishel/_files.py +0 -54
  30. hishel-0.1.5/hishel/_headers.py +0 -215
  31. hishel-0.1.5/hishel/_lfu_cache.py +0 -71
  32. hishel-0.1.5/hishel/_lmdb_types_.pyi +0 -53
  33. hishel-0.1.5/hishel/_s3.py +0 -122
  34. hishel-0.1.5/hishel/_serializers.py +0 -329
  35. hishel-0.1.5/hishel/_sync/__init__.py +0 -5
  36. hishel-0.1.5/hishel/_sync/_client.py +0 -30
  37. hishel-0.1.5/hishel/_sync/_mock.py +0 -43
  38. hishel-0.1.5/hishel/_sync/_pool.py +0 -201
  39. hishel-0.1.5/hishel/_sync/_storages.py +0 -768
  40. hishel-0.1.5/hishel/_sync/_transports.py +0 -282
  41. hishel-0.1.5/hishel/_synchronization.py +0 -37
  42. hishel-0.1.5/hishel/beta/_core/__init__.py +0 -0
  43. {hishel-0.1.5 → hishel-1.0.0.dev0}/LICENSE +0 -0
  44. {hishel-0.1.5/hishel/beta → hishel-1.0.0.dev0/hishel}/_core/_headers.py +0 -0
  45. {hishel-0.1.5 → hishel-1.0.0.dev0}/hishel/_utils.py +0 -0
  46. {hishel-0.1.5 → hishel-1.0.0.dev0}/hishel/py.typed +0 -0
@@ -4,4 +4,5 @@ __pycache__/
4
4
  .coverage
5
5
  .cache/
6
6
  .idea/
7
- coverage.xml
7
+ coverage.xml
8
+ site
@@ -1,3 +1,9 @@
1
+ ## [1.0.0dev0] - 2025-10-19
2
+
3
+ ### ⚙️ Miscellaneous Tasks
4
+
5
+ - *(docs)* Use mike powered versioning
6
+ - *(docs)* Improve docs versioning, deploy dev doc on ci
1
7
  ## [0.1.5] - 2025-10-18
2
8
 
3
9
  ### 🚀 Features
@@ -0,0 +1,321 @@
1
+ Metadata-Version: 2.4
2
+ Name: hishel
3
+ Version: 1.0.0.dev0
4
+ Summary: Elegant HTTP Caching for Python
5
+ Project-URL: Homepage, https://hishel.com
6
+ Project-URL: Source, https://github.com/karpetrosyan/hishel
7
+ Author-email: Kar Petrosyan <kar.petrosyanpy@gmail.com>
8
+ License-Expression: BSD-3-Clause
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Web Environment
12
+ Classifier: Framework :: AsyncIO
13
+ Classifier: Framework :: Trio
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: BSD License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Topic :: Internet :: WWW/HTTP
26
+ Requires-Python: >=3.9
27
+ Requires-Dist: anyio>=4.9.0
28
+ Requires-Dist: anysqlite>=0.0.5
29
+ Requires-Dist: httpx>=0.28.0
30
+ Requires-Dist: msgpack>=1.1.2
31
+ Requires-Dist: typing-extensions>=4.14.1
32
+ Provides-Extra: httpx
33
+ Requires-Dist: httpx>=0.28.1; extra == 'httpx'
34
+ Provides-Extra: requests
35
+ Requires-Dist: requests>=2.32.5; extra == 'requests'
36
+ Description-Content-Type: text/markdown
37
+
38
+ <p align="center">
39
+ <img alt="Hishel Logo" width="350" src="https://raw.githubusercontent.com/karpetrosyan/hishel/master/docs/static/Shelkopryad_350x250_yellow.png#gh-dark-mode-only">
40
+ <img alt="Hishel Logo" width="350" src="https://raw.githubusercontent.com/karpetrosyan/hishel/master/docs/static/Shelkopryad_350x250_black.png#gh-light-mode-only">
41
+ </p>
42
+
43
+ <h1 align="center">Hishel</h1>
44
+
45
+ <p align="center">
46
+ <strong>Elegant HTTP Caching for Python</strong>
47
+ </p>
48
+
49
+ <p align="center">
50
+ <a href="https://pypi.org/project/hishel">
51
+ <img src="https://img.shields.io/pypi/v/hishel.svg" alt="PyPI version">
52
+ </a>
53
+ <a href="https://pypi.org/project/hishel">
54
+ <img src="https://img.shields.io/pypi/pyversions/hishel.svg" alt="Python versions">
55
+ </a>
56
+ <a href="https://github.com/karpetrosyan/hishel/blob/master/LICENSE">
57
+ <img src="https://img.shields.io/pypi/l/hishel" alt="License">
58
+ </a>
59
+ <a href="https://coveralls.io/github/karpetrosyan/hishel">
60
+ <img src="https://img.shields.io/coverallsCoverage/github/karpetrosyan/hishel" alt="Coverage">
61
+ </a>
62
+ <a href="https://static.pepy.tech/badge/hishel/month">
63
+ <img src="https://static.pepy.tech/badge/hishel/month" alt="Downloads">
64
+ </a>
65
+ </p>
66
+
67
+ ---
68
+
69
+ **Hishel** (հիշել, *to remember* in Armenian) is a modern HTTP caching library for Python that implements [RFC 9111](https://www.rfc-editor.org/rfc/rfc9111.html) specifications. It provides seamless caching integration for popular HTTP clients with minimal code changes.
70
+
71
+ ## ✨ Features
72
+
73
+ - 🎯 **RFC 9111 Compliant** - Fully compliant with the latest HTTP caching specification
74
+ - 🔌 **Easy Integration** - Drop-in support for HTTPX and Requests
75
+ - 💾 **Flexible Storage** - SQLite backend with more coming soon
76
+ - ⚡ **High Performance** - Efficient caching with minimal overhead
77
+ - 🔄 **Async & Sync** - Full support for both synchronous and asynchronous workflows
78
+ - 🎨 **Type Safe** - Fully typed with comprehensive type hints
79
+ - 🧪 **Well Tested** - Extensive test coverage and battle-tested
80
+ - 🎛️ **Configurable** - Fine-grained control over caching behavior
81
+ - 🌐 **Future Ready** - Designed for easy integration with any HTTP client/server
82
+
83
+ ## 📦 Installation
84
+
85
+ ```bash
86
+ pip install hishel
87
+ ```
88
+
89
+ ### Optional Dependencies
90
+
91
+ Install with specific HTTP client support:
92
+
93
+ ```bash
94
+ pip install hishel[httpx] # For HTTPX support
95
+ pip install hishel[requests] # For Requests support
96
+ ```
97
+
98
+ Or install both:
99
+
100
+ ```bash
101
+ pip install hishel[httpx,requests]
102
+ ```
103
+
104
+ ## 🚀 Quick Start
105
+
106
+ ### With HTTPX
107
+
108
+ **Synchronous:**
109
+
110
+ ```python
111
+ from hishel.httpx import SyncCacheClient
112
+
113
+ client = SyncCacheClient()
114
+
115
+ # First request - fetches from origin
116
+ response = client.get("https://api.example.com/data")
117
+ print(response.extensions["hishel_from_cache"]) # False
118
+
119
+ # Second request - served from cache
120
+ response = client.get("https://api.example.com/data")
121
+ print(response.extensions["hishel_from_cache"]) # True
122
+ ```
123
+
124
+ **Asynchronous:**
125
+
126
+ ```python
127
+ from hishel.httpx import AsyncCacheClient
128
+
129
+ async with AsyncCacheClient() as client:
130
+ # First request - fetches from origin
131
+ response = await client.get("https://api.example.com/data")
132
+ print(response.extensions["hishel_from_cache"]) # False
133
+
134
+ # Second request - served from cache
135
+ response = await client.get("https://api.example.com/data")
136
+ print(response.extensions["hishel_from_cache"]) # True
137
+ ```
138
+
139
+ ### With Requests
140
+
141
+ ```python
142
+ import requests
143
+ from hishel.requests import CacheAdapter
144
+
145
+ session = requests.Session()
146
+ session.mount("https://", CacheAdapter())
147
+ session.mount("http://", CacheAdapter())
148
+
149
+ # First request - fetches from origin
150
+ response = session.get("https://api.example.com/data")
151
+
152
+ # Second request - served from cache
153
+ response = session.get("https://api.example.com/data")
154
+ print(response.headers.get("X-Hishel-From-Cache")) # "True"
155
+ ```
156
+
157
+ ## 🎛️ Advanced Configuration
158
+
159
+ ### Custom Cache Options
160
+
161
+ ```python
162
+ from hishel import CacheOptions
163
+ from hishel.httpx import SyncCacheClient
164
+
165
+ client = SyncCacheClient(
166
+ cache_options=CacheOptions(
167
+ shared=False, # Use as private cache (browser-like)
168
+ supported_methods=["GET", "HEAD", "POST"], # Cache GET, HEAD, and POST
169
+ allow_stale=True # Allow serving stale responses
170
+ )
171
+ )
172
+ ```
173
+
174
+ ### Custom Storage Backend
175
+
176
+ ```python
177
+ from hishel import SyncSqliteStorage
178
+ from hishel.httpx import SyncCacheClient
179
+
180
+ storage = SyncSqliteStorage(
181
+ database_path="my_cache.db",
182
+ default_ttl=7200.0, # Cache entries expire after 2 hours
183
+ refresh_ttl_on_access=True # Reset TTL when accessing cached entries
184
+ )
185
+
186
+ client = SyncCacheClient(storage=storage)
187
+ ```
188
+
189
+ ## 🏗️ Architecture
190
+
191
+ Hishel uses a **sans-I/O state machine** architecture that separates HTTP caching logic from I/O operations:
192
+
193
+ - ✅ **Correct** - Fully RFC 9111 compliant
194
+ - ✅ **Testable** - Easy to test without network dependencies
195
+ - ✅ **Flexible** - Works with any HTTP client or server
196
+ - ✅ **Type Safe** - Clear state transitions with full type hints
197
+
198
+ ## 🔮 Roadmap
199
+
200
+ While Hishel currently supports HTTPX and Requests, we're actively working on:
201
+
202
+ - 🎯 Additional HTTP client integrations
203
+ - 🎯 Server-side caching support
204
+ - 🎯 More storage backends
205
+ - 🎯 Advanced caching strategies
206
+ - 🎯 Performance optimizations
207
+
208
+ ## 📚 Documentation
209
+
210
+ Comprehensive documentation is available at [https://hishel.com/dev](https://hishel.com/dev)
211
+
212
+ - [Getting Started](https://hishel.com)
213
+ - [HTTPX Integration](https://hishel.com/dev/integrations/httpx)
214
+ - [Requests Integration](https://hishel.com/dev/integrations/requests)
215
+ - [Storage Backends](https://hishel.com/dev/storages)
216
+ - [RFC 9111 Specification](https://hishel.com/dev/specification)
217
+
218
+ ## 🤝 Contributing
219
+
220
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
221
+
222
+ See our [Contributing Guide](https://hishel.com/dev/contributing) for more details.
223
+
224
+ ## 📄 License
225
+
226
+ This project is licensed under the BSD-3-Clause License - see the [LICENSE](LICENSE) file for details.
227
+
228
+ ## 💖 Support
229
+
230
+ If you find Hishel useful, please consider:
231
+
232
+ - ⭐ Starring the repository
233
+ - 🐛 Reporting bugs and issues
234
+ - 💡 Suggesting new features
235
+ - 📖 Improving documentation
236
+ - ☕ [Buying me a coffee](https://buymeacoffee.com/karpetrosyan)
237
+
238
+ ## 🙏 Acknowledgments
239
+
240
+ Hishel is inspired by and builds upon the excellent work in the Python HTTP ecosystem, particularly:
241
+
242
+ - [HTTPX](https://github.com/encode/httpx) - A next-generation HTTP client for Python
243
+ - [Requests](https://github.com/psf/requests) - The classic HTTP library for Python
244
+ - [RFC 9111](https://www.rfc-editor.org/rfc/rfc9111.html) - HTTP Caching specification
245
+
246
+ ---
247
+
248
+ <p align="center">
249
+ <strong>Made with ❤️ by <a href="https://github.com/karpetrosyan">Kar Petrosyan</a></strong>
250
+ </p>
251
+
252
+ ## [1.0.0dev0] - 2025-10-19
253
+
254
+ ### ⚙️ Miscellaneous Tasks
255
+
256
+ - *(docs)* Use mike powered versioning
257
+ - *(docs)* Improve docs versioning, deploy dev doc on ci
258
+ ## [0.1.5] - 2025-10-18
259
+
260
+ ### 🚀 Features
261
+
262
+ - *(perf)* Set chunk size to 128KB for httpx to reduce SQLite read/writes
263
+ - Better cache-control parsing
264
+ - Add close method to storages API (#384)
265
+ - *(perf)* Increase requests buffer size to 128KB, disable charset detection
266
+
267
+ ### 🐛 Bug Fixes
268
+
269
+ - *(docs)* Fix some line breaks
270
+
271
+ ### ⚙️ Miscellaneous Tasks
272
+
273
+ - Remove some redundant files from repo
274
+ ## [0.1.4] - 2025-10-14
275
+
276
+ ### 🚀 Features
277
+
278
+ - Add support for a sans-IO API (#366)
279
+ - Allow already consumed streams with `CacheTransport` (#377)
280
+ - Add sqlite storage for beta storages
281
+ - Get rid of some locks from sqlite storage
282
+ - Better async implemetation for sqlite storage
283
+
284
+ ### 🐛 Bug Fixes
285
+
286
+ - Create an sqlite file in a cache folder
287
+ - Fix beta imports
288
+
289
+ ### ⚙️ Miscellaneous Tasks
290
+
291
+ - Improve CI (#369)
292
+ - *(internal)* Remove src folder (#373)
293
+ - *(internal)* Temporary remove python3.14 from CI
294
+ - *(tests)* Add sqlite tests for new storage
295
+ - *(tests)* Move some tests to beta
296
+ ## [0.1.3] - 2025-07-06
297
+
298
+ ### 🚀 Features
299
+
300
+ - Support providing a path prefix to S3 storage (#342)
301
+
302
+ ### 📚 Documentation
303
+
304
+ - Update link to httpx transports page (#337)
305
+ ## [0.1.2] - 2025-04-04
306
+
307
+ ### 🐛 Bug Fixes
308
+
309
+ - Requirements.txt to reduce vulnerabilities (#263)
310
+ ## [0.0.30] - 2024-07-12
311
+
312
+ ### 🐛 Bug Fixes
313
+
314
+ - Requirements.txt to reduce vulnerabilities (#245)
315
+ - Requirements.txt to reduce vulnerabilities (#255)
316
+ ## [0.0.27] - 2024-05-31
317
+
318
+ ### 🐛 Bug Fixes
319
+
320
+ - *(redis)* Do not update metadata with negative ttl (#231)
321
+ ## [0.0.1] - 2023-07-22
@@ -0,0 +1,214 @@
1
+ <p align="center">
2
+ <img alt="Hishel Logo" width="350" src="https://raw.githubusercontent.com/karpetrosyan/hishel/master/docs/static/Shelkopryad_350x250_yellow.png#gh-dark-mode-only">
3
+ <img alt="Hishel Logo" width="350" src="https://raw.githubusercontent.com/karpetrosyan/hishel/master/docs/static/Shelkopryad_350x250_black.png#gh-light-mode-only">
4
+ </p>
5
+
6
+ <h1 align="center">Hishel</h1>
7
+
8
+ <p align="center">
9
+ <strong>Elegant HTTP Caching for Python</strong>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="https://pypi.org/project/hishel">
14
+ <img src="https://img.shields.io/pypi/v/hishel.svg" alt="PyPI version">
15
+ </a>
16
+ <a href="https://pypi.org/project/hishel">
17
+ <img src="https://img.shields.io/pypi/pyversions/hishel.svg" alt="Python versions">
18
+ </a>
19
+ <a href="https://github.com/karpetrosyan/hishel/blob/master/LICENSE">
20
+ <img src="https://img.shields.io/pypi/l/hishel" alt="License">
21
+ </a>
22
+ <a href="https://coveralls.io/github/karpetrosyan/hishel">
23
+ <img src="https://img.shields.io/coverallsCoverage/github/karpetrosyan/hishel" alt="Coverage">
24
+ </a>
25
+ <a href="https://static.pepy.tech/badge/hishel/month">
26
+ <img src="https://static.pepy.tech/badge/hishel/month" alt="Downloads">
27
+ </a>
28
+ </p>
29
+
30
+ ---
31
+
32
+ **Hishel** (հիշել, *to remember* in Armenian) is a modern HTTP caching library for Python that implements [RFC 9111](https://www.rfc-editor.org/rfc/rfc9111.html) specifications. It provides seamless caching integration for popular HTTP clients with minimal code changes.
33
+
34
+ ## ✨ Features
35
+
36
+ - 🎯 **RFC 9111 Compliant** - Fully compliant with the latest HTTP caching specification
37
+ - 🔌 **Easy Integration** - Drop-in support for HTTPX and Requests
38
+ - 💾 **Flexible Storage** - SQLite backend with more coming soon
39
+ - ⚡ **High Performance** - Efficient caching with minimal overhead
40
+ - 🔄 **Async & Sync** - Full support for both synchronous and asynchronous workflows
41
+ - 🎨 **Type Safe** - Fully typed with comprehensive type hints
42
+ - 🧪 **Well Tested** - Extensive test coverage and battle-tested
43
+ - 🎛️ **Configurable** - Fine-grained control over caching behavior
44
+ - 🌐 **Future Ready** - Designed for easy integration with any HTTP client/server
45
+
46
+ ## 📦 Installation
47
+
48
+ ```bash
49
+ pip install hishel
50
+ ```
51
+
52
+ ### Optional Dependencies
53
+
54
+ Install with specific HTTP client support:
55
+
56
+ ```bash
57
+ pip install hishel[httpx] # For HTTPX support
58
+ pip install hishel[requests] # For Requests support
59
+ ```
60
+
61
+ Or install both:
62
+
63
+ ```bash
64
+ pip install hishel[httpx,requests]
65
+ ```
66
+
67
+ ## 🚀 Quick Start
68
+
69
+ ### With HTTPX
70
+
71
+ **Synchronous:**
72
+
73
+ ```python
74
+ from hishel.httpx import SyncCacheClient
75
+
76
+ client = SyncCacheClient()
77
+
78
+ # First request - fetches from origin
79
+ response = client.get("https://api.example.com/data")
80
+ print(response.extensions["hishel_from_cache"]) # False
81
+
82
+ # Second request - served from cache
83
+ response = client.get("https://api.example.com/data")
84
+ print(response.extensions["hishel_from_cache"]) # True
85
+ ```
86
+
87
+ **Asynchronous:**
88
+
89
+ ```python
90
+ from hishel.httpx import AsyncCacheClient
91
+
92
+ async with AsyncCacheClient() as client:
93
+ # First request - fetches from origin
94
+ response = await client.get("https://api.example.com/data")
95
+ print(response.extensions["hishel_from_cache"]) # False
96
+
97
+ # Second request - served from cache
98
+ response = await client.get("https://api.example.com/data")
99
+ print(response.extensions["hishel_from_cache"]) # True
100
+ ```
101
+
102
+ ### With Requests
103
+
104
+ ```python
105
+ import requests
106
+ from hishel.requests import CacheAdapter
107
+
108
+ session = requests.Session()
109
+ session.mount("https://", CacheAdapter())
110
+ session.mount("http://", CacheAdapter())
111
+
112
+ # First request - fetches from origin
113
+ response = session.get("https://api.example.com/data")
114
+
115
+ # Second request - served from cache
116
+ response = session.get("https://api.example.com/data")
117
+ print(response.headers.get("X-Hishel-From-Cache")) # "True"
118
+ ```
119
+
120
+ ## 🎛️ Advanced Configuration
121
+
122
+ ### Custom Cache Options
123
+
124
+ ```python
125
+ from hishel import CacheOptions
126
+ from hishel.httpx import SyncCacheClient
127
+
128
+ client = SyncCacheClient(
129
+ cache_options=CacheOptions(
130
+ shared=False, # Use as private cache (browser-like)
131
+ supported_methods=["GET", "HEAD", "POST"], # Cache GET, HEAD, and POST
132
+ allow_stale=True # Allow serving stale responses
133
+ )
134
+ )
135
+ ```
136
+
137
+ ### Custom Storage Backend
138
+
139
+ ```python
140
+ from hishel import SyncSqliteStorage
141
+ from hishel.httpx import SyncCacheClient
142
+
143
+ storage = SyncSqliteStorage(
144
+ database_path="my_cache.db",
145
+ default_ttl=7200.0, # Cache entries expire after 2 hours
146
+ refresh_ttl_on_access=True # Reset TTL when accessing cached entries
147
+ )
148
+
149
+ client = SyncCacheClient(storage=storage)
150
+ ```
151
+
152
+ ## 🏗️ Architecture
153
+
154
+ Hishel uses a **sans-I/O state machine** architecture that separates HTTP caching logic from I/O operations:
155
+
156
+ - ✅ **Correct** - Fully RFC 9111 compliant
157
+ - ✅ **Testable** - Easy to test without network dependencies
158
+ - ✅ **Flexible** - Works with any HTTP client or server
159
+ - ✅ **Type Safe** - Clear state transitions with full type hints
160
+
161
+ ## 🔮 Roadmap
162
+
163
+ While Hishel currently supports HTTPX and Requests, we're actively working on:
164
+
165
+ - 🎯 Additional HTTP client integrations
166
+ - 🎯 Server-side caching support
167
+ - 🎯 More storage backends
168
+ - 🎯 Advanced caching strategies
169
+ - 🎯 Performance optimizations
170
+
171
+ ## 📚 Documentation
172
+
173
+ Comprehensive documentation is available at [https://hishel.com/dev](https://hishel.com/dev)
174
+
175
+ - [Getting Started](https://hishel.com)
176
+ - [HTTPX Integration](https://hishel.com/dev/integrations/httpx)
177
+ - [Requests Integration](https://hishel.com/dev/integrations/requests)
178
+ - [Storage Backends](https://hishel.com/dev/storages)
179
+ - [RFC 9111 Specification](https://hishel.com/dev/specification)
180
+
181
+ ## 🤝 Contributing
182
+
183
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
184
+
185
+ See our [Contributing Guide](https://hishel.com/dev/contributing) for more details.
186
+
187
+ ## 📄 License
188
+
189
+ This project is licensed under the BSD-3-Clause License - see the [LICENSE](LICENSE) file for details.
190
+
191
+ ## 💖 Support
192
+
193
+ If you find Hishel useful, please consider:
194
+
195
+ - ⭐ Starring the repository
196
+ - 🐛 Reporting bugs and issues
197
+ - 💡 Suggesting new features
198
+ - 📖 Improving documentation
199
+ - ☕ [Buying me a coffee](https://buymeacoffee.com/karpetrosyan)
200
+
201
+ ## 🙏 Acknowledgments
202
+
203
+ Hishel is inspired by and builds upon the excellent work in the Python HTTP ecosystem, particularly:
204
+
205
+ - [HTTPX](https://github.com/encode/httpx) - A next-generation HTTP client for Python
206
+ - [Requests](https://github.com/psf/requests) - The classic HTTP library for Python
207
+ - [RFC 9111](https://www.rfc-editor.org/rfc/rfc9111.html) - HTTP Caching specification
208
+
209
+ ---
210
+
211
+ <p align="center">
212
+ <strong>Made with ❤️ by <a href="https://github.com/karpetrosyan">Kar Petrosyan</a></strong>
213
+ </p>
214
+
@@ -1,10 +1,10 @@
1
- from hishel.beta._core._async._storages._sqlite import AsyncSqliteStorage
2
- from hishel.beta._core._base._storages._base import (
1
+ from hishel._core._async._storages._sqlite import AsyncSqliteStorage
2
+ from hishel._core._base._storages._base import (
3
3
  AsyncBaseStorage as AsyncBaseStorage,
4
4
  SyncBaseStorage as SyncBaseStorage,
5
5
  )
6
- from hishel.beta._core._headers import Headers as Headers
7
- from hishel.beta._core._spec import (
6
+ from hishel._core._headers import Headers as Headers
7
+ from hishel._core._spec import (
8
8
  AnyState as AnyState,
9
9
  CacheMiss as CacheMiss,
10
10
  CacheOptions as CacheOptions,
@@ -17,8 +17,8 @@ from hishel.beta._core._spec import (
17
17
  StoreAndUse as StoreAndUse,
18
18
  create_idle_state as create_idle_state,
19
19
  )
20
- from hishel.beta._core._sync._storages._sqlite import SyncSqliteStorage
21
- from hishel.beta._core.models import (
20
+ from hishel._core._sync._storages._sqlite import SyncSqliteStorage
21
+ from hishel._core.models import (
22
22
  CompletePair as CompletePair,
23
23
  IncompletePair as IncompletePair,
24
24
  Pair as Pair,
@@ -8,7 +8,7 @@ from typing import AsyncIterator, Awaitable, Callable
8
8
 
9
9
  from typing_extensions import assert_never
10
10
 
11
- from hishel.beta import (
11
+ from hishel import (
12
12
  AnyState,
13
13
  AsyncBaseStorage,
14
14
  AsyncSqliteStorage,
@@ -24,8 +24,8 @@ from hishel.beta import (
24
24
  StoreAndUse,
25
25
  create_idle_state,
26
26
  )
27
- from hishel.beta._core._spec import InvalidatePairs, vary_headers_match
28
- from hishel.beta._core.models import CompletePair
27
+ from hishel._core._spec import InvalidatePairs, vary_headers_match
28
+ from hishel._core.models import CompletePair
29
29
 
30
30
  logger = logging.getLogger("hishel.integrations.clients")
31
31
 
@@ -0,0 +1,59 @@
1
+ from hishel._core._async._storages._sqlite import AsyncSqliteStorage
2
+ from hishel._core._base._storages._base import (
3
+ AsyncBaseStorage as AsyncBaseStorage,
4
+ SyncBaseStorage as SyncBaseStorage,
5
+ )
6
+ from hishel._core._headers import Headers as Headers
7
+ from hishel._core._spec import (
8
+ AnyState as AnyState,
9
+ CacheMiss as CacheMiss,
10
+ CacheOptions as CacheOptions,
11
+ CouldNotBeStored as CouldNotBeStored,
12
+ FromCache as FromCache,
13
+ IdleClient as IdleClient,
14
+ NeedRevalidation as NeedRevalidation,
15
+ NeedToBeUpdated as NeedToBeUpdated,
16
+ State as State,
17
+ StoreAndUse as StoreAndUse,
18
+ create_idle_state as create_idle_state,
19
+ )
20
+ from hishel._core._sync._storages._sqlite import SyncSqliteStorage
21
+ from hishel._core.models import (
22
+ CompletePair as CompletePair,
23
+ IncompletePair as IncompletePair,
24
+ Pair as Pair,
25
+ PairMeta as PairMeta,
26
+ Request as Request,
27
+ Response,
28
+ )
29
+
30
+ __all__ = (
31
+ # New API
32
+ ## States
33
+ "AnyState",
34
+ "IdleClient",
35
+ "CacheMiss",
36
+ "FromCache",
37
+ "NeedRevalidation",
38
+ "AnyState",
39
+ "CacheOptions",
40
+ "NeedToBeUpdated",
41
+ "State",
42
+ "StoreAndUse",
43
+ "CouldNotBeStored",
44
+ "create_idle_state",
45
+ ## Models
46
+ "Request",
47
+ "Response",
48
+ "Pair",
49
+ "IncompletePair",
50
+ "CompletePair",
51
+ "PairMeta",
52
+ ## Headers
53
+ "Headers",
54
+ ## Storages
55
+ "SyncBaseStorage",
56
+ "AsyncBaseStorage",
57
+ "SyncSqliteStorage",
58
+ "AsyncSqliteStorage",
59
+ )
@@ -15,9 +15,9 @@ from typing import (
15
15
 
16
16
  import anysqlite
17
17
 
18
- from hishel.beta._core._base._storages._base import AsyncBaseStorage, ensure_cache_dict
19
- from hishel.beta._core._base._storages._packing import pack, unpack
20
- from hishel.beta._core.models import (
18
+ from hishel._core._base._storages._base import AsyncBaseStorage, ensure_cache_dict
19
+ from hishel._core._base._storages._packing import pack, unpack
20
+ from hishel._core.models import (
21
21
  CompletePair,
22
22
  IncompletePair,
23
23
  Pair,
@@ -7,7 +7,7 @@ import uuid
7
7
  from abc import ABC
8
8
  from pathlib import Path
9
9
 
10
- from hishel.beta._core.models import CompletePair, IncompletePair, Request, Response
10
+ from hishel._core.models import CompletePair, IncompletePair, Request, Response
11
11
 
12
12
 
13
13
  class SyncBaseStorage(ABC):