Neo4j persistence adapter for Pydantic Graph
Project description
pydantic_graph.neo4j_persistence
Overview
pydantic_graph.neo4j_persistence is a persistence adapter for Neo4j that seamlessly integrates with Pydantic models. It enables saving node snapshots directly into a Neo4j database, facilitating efficient graph data management within Python applications.
Features
- Seamless Integration: Effortlessly combine Pydantic's data validation with Neo4j's graph database capabilities.
- Automatic Snapshotting: Automatically persist node states to Neo4j, ensuring data consistency.
- Flexible Configuration: Tailor the persistence layer to fit various application architectures.
Installation
To install pydantic_graph.neo4j_persistence, use pip:
pip install pydantic-graph-neo4j-persistence
Quick Start
Here is a basic example demonstrating how to use pydantic_graph.neo4j_persistence:
async def run_as_cli(answer: str | None):
persistence = Neo4jStatePersistence(
uri="your_uri",
username="your_username",
password="your_password",
execution_id="execution_id",
verbose=False
)
persistence.set_graph_types(my_pydantic_graph)
...
if __name__ == '__main__':
import asyncio
import sys
a = sys.argv[2] if len(sys.argv) > 2 else None
asyncio.run(run_as_cli(a))
You can see a full example on the oficial pydantic documentation. From there just change the persistence variable to use the Neo4jStatePersistence
Contributing
We welcome contributions to enhance the functionality and usability of pydantic_graph.neo4j_persistence. To contribute:
Fork the repository.
Create a new branch for your feature or bug fix.
Ensure existing tests pass and add new tests for your changes.
Submit a pull request detailing your changes and the problem they address.
License
pydantic_graph.neo4j_persistence is licensed under the MIT License. See the LICENSE file 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydantic_graph_neo4j_persistence-0.1.0.tar.gz.
File metadata
- Download URL: pydantic_graph_neo4j_persistence-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7320e4dd54369156c04fbc90eca57c8867e0863e679baf99ca4e62ea2f601f7
|
|
| MD5 |
f229c2d3c380712f87b99d12a01dc5d7
|
|
| BLAKE2b-256 |
7dad719875eebf41aa8513259a423f8c1848791fdad37ef24faeaf87fcd4fdfe
|
File details
Details for the file pydantic_graph_neo4j_persistence-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pydantic_graph_neo4j_persistence-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
deafed7fc09c57017f77b51e94e74e31fa9a848edc65ea72c3a5465ba35406ce
|
|
| MD5 |
c9efa23f60002f73c0ee5e4f947f5dd5
|
|
| BLAKE2b-256 |
520fcacb8ba9b1a51972aa6530d13bddb1f15d88b8be31592d50ef442c026bb8
|