hishel 0.1.4__tar.gz → 0.1.5__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 (45) hide show
  1. {hishel-0.1.4 → hishel-0.1.5}/.gitignore +2 -1
  2. hishel-0.1.5/CHANGELOG.md +64 -0
  3. {hishel-0.1.4 → hishel-0.1.5}/PKG-INFO +33 -179
  4. {hishel-0.1.4 → hishel-0.1.5}/hishel/__init__.py +1 -1
  5. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_core/_base/_storages/_base.py +12 -0
  6. hishel-0.1.5/hishel/beta/_core/_headers.py +636 -0
  7. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/httpx.py +12 -1
  8. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/requests.py +10 -5
  9. hishel-0.1.4/CHANGELOG.md +0 -210
  10. hishel-0.1.4/hishel/beta/_core/_headers.py +0 -301
  11. {hishel-0.1.4 → hishel-0.1.5}/LICENSE +0 -0
  12. {hishel-0.1.4 → hishel-0.1.5}/README.md +0 -0
  13. {hishel-0.1.4 → hishel-0.1.5}/hishel/_async/__init__.py +0 -0
  14. {hishel-0.1.4 → hishel-0.1.5}/hishel/_async/_client.py +0 -0
  15. {hishel-0.1.4 → hishel-0.1.5}/hishel/_async/_mock.py +0 -0
  16. {hishel-0.1.4 → hishel-0.1.5}/hishel/_async/_pool.py +0 -0
  17. {hishel-0.1.4 → hishel-0.1.5}/hishel/_async/_storages.py +0 -0
  18. {hishel-0.1.4 → hishel-0.1.5}/hishel/_async/_transports.py +0 -0
  19. {hishel-0.1.4 → hishel-0.1.5}/hishel/_controller.py +0 -0
  20. {hishel-0.1.4 → hishel-0.1.5}/hishel/_exceptions.py +0 -0
  21. {hishel-0.1.4 → hishel-0.1.5}/hishel/_files.py +0 -0
  22. {hishel-0.1.4 → hishel-0.1.5}/hishel/_headers.py +0 -0
  23. {hishel-0.1.4 → hishel-0.1.5}/hishel/_lfu_cache.py +0 -0
  24. {hishel-0.1.4 → hishel-0.1.5}/hishel/_lmdb_types_.pyi +0 -0
  25. {hishel-0.1.4 → hishel-0.1.5}/hishel/_s3.py +0 -0
  26. {hishel-0.1.4 → hishel-0.1.5}/hishel/_serializers.py +0 -0
  27. {hishel-0.1.4 → hishel-0.1.5}/hishel/_sync/__init__.py +0 -0
  28. {hishel-0.1.4 → hishel-0.1.5}/hishel/_sync/_client.py +0 -0
  29. {hishel-0.1.4 → hishel-0.1.5}/hishel/_sync/_mock.py +0 -0
  30. {hishel-0.1.4 → hishel-0.1.5}/hishel/_sync/_pool.py +0 -0
  31. {hishel-0.1.4 → hishel-0.1.5}/hishel/_sync/_storages.py +0 -0
  32. {hishel-0.1.4 → hishel-0.1.5}/hishel/_sync/_transports.py +0 -0
  33. {hishel-0.1.4 → hishel-0.1.5}/hishel/_synchronization.py +0 -0
  34. {hishel-0.1.4 → hishel-0.1.5}/hishel/_utils.py +0 -0
  35. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/__init__.py +0 -0
  36. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_async_cache.py +0 -0
  37. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_core/__init__.py +0 -0
  38. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_core/_async/_storages/_sqlite.py +0 -0
  39. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_core/_base/_storages/_packing.py +0 -0
  40. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_core/_spec.py +0 -0
  41. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_core/_sync/_storages/_sqlite.py +0 -0
  42. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_core/models.py +0 -0
  43. {hishel-0.1.4 → hishel-0.1.5}/hishel/beta/_sync_cache.py +0 -0
  44. {hishel-0.1.4 → hishel-0.1.5}/hishel/py.typed +0 -0
  45. {hishel-0.1.4 → hishel-0.1.5}/pyproject.toml +0 -0
@@ -3,4 +3,5 @@ venv/
3
3
  __pycache__/
4
4
  .coverage
5
5
  .cache/
