Skip to content

Commit 4bd1f38

Browse files
authored
chore: rename package to jsonlt-python (#5)
1 parent f7fc709 commit 4bd1f38

4 files changed

Lines changed: 42 additions & 48 deletions

File tree

README.md

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -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

133133
The `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

153153
The `Table` class also supports idiomatic Python operations:
154154

@@ -160,37 +160,28 @@ The `Table` class also supports idiomatic Python operations:
160160

161161
The `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

174174
All 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

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["uv_build>=0.9.11,<0.10.0"]
33
build-backend = "uv_build"
44

55
[project]
6-
name = "jsonlt"
6+
name = "jsonlt-python"
77
version = "0.0.0"
88
description = "A library for using a JSON Lines (JSONL) file as a lightweight database."
99
readme = "README.md"
@@ -172,3 +172,6 @@ ignore-variadic-names = true
172172
"S101", # assert statements in tests
173173
"PLR2004", # magic values in assertions in tests
174174
]
175+
176+
[tool.uv.build-backend]
177+
module-name = "jsonlt"

src/jsonlt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from ._table import Table
1919
from ._transaction import Transaction
2020

21-
__version__ = version("jsonlt")
21+
__version__ = version("jsonlt-python")
2222

2323
__all__ = [
2424
"ConflictError",

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)