@@ -18,11 +18,11 @@ JSONLT is a data format for storing keyed records in append-only files using [JS
1818## Installation
1919
2020``` bash
21- pip install jsonlt
21+ pip install jsonlt-python
2222
2323# Or
2424
25- uv add jsonlt
25+ uv add jsonlt-python
2626```
2727
2828## Quick start
@@ -132,23 +132,23 @@ table.clear()
132132
133133The ` Table ` class is the primary interface for working with JSONLT files.
134134
135- | Method | Description |
136- | ------ | ----------- |
137- | ` Table(path, key) ` | Open or create a table at the given path |
138- | ` get(key) ` | Get a record by key, returns ` None ` if not found |
139- | ` has(key) ` | Check if a key exists |
140- | ` put(record) ` | Insert or update a record |
141- | ` delete(key) ` | Delete a record, returns whether it existed |
142- | ` all() ` | Get all records in key order |
143- | ` keys() ` | Get all keys in key order |
144- | ` items() ` | Get all (key, record) pairs in key order |
145- | ` count() ` | Get the number of records |
146- | ` find(predicate, limit=None) ` | Find records matching a predicate |
147- | ` find_one(predicate) ` | Find the first matching record |
148- | ` transaction() ` | Start a new transaction |
149- | ` compact() ` | Compact the table file |
150- | ` clear() ` | Remove all records |
151- | ` reload() ` | Force reload from disk |
135+ | Method | Description |
136+ | ------------------------------- | -------------------------------------------------- |
137+ | ` Table(path, key) ` | Open or create a table at the given path |
138+ | ` get(key) ` | Get a record by key, returns ` None ` if not found |
139+ | ` has(key) ` | Check if a key exists |
140+ | ` put(record) ` | Insert or update a record |
141+ | ` delete(key) ` | Delete a record, returns whether it existed |
142+ | ` all() ` | Get all records in key order |
143+ | ` keys() ` | Get all keys in key order |
144+ | ` items() ` | Get all (key, record) pairs in key order |
145+ | ` count() ` | Get the number of records |
146+ | ` find(predicate, limit=None) ` | Find records matching a predicate |
147+ | ` find_one(predicate) ` | Find the first matching record |
148+ | ` transaction() ` | Start a new transaction |
149+ | ` compact() ` | Compact the table file |
150+ | ` clear() ` | Remove all records |
151+ | ` reload() ` | Force reload from disk |
152152
153153The ` Table ` class also supports idiomatic Python operations:
154154
@@ -160,37 +160,28 @@ The `Table` class also supports idiomatic Python operations:
160160
161161The ` Transaction ` class provides snapshot isolation and buffered writes.
162162
163- | Method | Description |
164- | ------ | ----------- |
165- | ` get(key) ` | Get a record from the transaction snapshot |
166- | ` has(key) ` | Check if a key exists in the snapshot |
167- | ` put(record) ` | Buffer a record for commit |
168- | ` delete(key) ` | Buffer a deletion for commit |
169- | ` commit() ` | Write buffered changes to disk |
170- | ` abort() ` | Discard buffered changes |
163+ | Method | Description |
164+ | --------------- | -------------------------------------------- |
165+ | ` get(key) ` | Get a record from the transaction snapshot |
166+ | ` has(key) ` | Check if a key exists in the snapshot |
167+ | ` put(record) ` | Buffer a record for commit |
168+ | ` delete(key) ` | Buffer a deletion for commit |
169+ | ` commit() ` | Write buffered changes to disk |
170+ | ` abort() ` | Discard buffered changes |
171171
172172### Exception hierarchy
173173
174174All exceptions inherit from ` JSONLTError ` :
175175
176- | Exception | Description |
177- | --------- | ----------- |
178- | ` ParseError ` | Invalid file format or content |
179- | ` InvalidKeyError ` | Invalid or missing key |
180- | ` FileError ` | File I/O error |
181- | ` LockError ` | Cannot obtain file lock |
182- | ` LimitError ` | Size limit exceeded |
183- | ` TransactionError ` | Transaction state error |
184- | ` ConflictError ` | Write-write conflict detected |
185-
186- ### Type exports
187-
188- For type annotations, the package exports:
189-
190- - ` Key ` - A key value (` str ` , ` int ` , or tuple of these)
191- - ` KeySpecifier ` - Key field names (single or multiple)
192- - ` JSONObject ` - A JSON object (` dict[str, Any] ` )
193- - ` Header ` - Table header data class
176+ | Exception | Description |
177+ | --------------------| --------------------------------|
178+ | ` ParseError ` | Invalid file format or content |
179+ | ` InvalidKeyError ` | Invalid or missing key |
180+ | ` FileError ` | File I/O error |
181+ | ` LockError ` | Cannot obtain file lock |
182+ | ` LimitError ` | Size limit exceeded |
183+ | ` TransactionError ` | Transaction state error |
184+ | ` ConflictError ` | Write-write conflict detected |
194185
195186## Documentation
196187
0 commit comments