Metadata-Version: 2.4
Name: pylpg
Version: 0.2.3
Summary: A Python Object Graph Mapper for labeled property graph databases
Project-URL: Homepage, https://github.com/rougny/pylpg
Project-URL: Issues, https://github.com/rougny/pylpg/issues
Author-email: Adrien Rougny <adrienrougny@gmail.com>
License: GPL-3.0-or-later
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: falkordb>=1.0; extra == 'all'
Requires-Dist: neo4j>=5.0; extra == 'all'
Provides-Extra: falkordb
Requires-Dist: falkordb>=1.0; extra == 'falkordb'
Provides-Extra: falkordblite
Requires-Dist: falkordblite>=0.1; (python_version >= '3.12') and extra == 'falkordblite'
Provides-Extra: neo4j
Requires-Dist: neo4j>=5.0; extra == 'neo4j'
Description-Content-Type: text/markdown

# pylpg

A Python Object Graph Mapper for labeled property graph databases.

## Features

- Simple model definition using Python type annotations
- Multi-backend: Neo4j, FalkorDB, FalkorDBLite (embedded)
- Session-based persistence with node binding
- Transactional batch operations (Neo4j)
- Node hydration from raw query results

## Installation

```bash
pip install pylpg[neo4j]        # Neo4j
pip install pylpg[falkordb]     # FalkorDB
pip install pylpg[falkordblite] # FalkorDBLite (embedded, no server)
```

## Quick example

```python
import pylpg.node
import pylpg.relationship
import pylpg.session
import pylpg.backend.neo4j

class Person(pylpg.node.Node):
    name: str
    age: int | None = None

class Knows(pylpg.relationship.Relationship):
    __type__ = "KNOWS"
    since: str | None = None

backend = pylpg.backend.neo4j.Neo4jBackend(
    hostname="localhost",
    username="neo4j",
    password="password",
)

with pylpg.session.Session(backend) as session:
    alice = Person(name="Alice", age=30)
    bob = Person(name="Bob")
    session.save(alice)
    session.save(bob)

    rel = Knows(source=alice, target=bob, since="2024")
    session.save(rel)
```

## Documentation

Full documentation is available at [https://adrienrougny.github.io/pylpg/](https://adrienrougny.github.io/pylpg/).

## License

GPLv3. See [LICENSE](LICENSE) for details.
