beaver-db 0.14.0__tar.gz → 0.15.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.

Potentially problematic release.


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

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beaver-db
3
- Version: 0.14.0
3
+ Version: 0.15.0
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
@@ -31,12 +31,13 @@ A fast, single-file, multi-modal database for Python, built with the standard `s
31
31
  - **Sync/Async High-Efficiency Pub/Sub**: A powerful, thread and process-safe publish-subscribe system for real-time messaging with a fan-out architecture. Sync by default, but with an `as_async` wrapper for async applications.
32
32
  - **Namespaced Key-Value Dictionaries**: A Pythonic, dictionary-like interface for storing any JSON-serializable object within separate namespaces with optional TTL for cache implementations.
33
33
  - **Pythonic List Management**: A fluent, Redis-like interface for managing persistent, ordered lists.
34
- - **Persistent Priority Queue**: A high-performance, persistent queue that always returns the item with the highest priority, perfect for task management.
34
+ - **Persistent Priority Queue**: A high-performance, persistent priority queue perfect for task orchestration across multiple processes. Also with optional async support.
35
35
  - **Simple Blob Storage**: A dictionary-like interface for storing medium-sized binary files (like PDFs or images) directly in the database, ensuring transactional integrity with your other data.
36
36
  - **High-Performance Vector Storage & Search**: Store vector embeddings and perform fast, crash-safe approximate nearest neighbor searches using a `faiss`-based hybrid index.
37
37
  - **Full-Text and Fuzzy Search**: Automatically index and search through document metadata using SQLite's powerful FTS5 engine, enhanced with optional fuzzy search for typo-tolerant matching.
38
38
  - **Knowledge Graph**: Create relationships between documents and traverse the graph to find neighbors or perform multi-hop walks.
39
39
  - **Single-File & Portable**: All data is stored in a single SQLite file, making it incredibly easy to move, back up, or embed in your application.
40
+ - **Optional Type-Safety:** Although the database is schemaless, you can use a minimalistic typing system for automatic serialization and deserialization that is Pydantic-compatible out of the box.
40
41
 
41
42
  ## How Beaver is Implemented
42
43
 
@@ -260,21 +261,24 @@ Basically everywhere you can store or get some object in BeaverDB, you can use a
260
261
 
261
262
  For more in-depth examples, check out the scripts in the `examples/` directory:
262
263
 
263
- - [`examples/async_pubsub.py`](examples/async_pubsub.py): A demonstration of the asynchronous wrapper for the publish/subscribe system.
264
- - [`examples/blobs.py`](examples/blobs.py): Demonstrates how to store and retrieve binary data in the database.
265
- - [`examples/cache.py`](examples/cache.py): A practical example of using a dictionary with TTL as a cache for API calls.
266
- - [`examples/fts.py`](examples/fts.py): A detailed look at full-text search, including targeted searches on specific metadata fields.
267
- - [`examples/fuzzy.py`](examples/fuzzy.py): Demonstrates fuzzy search capabilities for text search.
268
- - [`examples/general_test.py`](examples/general_test.py): A general-purpose test to run all operations randomly which allows testing long-running processes and synchronicity issues.
269
- - [`examples/graph.py`](examples/graph.py): Shows how to create relationships between documents and perform multi-hop graph traversals.
270
- - [`examples/kvstore.py`](examples/kvstore.py): A comprehensive demo of the namespaced dictionary feature.
271
- - [`examples/list.py`](examples/list.py): Shows the full capabilities of the persistent list, including slicing and in-place updates.
272
- - [`examples/publisher.py`](examples/publisher.py) and [`examples/subscriber.py`](examples/subscriber.py): A pair of examples demonstrating inter-process message passing with the publish/subscribe system.
273
- - [`examples/pubsub.py`](examples/pubsub.py): A demonstration of the synchronous, thread-safe publish/subscribe system in a single process.
274
- - [`examples/queue.py`](examples/queue.py): A practical example of using the persistent priority queue for task management.
275
- - [`examples/rerank.py`](examples/rerank.py): Shows how to combine results from vector and text search for more refined results.
276
- - [`examples/stress_vectors.py`](examples/stress_vectors.py): A stress test for the vector search functionality.
277
- - [`examples/vector.py`](examples/vector.py): Demonstrates how to index and search vector embeddings, including upserts.
264
+ - [`async_pubsub.py`](examples/async_pubsub.py): A demonstration of the asynchronous wrapper for the publish/subscribe system.
265
+ - [`blobs.py`](examples/blobs.py): Demonstrates how to store and retrieve binary data in the database.
266
+ - [`cache.py`](examples/cache.py): A practical example of using a dictionary with TTL as a cache for API calls.
267
+ - [`fts.py`](examples/fts.py): A detailed look at full-text search, including targeted searches on specific metadata fields.
268
+ - [`fuzzy.py`](examples/fuzzy.py): Demonstrates fuzzy search capabilities for text search.
269
+ - [`general_test.py`](examples/general_test.py): A general-purpose test to run all operations randomly which allows testing long-running processes and synchronicity issues.
270
+ - [`graph.py`](examples/graph.py): Shows how to create relationships between documents and perform multi-hop graph traversals.
271
+ - [`kvstore.py`](examples/kvstore.py): A comprehensive demo of the namespaced dictionary feature.
272
+ - [`list.py`](examples/list.py): Shows the full capabilities of the persistent list, including slicing and in-place updates.
273
+ - [`pqueue.py`](examples/pqueue.py): A practical example of using the persistent priority queue for task management.
274
+ - [`producer_consumer.py`](examples/producer_consumer.py): A demonstration of the distributed task queue system in a multi-process environment.
275
+ - [`publisher.py`](examples/publisher.py) and [`subscriber.py`](examples/subscriber.py): A pair of examples demonstrating inter-process message passing with the publish/subscribe system.
276
+ - [`pubsub.py`](examples/pubsub.py): A demonstration of the synchronous, thread-safe publish/subscribe system in a single process.
277
+ - [`rerank.py`](examples/rerank.py): Shows how to combine results from vector and text search for more refined results.
278
+ - [`stress_vectors.py`](examples/stress_vectors.py): A stress test for the vector search functionality.
279
+ - [`textual_chat.py`](examples/textual_chat.py): A chat application built with `textual` and `beaver` to illustrate the use of several primitives (lists, dicts, and channels) at the same time.
280
+ - [`type_hints.py](examples/type_hints.py): Shows how to use type hints with `beaver` to get better IDE support and type safety.
281
+ - [`vector.py`](examples/vector.py): Demonstrates how to index and search vector embeddings, including upserts.
278
282
 
