beaver-db 0.13.0__py3-none-any.whl → 0.13.1__py3-none-any.whl

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.

Potentially problematic release.


This version of beaver-db might be problematic. Click here for more details.

beaver/core.py CHANGED
@@ -267,12 +267,18 @@ class BeaverDB:
267
267
 
268
268
  # --- Factory and Passthrough Methods ---
269
269
 
270
- def dict(self, name: str) -> DictManager:
271
- """Returns a wrapper object for interacting with a named dictionary."""
270
+ def dict[T](self, name: str, model: type[T] | None = None) -> DictManager[T]:
271
+ """
272
+ Returns a wrapper object for interacting with a named dictionary.
273
+ If model is defined, it should be a type used for automatic (de)serialization.
274
+ """
272
275
  if not isinstance(name, str) or not name:
273
276
  raise TypeError("Dictionary name must be a non-empty string.")
274
277
 
275
- return DictManager(name, self._conn)
278
+ if model and not isinstance(model, JsonSerializable):
279
+ raise TypeError("The model parameter must be a JsonSerializable class.")
280
+
281
+ return DictManager(name, self._conn, model)
276
282
 
277
283
  def list[T](self, name: str, model: type[T] | None = None) -> ListManager[T]:
278
284
  """
@@ -285,7 +291,7 @@ class BeaverDB:
285
291
  if model and not isinstance(model, JsonSerializable):
286
292
  raise TypeError("The model parameter must be a JsonSerializable class.")
287
293
 
288
- return ListManager(name, self._conn)
294
+ return ListManager(name, self._conn, model)
289
295
 
290
296
  def queue[T](self, name: str, model: type[T] | None = None) -> QueueManager[T]:
291
297
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beaver-db
3
- Version: 0.13.0
3
+ Version: 0.13.1
4
4
  Summary: Fast, embedded, and multi-modal DB based on SQLite for AI-powered applications.
5
5
  Requires-Python: >=3.13
6
6
  Description-Content-Type: text/markdown
@@ -274,13 +274,17 @@ For more in-depth examples, check out the scripts in the `examples/` directory:
274
274
 
275
275
  ## Roadmap
276
276
 
277
+ `beaver` is roughly feature-complete, but there are still some features and improvements planned for future releases, mostly directed to improving developer experience.
278
+
277
279
  These are some of the features and improvements planned for future releases:
278
280
 
279
- - **Full Async API**: Comprehensive async support with on-demand wrappers for all collections.
280
- - **Type Hints**: Pydantic-based type hints for lists, dicts, and queues.
281
+ - **Async API**: Extend the async support with on-demand wrappers for all features besides channels.
282
+ - **Type Hints**: Extend type hints for channels and documents.
281
283
 
282
284
  Check out the [roadmap](roadmap.md) for a detailed list of upcoming features and design ideas.
283
285
 
286
+ If you think of something that would make `beaver` more useful for your use case, please open an issue and/or submit a pull request.
287
+
284
288
  ## License
285
289
 
286
290
  This project is licensed under the MIT License.
@@ -2,14 +2,14 @@ beaver/__init__.py,sha256=qyEzF1Os7w4b4Hijgz0Y0R4zTrRBrHIGT1mEkZFl2YM,101
2
2
  beaver/blobs.py,sha256=5yVDzWyqi6Fur-2r0gaeIjEKj9fUPXb9hPulCTknJJI,3355
3
3
  beaver/channels.py,sha256=jKL1sVLOe_Q_pP0q1-iceZbPe8FOi0EwqJtOMOe96f4,8675
4
4
  beaver/collections.py,sha256=SZcaZnhcTpKb2OfpZOpFiVxh4-joYAJc6U98UeIhMuU,24247
5
- beaver/core.py,sha256=xoWqmumhm969UPwzqb40Tl--KSqumMN4tyP_WVfu8GQ,11980
5
+ beaver/core.py,sha256=OdzXmAwBw12SwUsHBYvV3tFr5NHE3AHQ9HBfjZafDN0,12283
6
6
  beaver/dicts.py,sha256=1BQ9A_cMkJ7l5ayWbDG-4Wi3WtQ-9BKd7Wj_CB7dGlU,5410
7
7
  beaver/lists.py,sha256=0LT2XjuHs8pDgvW48kk_lfVc-Y-Ulmym0gcVWRESPtA,9708
8
8
  beaver/queues.py,sha256=SFu2180ONotnZOcYp1Ld5d8kxzYxaOlgDdcr70ZoBL8,3641
9
9
  beaver/types.py,sha256=65rDdj97EegghEkKCNjI67bPYtTTI_jyB-leHdIypx4,1249
10
10
  beaver/vectors.py,sha256=j7RL2Y_xMAF2tPTi6E2LdJqZerSQXlnEQJOGZkefTsA,18358
11
- beaver_db-0.13.0.dist-info/licenses/LICENSE,sha256=1xrIY5JnMk_QDQzsqmVzPIIyCgZAkWCC8kF2Ddo1UT0,1071
12
- beaver_db-0.13.0.dist-info/METADATA,sha256=zGcAeV9HSyTaAuQO0YYEzB7SfqJeRVjR3tBoX3HPiaY,14928
13
- beaver_db-0.13.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- beaver_db-0.13.0.dist-info/top_level.txt,sha256=FxA4XnX5Qm5VudEXCduFriqi4dQmDWpQ64d7g69VQKI,7
15
- beaver_db-0.13.0.dist-info/RECORD,,
11
+ beaver_db-0.13.1.dist-info/licenses/LICENSE,sha256=1xrIY5JnMk_QDQzsqmVzPIIyCgZAkWCC8kF2Ddo1UT0,1071
12
+ beaver_db-0.13.1.dist-info/METADATA,sha256=DYVLkTRCAJf8LsS20DVWO_TWC_69RYAWIwCdrqNxS-4,15228
13
+ beaver_db-0.13.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ beaver_db-0.13.1.dist-info/top_level.txt,sha256=FxA4XnX5Qm5VudEXCduFriqi4dQmDWpQ64d7g69VQKI,7
15
+ beaver_db-0.13.1.dist-info/RECORD,,