Skip to main content

A Python Object Graph Mapper for labeled property graph databases

Project description

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

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

Quick example

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/.

License

GPLv3. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylpg-0.2.0.tar.gz (90.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylpg-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file pylpg-0.2.0.tar.gz.

File metadata

  • Download URL: pylpg-0.2.0.tar.gz
  • Upload date:
  • Size: 90.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylpg-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9313f0dc9f30ec905447c8cd4beafca55111695e960fce1d7b8399e03a17dfd2
MD5 b9c13ca3d971cd1863db0e37eafb80f3
BLAKE2b-256 52a658f1aabf17e6b161b3f24ead44d8a0d37bb2d312fc61bcf2125d7c9f8cc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylpg-0.2.0.tar.gz:

Publisher: release.yml on adrienrougny/pylpg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylpg-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pylpg-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pylpg-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86f127e3da6d27e3892231d8570c4af282672b62821251380227d3b8e474bad8
MD5 d6f53f269bf55594415e06afab10068f
BLAKE2b-256 873ea7620faecc57ab2a5f9bbef8e49b0c94bf0e9a87de06a67b7aedf385aacc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylpg-0.2.0-py3-none-any.whl:

Publisher: release.yml on adrienrougny/pylpg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page