279
283
  ## Roadmap
280
284
 
@@ -283,7 +287,6 @@ For more in-depth examples, check out the scripts in the `examples/` directory:
283
287
  These are some of the features and improvements planned for future releases:
284
288
 
285
289
  - **Async API**: Extend the async support with on-demand wrappers for all features besides channels.
286
- - **Type Hints**: Extend type hints for channels and documents.
287
290
 
288
291
  Check out the [roadmap](roadmap.md) for a detailed list of upcoming features and design ideas.
289
292
 
@@ -20,12 +20,13 @@ A fast, single-file, multi-modal database for Python, built with the standard `s
20
20
  - **Sync/Async High-Efficiency Pub/Sub**: A powerful, thread and process-safe publish-subscribe system for real-time messaging with a fan-out architecture. Sync by default, but with an `as_async` wrapper for async applications.
21
21
  - **Namespaced Key-Value Dictionaries**: A Pythonic, dictionary-like interface for storing any JSON-serializable object within separate namespaces with optional TTL for cache implementations.
22
22
  - **Pythonic List Management**: A fluent, Redis-like interface for managing persistent, ordered lists.
23
- - **Persistent Priority Queue**: A high-performance, persistent queue that always returns the item with the highest priority, perfect for task management.
23
+ - **Persistent Priority Queue**: A high-performance, persistent priority queue perfect for task orchestration across multiple processes. Also with optional async support.
24
24
  - **Simple Blob Storage**: A dictionary-like interface for storing medium-sized binary files (like PDFs or images) directly in the database, ensuring transactional integrity with your other data.
25
25
  - **High-Performance Vector Storage & Search**: Store vector embeddings and perform fast, crash-safe approximate nearest neighbor searches using a `faiss`-based hybrid index.
26
26
  - **Full-Text and Fuzzy Search**: Automatically index and search through document metadata using SQLite's powerful FTS5 engine, enhanced with optional fuzzy search for typo-tolerant matching.
27
27
  - **Knowledge Graph**: Create relationships between documents and traverse the graph to find neighbors or perform multi-hop walks.
28
28
  - **Single-File & Portable**: All data is stored in a single SQLite file, making it incredibly easy to move, back up, or embed in your application.
29
+ - **Optional Type-Safety:** Although the database is schemaless, you can use a minimalistic typing system for automatic serialization and deserialization that is Pydantic-compatible out of the box.
29
30
 
30
31
  ## How Beaver is Implemented
31
32
 
@@ -249,21 +250,24 @@ Basically everywhere you can store or get some object in BeaverDB, you can use a
249
250
 
250
251
  For more in-depth examples, check out the scripts in the `examples/` directory:
251
252
 
252
- - [`examples/async_pubsub.py`](examples/async_pubsub.py): A demonstration of the asynchronous wrapper for the publish/subscribe system.
253
- - [`examples/blobs.py`](examples/blobs.py): Demonstrates how to store and retrieve binary data in the database.
254
- - [`examples/cache.py`](examples/cache.py): A practical example of using a dictionary with TTL as a cache for API calls.
255
- - [`examples/fts.py`](examples/fts.py): A detailed look at full-text search, including targeted searches on specific metadata fields.
256
- - [`examples/fuzzy.py`](examples/fuzzy.py): Demonstrates fuzzy search capabilities for text search.
257
- - [`examples/general_test.py`](examples/general_test.py): A general-purpose test to run all operations randomly which allows testing long-running processes and synchronicity issues.
258
- - [`examples/graph.py`](examples/graph.py): Shows how to create relationships between documents and perform multi-hop graph traversals.
259
- - [`examples/kvstore.py`](examples/kvstore.py): A comprehensive demo of the namespaced dictionary feature.
260
- - [`examples/list.py`](examples/list.py): Shows the full capabilities of the persistent list, including slicing and in-place updates.
261
- - [`examples/publisher.py`](examples/publisher.py) and [`examples/subscriber.py`](examples/subscriber.py): A pair of examples demonstrating inter-process message passing with the publish/subscribe system.
262
- - [`examples/pubsub.py`](examples/pubsub.py): A demonstration of the synchronous, thread-safe publish/subscribe system in a single process.
263
- - [`examples/queue.py`](examples/queue.py): A practical example of using the persistent priority queue for task management.
264
- - [`examples/rerank.py`](examples/rerank.py): Shows how to combine results from vector and text search for more refined results.
265
- - [`examples/stress_vectors.py`](examples/stress_vectors.py): A stress test for the vector search functionality.
266
- - [`examples/vector.py`](examples/vector.py): Demonstrates how to index and search vector embeddings, including upserts.
253
+ - [`async_pubsub.py`](examples/async_pubsub.py): A demonstration of the asynchronous wrapper for the publish/subscribe system.
254
+ - [`blobs.py`](examples/blobs.py): Demonstrates how to store and retrieve binary data in the database.
255
+ - [`cache.py`](examples/cache.py): A practical example of using a dictionary with TTL as a cache for API calls.
256
+ - [`fts.py`](examples/fts.py): A detailed look at full-text search, including targeted searches on specific metadata fields.
257
+ - [`fuzzy.py`](examples/fuzzy.py): Demonstrates fuzzy search capabilities for text search.
258
+ - [`general_test.py`](examples/general_test.py): A general-purpose test to run all operations randomly which allows testing long-running processes and synchronicity issues.
259
+ - [`graph.py`](examples/graph.py): Shows how to create relationships between documents and perform multi-hop graph traversals.
260
+ - [`kvstore.py`](examples/kvstore.py): A comprehensive demo of the namespaced dictionary feature.
261
+ - [`list.py`](examples/list.py): Shows the full capabilities of the persistent list, including slicing and in-place updates.
262
+ - [`pqueue.py`](examples/pqueue.py): A practical example of using the persistent priority queue for task management.
263
+ - [`producer_consumer.py`](examples/producer_consumer.py): A demonstration of the distributed task queue system in a multi-process environment.
264
+ - [`publisher.py`](examples/publisher.py) and [`subscriber.py`](examples/subscriber.py): A pair of examples demonstrating inter-process message passing with the publish/subscribe system.
265
+ - [`pubsub.py`](examples/pubsub.py): A demonstration of the synchronous, thread-safe publish/subscribe system in a single process.
266
+ - [`rerank.py`](examples/rerank.py): Shows how to combine results from vector and text search for more refined results.
267
+ - [`stress_vectors.py`](examples/stress_vectors.py): A stress test for the vector search functionality.
268
+ - [`textual_chat.py`](examples/textual_chat.py): A chat application built with `textual` and `beaver` to illustrate the use of several primitives (lists, dicts, and channels) at the same time.
269
+ - [`type_hints.py](examples/type_hints.py): Shows how to use type hints with `beaver` to get better IDE support and type safety.
270
+ - [`vector.py`](examples/vector.py): Demonstrates how to index and search vector embeddings, including upserts.
267
271
 
