Metadata-Version: 2.4
Name: swindl
Version: 3.2.0
Summary: Seecr Web Index and Database Lib: objects in JSON files, searchable, with crash-safe transactions
Author-email: Thijs Janssen <thijs@seecr.nl>, Johan Jonkers <johan@seecr.nl>
License-Expression: MIT
Project-URL: Homepage, https://swindl.seecr.nl/
Project-URL: Documentation, https://swindl.seecr.nl/reference/
Project-URL: Source, https://github.com/seecr/swindl
Project-URL: Issues, https://github.com/seecr/swindl/issues
Project-URL: Changelog, https://github.com/seecr/swindl/blob/master/CHANGELOG.md
Keywords: storage,search,index,json,transactions,oai-pmh,forms,seecr
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: POSIX
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database
Classifier: Topic :: Text Processing :: Indexing
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lxml<7,>=6.1.3
Requires-Dist: pytest<10,>=9.2.0
Requires-Dist: pytest-asyncio<2,>=1.5.0
Requires-Dist: pytest-xdist<4,>=3.8.0
Requires-Dist: seecr-sil<4,>=3.4.0
Requires-Dist: seecr-stdlib<1,>=0.7.0
Requires-Dist: sjdbl<1,>=0.6.0
Requires-Dist: tantivy<1,>=0.27.0
Dynamic: license-file

# swindl – Seecr Web Index and Database Lib

[![Tests](https://github.com/seecr/swindl/actions/workflows/test.yml/badge.svg)](https://github.com/seecr/swindl/actions/workflows/test.yml)
[![PyPI](https://img.shields.io/pypi/v/swindl.svg)](https://pypi.org/project/swindl/)

The storage side of an [SWL](https://github.com/seecr/swl) application: objects in
[sjdbl](https://github.com/seecr/sjdbl)'s JSON files, searchable through
[sil](https://github.com/seecr/sil)'s index, as one `Store`; and the WebAdapter, which
converts and checks what comes in from a web form.

```python
from sjdbl.field import Field
from swindl.store import Base, Store
from swindl.webadapter import Adapt, from_form

class Person(Base):
    FIELDS = [Field.str("name"), Field.date("dob")]
    ADAPTATIONS = [Adapt.date("dob")]

store = Store(data_dir, [Person])
person = store.create(Person, from_form(Person, form, ["name", "dob"]))

with store.transaction():          # stored and indexed together, or not at all
    store.put(person, invoice)
    store.delete(basket)
```

Crash safe: a transaction is in the files completely or not at all, and the index
catches up when the store is opened again. `swindl-check` tells whether the index
matches the files.

Install with `pip install swindl`. It needs Python 3.11 or newer; sjdbl, sil
(`seecr-sil`) and their dependencies come with it.

- [swindl.seecr.nl](https://swindl.seecr.nl/): the website, with the references of
  swindl, sjdbl and sil online and as PDFs.
- [reference](https://github.com/seecr/swindl/blob/master/doc/reference.md): everything.
- [guarantees](https://github.com/seecr/swindl/blob/master/doc/guarantees.md): what is
  promised, what not, the limits, backups.
- [WebAdapter](https://github.com/seecr/swindl/blob/master/doc/webadapter.md): the
  WebAdapter in full.
- [examples](https://github.com/seecr/swindl/tree/master/examples): runnable examples,
  and [examples/collection](https://github.com/seecr/swindl/tree/master/examples/collection):
  an application to keep track of a record (or LEGO) collection, built on SWL and swindl.
- [changelog](https://github.com/seecr/swindl/blob/master/CHANGELOG.md): what changed,
  and how to upgrade.

MIT licensed, see [LICENSE](https://github.com/seecr/swindl/blob/master/LICENSE). By
[Seecr](https://seecr.nl).
