semvec/pypi-packages huggingface dataset:
pybraflog 0.1.3
Brainstorming package to manage logs in txt file
License: MIT
Requires Python: <4.0,>=3.10

# pybraflog Readme 📜
Brainstorming package to manage logs in txt file

# Installation ⚡
Opérating system :  Windows, MacOS & Linux :

# Available function/class 📑
## FileLog
### to create => FileLog(afilename, adeffolder)
    adeffolder : folder to write file. if not exist or empty error.
    afilename  : the file name to write.
### to open log => openlog
    Open the log file.
### to write info in log => writeLog(alog, anbrident)
    alog : a line to add in file log. wothout add \n at the end to CRLF.
    anbrident : to define indentation, number of space to add before alog, by default 0.
### to clear log => clearoldlog(aretentionday)
    to erase all log old than aretentionday, by default 15 days(optional).
    You need to do when the filelog is open.
### to close log => closelog()
    Close the log file.
## Log
### to create => Log()
### properties
    value : for log in one line.
    valuelst : for log in more lines.
### to clear all logs -> clear(self)
    clear clear log list and log str
### to count log => count(self)
    return the number of element in Valuelst
### tostring(self, acharsep)
    get value list in string seperated by acharsep (by default acharsep = '\n\r')
### get a log tag => getlogtag(self, asep)
    return a log tag formated %Y-%m-%d %H:%M:%S with asep at the end (by default asep = '')

# Howto use 📰
    import os
    import pybraflog
    import pybrafile

    flog = pybraflog.FileLog('testlog.txt', '')
    if flog.iserror:
        print(flog.error)

    flog = pybraflog.FileLog('testlog.txt', os.getcwd())    
    flog.openlog()

    flog.writeLog('first line')
    flog.writeLog('first line indent', 10)
    flog.writeLog('two line')
    
    flog.closelog()
    
    file = pybrafile.FileUtils('testlog.txt')
    file.openfile('r')
    txt = file.readfile()
    file.close()

    print(txt)
    print(pybraflog.version())

    print(txt)
    print(pybraflog.version())

    lstlog = pybraflog.Log()
    lstlog.Valuelst = lstlog.getlogtag(' - ') + 'Line 1'
    lstlog.Valuelst = lstlog.getlogtag(' _ ') + 'Line 2'
    lstlog.Valuelst = lstlog.getlogtag(' # ') + 'Line 3'
    lstlog.Valuelst = lstlog.getlogtag() + 'Line 4'

    print('Nbr element(s) in value list :' + str(lstlog.count()))
    print('Value lsit :\r\n' + lstlog.tostring())

## Meta 💬
Brainstorming – Support.erp@brainstorming.eu

Distributed under the MIT license. See ``LICENSE`` for more information.
pydantic-graph-neo4j-persistence 0.1.6
Neo4j persistence adapter for Pydantic Graph
License: MIT
Requires Python: >=3.9


# Pydantic Graph - Neo4j Persistence

[![PyPI Version](https://badge.fury.io/py/pydantic-graph-neo4j-persistence.svg)](https://pypi.org/project/pydantic-graph-neo4j-persistence/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## 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:

```bash
pip install pydantic_graph_neo4j_persistence
```
# Quick Start

Here is a basic example demonstrating how to use pydantic_graph.neo4j_persistence:

```python
from pydantic_graph_neo4j_persistence import Neo4jStatePersistence

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](https://ai.pydantic.dev/examples/question-graph/). From there just change the persistence variable to use the `Neo4jStatePersistence`

# Nodes and Relationships
The Neo4jStatePersistence uses and require the following Nodes: 
- NodeSnapshot
- EndSnapshot
- Execution

And the following relationship:
- HAS_SNAPSHOT

(e:Execution) ->[:HAS_SNAPSHOT]->(n:NodeSnapshot)

(e:Execution) ->[:HAS_SNAPSHOT]->(n:EndSnapshot)


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