268
272
  ## Roadmap
269
273
 
@@ -272,7 +276,6 @@ For more in-depth examples, check out the scripts in the `examples/` directory:
272
276
  These are some of the features and improvements planned for future releases:
273
277
 
274
278
  - **Async API**: Extend the async support with on-demand wrappers for all features besides channels.
275
- - **Type Hints**: Extend type hints for channels and documents.
276
279
 
277
280
  Check out the [roadmap](roadmap.md) for a detailed list of upcoming features and design ideas.
278
281
 
@@ -1,3 +1,4 @@
1
+ import asyncio
1
2
  import json
2
3
  import sqlite3
3
4
  import time
@@ -14,8 +15,34 @@ class QueueItem[T](NamedTuple):
14
15
  data: T
15
16
 
16
17
 
18
+ class AsyncQueueManager[T]:
19
+ """An async wrapper for the producer-consumer priority queue."""
20
+
21
+ def __init__(self, queue: "QueueManager[T]"):
22
+ self._queue = queue
23
+
24
+ async def put(self, data: T, priority: float):
25
+ """Asynchronously adds an item to the queue with a specific priority."""
26
+ await asyncio.to_thread(self._queue.put, data, priority)
27
+
28
+ @overload
29
+ async def get(self, block: Literal[True] = True, timeout: float | None = None) -> QueueItem[T]: ...
30
+ @overload
31
+ async def get(self, block: Literal[False]) -> QueueItem[T]: ...
32
+
33
+ async def get(self, block: bool = True, timeout: float | None = None) -> QueueItem[T]:
34
+ """
35
+ Asynchronously and atomically retrieves the highest-priority item.
36
+ This method will run the synchronous blocking logic in a separate thread.
37
+ """
38
+ return await asyncio.to_thread(self._queue.get, block=block, timeout=timeout)
39
+
40
+
17
41
  class QueueManager[T]:
