Metadata-Version: 2.4
Name: pigeonhole-db
Version: 1.2.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: Typing :: Typed
Requires-Dist: pyarrow>=18 ; extra == 'arrow'
Provides-Extra: arrow
License-File: LICENSE
Summary: Pigeonhole: an embedded, single-file, wide-column store (BigTable's data model, SQLite's deployment).
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/CodingAnarchy/pigeonhole/blob/main/docs/guide/python.md
Project-URL: Repository, https://github.com/CodingAnarchy/pigeonhole

# pigeonhole-db

Python bindings for [Pigeonhole](https://github.com/CodingAnarchy/pigeonhole): an embedded, single-file, wide-column store, with BigTable's data model and SQLite's deployment model. The bindings are built with PyO3 directly over the Rust crate, and every engine call releases the GIL.

```python
import pigeonhole as ph

with ph.open("app.phdb", create=True) as db:
    users = (db.table("users")
               .family("profile")
               .family("stats", ph.Family.counter())
               .create_if_missing())

    users.mutate(b"u1").put("profile", b"name", "Ada").incr("stats", b"logins", 1).commit()
    print(users.get(b"u1", "profile", b"name").value)        # b'Ada'

    for row in users.scan(prefix=b"u"):
        for family, qualifier, cell in row:
            print(row.key, family, qualifier, cell.typed)

    def bump(txn):                                           # retried on Conflict
        n = txn.get(users, b"u1", "stats", b"logins").as_int()
        txn.put(users, b"u1", "profile", b"logins_seen", n)
    db.transact(bump)
```

- **Requirements:** CPython 3.11 or later. One abi3 wheel per platform: Linux (manylinux and musllinux, x86_64 and aarch64), macOS (universal2) and Windows (x86_64).
- **Typed:** the package ships stubs and `py.typed`.
- **Also covered:** vector families (writes take NumPy arrays), multi-get, graph traversal, and walking wide rows in pages. The [Python guide](https://github.com/CodingAnarchy/pigeonhole/blob/main/docs/guide/python.md) covers them.
- **Processes:** one writer process per database, and any number of readers through `ph.open_reader(path)`.
- **`fork`:** a forked child can't use handles it inherited. Open databases inside each `multiprocessing` worker, or use the `spawn` or `forkserver` start method.

**Status:** new in 1.1.0 (#696). The package's version is the `pigeonhole` crate's.