6
- .idea/
6
+ .idea/
7
+ coverage.xml
@@ -0,0 +1,64 @@
1
+ ## [0.1.5] - 2025-10-18
2
+
3
+ ### 🚀 Features
4
+
5
+ - *(perf)* Set chunk size to 128KB for httpx to reduce SQLite read/writes
6
+ - Better cache-control parsing
7
+ - Add close method to storages API (#384)
8
+ - *(perf)* Increase requests buffer size to 128KB, disable charset detection
9
+
10
+ ### 🐛 Bug Fixes
11
+
12
+ - *(docs)* Fix some line breaks
13
+
14
+ ### ⚙️ Miscellaneous Tasks
15
+
16
+ - Remove some redundant files from repo
17
+ ## [0.1.4] - 2025-10-14
18
+
19
+ ### 🚀 Features
20
+
21
+ - Add support for a sans-IO API (#366)
22
+ - Allow already consumed streams with `CacheTransport` (#377)
23
+ - Add sqlite storage for beta storages
24
+ - Get rid of some locks from sqlite storage
25
+ - Better async implemetation for sqlite storage
26
+
27
+ ### 🐛 Bug Fixes
28
+
29
+ - Create an sqlite file in a cache folder
30
+ - Fix beta imports
31
+
32
+ ### ⚙️ Miscellaneous Tasks
33
+
34
+ - Improve CI (#369)
35
+ - *(internal)* Remove src folder (#373)
36
+ - *(internal)* Temporary remove python3.14 from CI
37
+ - *(tests)* Add sqlite tests for new storage
38
+ - *(tests)* Move some tests to beta
39
+ ## [0.1.3] - 2025-07-06
40
+
41
+ ### 🚀 Features
42
+
43
+ - Support providing a path prefix to S3 storage (#342)
44
+
45
+ ### 📚 Documentation
46
+
47
+ - Update link to httpx transports page (#337)
48
+ ## [0.1.2] - 2025-04-04
49
+
50
+ ### 🐛 Bug Fixes
51
+
52
+ - Requirements.txt to reduce vulnerabilities (#263)
53
+ ## [0.0.30] - 2024-07-12
54
+
55
+ ### 🐛 Bug Fixes
56
+
57
+ - Requirements.txt to reduce vulnerabilities (#245)
58
+ - Requirements.txt to reduce vulnerabilities (#255)
59
+ ## [0.0.27] - 2024-05-31
60
+
61
+ ### 🐛 Bug Fixes
62
+
63
+ - *(redis)* Do not update metadata with negative ttl (#231)
64
+ ## [0.0.1] - 2023-07-22
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hishel
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Persistent cache implementation for httpx and httpcore
5
5
  Project-URL: Homepage, https://hishel.com
6
6
  Project-URL: Source, https://github.com/karpetrosyan/hishel
@@ -192,19 +192,31 @@ You have complete control over them; you can change storage or even write your o
192
192
  You can support the project by simply leaving a GitHub star ⭐ or by [contributing](https://hishel.com/contributing/).
193
193
  Help us grow and continue developing good software for you ❤️
194
194
 
195
+ ## [0.1.5] - 2025-10-18
196
+
197
+ ### 🚀 Features
198
+
199
+ - *(perf)* Set chunk size to 128KB for httpx to reduce SQLite read/writes
200
+ - Better cache-control parsing
201
+ - Add close method to storages API (#384)
202
+ - *(perf)* Increase requests buffer size to 128KB, disable charset detection
203
+
204
+ ### 🐛 Bug Fixes
205
+
206
+ - *(docs)* Fix some line breaks
207
+
208
+ ### ⚙️ Miscellaneous Tasks
209
+
210
+ - Remove some redundant files from repo
195
211
  ## [0.1.4] - 2025-10-14
196
212
 
197
213
  ### 🚀 Features
198
214
 
199
- - Add support for requests library
200
- - Add support for Python 3.14
201
215
  - Add support for a sans-IO API (#366)
202
216
  - Allow already consumed streams with `CacheTransport` (#377)
203
217
  - Add sqlite storage for beta storages
204
218
  - Get rid of some locks from sqlite storage
205
219
  - Better async implemetation for sqlite storage
206
- - Added `Metadata` to public API. (#363)
207
- - Fix race condition in FileStorage initialization. (#353)
208
220
 
209
221
  ### 🐛 Bug Fixes
210
222
 
@@ -218,187 +230,29 @@ Help us grow and continue developing good software for you ❤️
218
230
  - *(internal)* Temporary remove python3.14 from CI
219
231
  - *(tests)* Add sqlite tests for new storage
220
232
  - *(tests)* Move some tests to beta
221
- ## 0.1.3 (1st July, 2025)
222
-
223
- - Remove `types-redis` from dev dependencies (#336)
224
- - Bump redis to 6.0.0 and address async `.close()` deprecation warning (#336)
225
- - Avoid race condition when unlinking files in `FileStorage`. (#334)
226
- - Allow prodiving a `path_prefix` in `S3Storage` and `AsyncS3Storage`. (#342)
227
-
228
- ## 0.1.2 (5th April, 2025)
229
-
230
- - Add check for fips compliant python. (#325)
231
- - Fix compatibility with httpx. (#291)
232
- - Use `SyncByteStream` instead of `ByteStream`. (#298)
233
- - Don't raise exceptions if date-containing headers are invalid. (#318)
234
- - Fix for S3 Storage missing metadata in API request. (#320)
235
-
236
- ## 0.1.1 (2nd Nov, 2024)
237
-
238
- - Fix typing extensions not found. (#290)
239
-
240
- ## 0.1.0 (2nd Nov, 2024)
241
-
242
- - Add support for Python 3.12 / drop Python 3.8. (#286)
243
- - Specify usedforsecurity=False in blake2b. (#285)
244
-
245
- ## 0.0.33 (4th Oct, 2024)
246
-
247
- - Added a [Logging](https://hishel.com/advanced/logging/) section to the documentation.
248
-
249
- ## 0.0.32 (27th Sep, 2024)
250
-
251
- - Don't raise an exception if the `Date` header is not present. (#273)
252
-
253
- ## 0.0.31 (22nd Sep, 2024)
254
-
255
- - Ignore file not found error when cleaning up a file storage. (#264)
256
- - Fix `AssertionError` on `client.close()` when use SQLiteStorage. (#269)
257
- - Fix ignored flags when use `force_cache`. (#271)
258
-
259
- ## 0.0.30 (12th July, 2024)
260
-
261
- - Fix cache update on revalidation response with content (rfc9111 section 4.3.3) (#239)
262
- - Fix request extensions that were not passed into revalidation request for transport-based implementation (but were
263
- passed for the pool-based impl) (#247).
264
- - Add `cache_private` property to the controller to support acting as shared cache. (#224)
265
- - Improve efficiency of scanning cached responses in `FileStorage` by reducing number of syscalls. (#252)
266
- - Add `remove` support for storages (#241)
267
-
268
- ## 0.0.29 (23th June, 2024)
269
-
270
- - Documentation hotfix. (#244)
271
-
272
- ## 0.0.28 (23th June, 2024)
273
-
274
- - Add `revalidated` response extension. (#242)
275
-
276
- ## 0.0.27 (31th May, 2024)
277
-
278
- - Fix `RedisStorage` when using without ttl. (#231)
279
-
280
- ## 0.0.26 (12th April, 2024)
281
-
282
- - Expose `AsyncBaseStorage` and `BaseStorage`. (#220)
283
- - Prevent cache hits from resetting the ttl. (#215)
284
-
285
- ## 0.0.25 (26th March, 2024)
286
-
287
- - Add `force_cache` property to the controller, allowing RFC9111 rules to be completely disabled. (#204)
288
- - Add `.gitignore` to cache directory created by `FIleStorage`. (#197)
289
- - Remove `stale_*` headers from the `CacheControl` class. (#199)
290
-
291
- ## 0.0.24 (14th February, 2024)
292
-
293
- - Fix `botocore is not installed` exception when using any kind of storage. (#186)
233
+ ## [0.1.3] - 2025-07-06
294
234
 
295
- ## 0.0.23 (14th February, 2024)
296
-
297
- - Make `S3Storage` to check staleness of all cache files with set interval. (#182)
298
- - Fix an issue where an empty file in `FileCache` could cause a parsing error. (#181)
299
- - Support caching for `POST` and other HTTP methods. (#183)
300
-
301
- ## 0.0.22 (31th January, 2024)
302
-
303
- - Make `FileStorage` to check staleness of all cache files with set interval. (#169)
304
- - Support AWS S3 storages. (#164)
305
- - Move `typing_extensions` from requirements.txt to pyproject.toml. (#161)
306
-
307
- ## 0.0.21 (29th December, 2023)
308
-
309
- - Fix inner transport and connection pool instances closing. (#147)
310
- - Improved error message when the storage type is incorrect. (#138)
311
-
312
- ## 0.0.20 (12th December, 2023)
313
-
314
- - Add in-memory storage. (#133)
315
- - Allow customization of cache key generation. (#130)
316
-
317
- ## 0.0.19 (30th November, 2023)
318
-
319
- - Add `force_cache` extension to enforce the request to be cached, ignoring the HTTP headers. (#117)
320
- - Fix issue where sqlite storage cache get deleted immediately. (#119)
321
- - Support float numbers for storage ttl. (#107)
322
-
323
- ## 0.0.18 (23rd November, 2023)
324
-
325
- - Fix issue where freshness cannot be calculated to re-send request. (#104)
326
- - Add `cache_disabled` extension to temporarily disable the cache (#109)
327
- - Update `datetime.datetime.utcnow()` to `datetime.datetime.now(datetime.timezone.utc)` since `datetime.datetime.utcnow()` has been deprecated. (#111)
328
-
329
- ## 0.0.17 (6th November, 2023)
330
-
331
- - Fix `Last-Modified` validation.
332
-
333
- ## 0.0.16 (25th October, 2023)
334
-
335
- - Add `install_cache` function. (#95)
336
- - Add sqlite support. (#92)
337
- - Move `ttl` argument to `BaseStorage` class. (#94)
338
-
339
- ## 0.0.14 (23rd October, 2023)
340
-
341
- - Replace `AsyncResponseStream` with `AsyncCacheStream`. (#86)
342
- - Add `must-understand` response directive support. (#90)
343
-
344
- ## 0.0.13 (5th October, 2023)
345
-
346
- - Add support for Python 3.12. (#71)
347
- - Fix connections releasing from the connection pool. (#83)
348
-
349
- ## 0.0.12 (8th September, 2023)
350
-
351
- - Add metadata into the response extensions. (#56)
352
-
353
- ## 0.0.11 (15th August, 2023)
354
-
355
- - Add support for request `cache-control` directives. (#42)
356
- - Drop httpcore dependency. (#40)
357
- - Support HTTP methods only if they are defined as cacheable. (#37)
358
-
359
- ## 0.0.10 (7th August, 2023)
360
-
361
- - Add Response metadata. (#33)
362
- - Add API Reference documentation. (#30)
363
- - Use stale responses only if the client is disconnected. (#28)
364
-
365
- ## 0.0.9 (1st August, 2023)
366
-
367
- - Expose Controller API. (#23)
368
-
369
- ## 0.0.8 (31st July, 2023)
370
-
371
- - Skip redis tests if the server was not found. (#16)
372
- - Decrease sleep time for the storage ttl tests. (#18)
373
- - Fail coverage under 100. (#19)
374
-
375
- ## 0.0.7 (30th July, 2023)
376
-
377
- - Add support for `Heuristic Freshness`. (#11)
378
- - Change `Controller.cache_heuristically` to `Controller.allow_heuristics`. (#12)
379
- - Handle import errors. (#13)
380
-
381
- ## 0.0.6 (29th July, 2023)
235
+ ### 🚀 Features
382
236
 
383
- - Fix `Vary` header validation. (#8)
384
- - Dump original requests with the responses. (#7)
237
+ - Support providing a path prefix to S3 storage (#342)
385
238
 
386
- ## 0.0.5 (29th July, 2023)
239
+ ### 📚 Documentation
387
240
 
388
- - Fix httpx response streaming.
241
+ - Update link to httpx transports page (#337)
242
+ ## [0.1.2] - 2025-04-04
389
243
 
390
- ## 0.0.4 (29th July, 2023)
244
+ ### 🐛 Bug Fixes
391
245
 
392
- - Change `YamlSerializer` name to `YAMLSerializer`.
246
+ - Requirements.txt to reduce vulnerabilities (#263)
247
+ ## [0.0.30] - 2024-07-12
393
248
 
394
- ## 0.0.3 (28th July, 2023)
249
+ ### 🐛 Bug Fixes
395
250
 
396
- - Add `from_cache` response extension.
397
- - Add `typing_extensions` into the requirements.
251
+ - Requirements.txt to reduce vulnerabilities (#245)
252
+ - Requirements.txt to reduce vulnerabilities (#255)
253
+ ## [0.0.27] - 2024-05-31
398
254
 
399
- ## 0.0.2 (25th July, 2023)
255
+ ### 🐛 Bug Fixes
400
256
 
401
- - Add [redis](https://redis.io/) support.
402
- - Make backends thread and task safe.
403
- - Add black as a new linter.
404
- - Add an expire time for cached responses.
257
+ - *(redis)* Do not update metadata with negative ttl (#231)
258
+ ## [0.0.1] - 2023-07-22
@@ -53,5 +53,5 @@ def install_cache() -> None: # pragma: no cover
53
53
  httpx.Client = CacheClient # type: ignore
54
54
 
55
55
 
56
- __version__ = "0.1.4"
56
+ __version__ = "0.1.5"
57
57
 
@@ -87,6 +87,12 @@ class SyncBaseStorage(ABC):
87
87
  """
88
88
  raise NotImplementedError()
89
89
 
90
+ def close(self) -> None:
91
+ """
92
+ Close any resources held by the storage backend.
93
+ """
94
+ pass
95
+
90
96
  def is_soft_deleted(self, pair: IncompletePair | CompletePair) -> bool:
91
97
  """
92
98
  Check if a pair is soft deleted based on its metadata.
@@ -205,6 +211,12 @@ class AsyncBaseStorage(ABC):
205
211
  """
206
212
  raise NotImplementedError()
207
213
 
214
+ async def close(self) -> None:
215
+ """
216
+ Close any resources held by the storage backend.
217
+ """
218
+ pass
219
+
208
220
  def is_soft_deleted(self, pair: IncompletePair | CompletePair) -> bool:
209
221
  """
210
222
  Check if a pair is soft deleted based on its metadata.