18
- """A wrapper providing a Pythonic interface to a persistent priority queue."""
42
+ """
43
+ A wrapper providing a Pythonic interface to a persistent, multi-process
44
+ producer-consumer priority queue.
45
+ """
19
46
 
20
47
  def __init__(self, name: str, conn: sqlite3.Connection, model: Type[T] | None = None):
21
48
  self._name = name
@@ -50,19 +77,13 @@ class QueueManager[T]:
50
77
  (self._name, priority, time.time(), self._serialize(data)),
51
78
  )
52
79
 
53
- @overload
54
- def get(self, safe:Literal[True]) -> QueueItem[T] | None: ...
55
- @overload
56
- def get(self) -> QueueItem[T]: ...
57
-
58
- def get(self, safe:bool=False) -> QueueItem[T] | None:
80
+ def _get_item_atomically(self) -> QueueItem[T] | None:
59
81
  """
60
- Atomically retrieves and removes the highest-priority item from the queue.
61
- If the queue is empty, returns None if safe is True, otherwise (the default) raises IndexError.
82
+ Performs a single, atomic attempt to retrieve and remove the
83
+ highest-priority item from the queue. Returns None if the queue is empty.
62
84
  """
63
85
  with self._conn:
64
86
  cursor = self._conn.cursor()
65
- # The compound index on (queue_name, priority, timestamp) makes this query efficient.
66
87
  cursor.execute(
67
88
  """
68
89
  SELECT rowid, priority, timestamp, data
@@ -76,19 +97,61 @@ class QueueManager[T]:
76
97
  result = cursor.fetchone()
77
98
 
78
99
  if result is None:
79
- if safe:
80
- return None
81
- else:
82
- raise IndexError("No item available.")
100
+ return None
83
101
 
84
102
  rowid, priority, timestamp, data = result
85
- # Delete the retrieved item to ensure it's processed only once.
86
103
  cursor.execute("DELETE FROM beaver_priority_queues WHERE rowid = ?", (rowid,))
87
104
 
88
105
  return QueueItem(
89
106
  priority=priority, timestamp=timestamp, data=self._deserialize(data)
90
107
  )
91
108
 
109
+ @overload
110
+ def get(self, block: Literal[True] = True, timeout: float | None = None) -> QueueItem[T]: ...
111
+ @overload
112
+ def get(self, block: Literal[False]) -> QueueItem[T]: ...
113
+
114
+ def get(self, block: bool = True, timeout: float | None = None) -> QueueItem[T]:
115
+ """
116
+ Atomically retrieves and removes the highest-priority item from the queue.
117
+
118
+ This method is designed for producer-consumer patterns and can block
119
+ until an item becomes available.
120
+
121
+ Args:
122
+ block: If True (default), the method will wait until an item is available.
123
+ timeout: If `block` is True, this specifies the maximum number of seconds
124
+ to wait. If the timeout is reached, `TimeoutError` is raised.
125
+
126
+ Returns:
127
+ A `QueueItem` containing the retrieved data.
128
+
129
+ Raises:
130
+ IndexError: If `block` is False and the queue is empty.
131
+ TimeoutError: If `block` is True and the timeout expires.
132
+ """
133
+ if not block:
134
+ item = self._get_item_atomically()
135
+ if item is None:
136
+ raise IndexError("get from an empty queue.")
137
+ return item
138
+
139
+ start_time = time.time()
140
+ while True:
141
+ item = self._get_item_atomically()
142
+ if item is not None:
143
+ return item
144
+
145
+ if timeout is not None and (time.time() - start_time) > timeout:
146
+ raise TimeoutError("Timeout expired while waiting for an item.")
147
+
148
+ # Sleep for a short interval to avoid busy-waiting and consuming CPU.
149
+ time.sleep(0.1)
150
+
151
+ def as_async(self) -> "AsyncQueueManager[T]":
152
+ """Returns an async version of the queue manager."""
153
+ return AsyncQueueManager(self)
154
+
92
155
  def __len__(self) -> int:
93
156
  """Returns the current number of items in the queue."""
94
157
  cursor = self._conn.cursor()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beaver-db
3
- Version: 0.14.0
3
+ Version: 0.15.0
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
@@ -31,12 +31,13 @@ A fast, single-file, multi-modal database for Python, built with the standard `s
31
31
  - **Sync/Async High-Efficiency Pub/Sub**: A powerful, thread and process-safe publish-subscribe system for real-time messaging with a fan-out architecture. Sync by default, but with an `as_async` wrapper for async applications.
32
32
  - **Namespaced Key-Value Dictionaries**: A Pythonic, dictionary-like interface for storing any JSON-serializable object within separate namespaces with optional TTL for cache implementations.
33
33
  - **Pythonic List Management**: A fluent, Redis-like interface for managing persistent, ordered lists.
34
- - **Persistent Priority Queue**: A high-performance, persistent queue that always returns the item with the highest priority, perfect for task management.
34
+ - **Persistent Priority Queue**: A high-performance, persistent priority queue perfect for task orchestration across multiple processes. Also with optional async support.
35
35
  - **Simple Blob Storage**: A dictionary-like interface for storing medium-sized binary files (like PDFs or images) directly in the database, ensuring transactional integrity with your other data.
36
36
  - **High-Performance Vector Storage & Search**: Store vector embeddings and perform fast, crash-safe approximate nearest neighbor searches using a `faiss`-based hybrid index.
37
37
  - **Full-Text and Fuzzy Search**: Automatically index and search through document metadata using SQLite's powerful FTS5 engine, enhanced with optional fuzzy search for typo-tolerant matching.
38
38
  - **Knowledge Graph**: Create relationships between documents and traverse the graph to find neighbors or perform multi-hop walks.
39
39
  - **Single-File & Portable**: All data is stored in a single SQLite file, making it incredibly easy to move, back up, or embed in your application.
40
+ - **Optional Type-Safety:** Although the database is schemaless, you can use a minimalistic typing system for automatic serialization and deserialization that is Pydantic-compatible out of the box.
40
41
 
41
42
  ## How Beaver is Implemented
42
43
 
@@ -260,21 +261,24 @@ Basically everywhere you can store or get some object in BeaverDB, you can use a
260
261
 
261
262
  For more in-depth examples, check out the scripts in the `examples/` directory:
262
263
 
263
- - [`examples/async_pubsub.py`](examples/async_pubsub.py): A demonstration of the asynchronous wrapper for the publish/subscribe system.
264
- - [`examples/blobs.py`](examples/blobs.py): Demonstrates how to store and retrieve binary data in the database.
265
- - [`examples/cache.py`](examples/cache.py): A practical example of using a dictionary with TTL as a cache for API calls.
266
- - [`examples/fts.py`](examples/fts.py): A detailed look at full-text search, including targeted searches on specific metadata fields.
267
- - [`examples/fuzzy.py`](examples/fuzzy.py): Demonstrates fuzzy search capabilities for text search.
268
- - [`examples/general_test.py`](examples/general_test.py): A general-purpose test to run all operations randomly which allows testing long-running processes and synchronicity issues.
269
- - [`examples/graph.py`](examples/graph.py): Shows how to create relationships between documents and perform multi-hop graph traversals.
270
- - [`examples/kvstore.py`](examples/kvstore.py): A comprehensive demo of the namespaced dictionary feature.
271
- - [`examples/list.py`](examples/list.py): Shows the full capabilities of the persistent list, including slicing and in-place updates.
272
- - [`examples/publisher.py`](examples/publisher.py) and [`examples/subscriber.py`](examples/subscriber.py): A pair of examples demonstrating inter-process message passing with the publish/subscribe system.
273
- - [`examples/pubsub.py`](examples/pubsub.py): A demonstration of the synchronous, thread-safe publish/subscribe system in a single process.
274
- - [`examples/queue.py`](examples/queue.py): A practical example of using the persistent priority queue for task management.
275
- - [`examples/rerank.py`](examples/rerank.py): Shows how to combine results from vector and text search for more refined results.
276
- - [`examples/stress_vectors.py`](examples/stress_vectors.py): A stress test for the vector search functionality.
277
- - [`examples/vector.py`](examples/vector.py): Demonstrates how to index and search vector embeddings, including upserts.
264
+ - [`async_pubsub.py`](examples/async_pubsub.py): A demonstration of the asynchronous wrapper for the publish/subscribe system.
265
+ - [`blobs.py`](examples/blobs.py): Demonstrates how to store and retrieve binary data in the database.
266
+ - [`cache.py`](examples/cache.py): A practical example of using a dictionary with TTL as a cache for API calls.
267
+ - [`fts.py`](examples/fts.py): A detailed look at full-text search, including targeted searches on specific metadata fields.
268
+ - [`fuzzy.py`](examples/fuzzy.py): Demonstrates fuzzy search capabilities for text search.
269
+ - [`general_test.py`](examples/general_test.py): A general-purpose test to run all operations randomly which allows testing long-running processes and synchronicity issues.
270
+ - [`graph.py`](examples/graph.py): Shows how to create relationships between documents and perform multi-hop graph traversals.
271
+ - [`kvstore.py`](examples/kvstore.py): A comprehensive demo of the namespaced dictionary feature.
272
+ - [`list.py`](examples/list.py): Shows the full capabilities of the persistent list, including slicing and in-place updates.
273
+ - [`pqueue.py`](examples/pqueue.py): A practical example of using the persistent priority queue for task management.
274
+ - [`producer_consumer.py`](examples/producer_consumer.py): A demonstration of the distributed task queue system in a multi-process environment.
275
+ - [`publisher.py`](examples/publisher.py) and [`subscriber.py`](examples/subscriber.py): A pair of examples demonstrating inter-process message passing with the publish/subscribe system.
276
+ - [`pubsub.py`](examples/pubsub.py): A demonstration of the synchronous, thread-safe publish/subscribe system in a single process.
277
+ - [`rerank.py`](examples/rerank.py): Shows how to combine results from vector and text search for more refined results.
278
+ - [`stress_vectors.py`](examples/stress_vectors.py): A stress test for the vector search functionality.
279
+ - [`textual_chat.py`](examples/textual_chat.py): A chat application built with `textual` and `beaver` to illustrate the use of several primitives (lists, dicts, and channels) at the same time.
280
+ - [`type_hints.py](examples/type_hints.py): Shows how to use type hints with `beaver` to get better IDE support and type safety.
281
+ - [`vector.py`](examples/vector.py): Demonstrates how to index and search vector embeddings, including upserts.
278
282
 
279
283
  ## Roadmap
280
284
 
@@ -283,7 +287,6 @@ For more in-depth examples, check out the scripts in the `examples/` directory:
283
287
  These are some of the features and improvements planned for future releases:
284
288
 
285
289
  - **Async API**: Extend the async support with on-demand wrappers for all features besides channels.
286
- - **Type Hints**: Extend type hints for channels and documents.
287
290
 
288
291
  Check out the [roadmap](roadmap.md) for a detailed list of upcoming features and design ideas.
289
292
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "beaver-db"
3
- version = "0.14.0"
3
+ version = "0.15.0"
4
4
  description = "Fast, embedded, and multi-modal DB based on SQLite for AI-powered applications."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
@@ -11,3 +11,8 @@ dependencies = [
11
11
 
12
12
  [tool.hatch.build.targets.wheel]
13
13
  packages = ["beaver"]
14
+
15
+ [dependency-groups]
16
+ dev = [
17
+ "textual>=6.1.0",
18
+ ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes