Skip to main content

Decorators do use py2neo library like Spring Data annotations

Project description

# Neo4j Decorator Driver for Python

> All annotations assumes class methods as decorated sources.

## Database connection

Call Neo4j class and setup the connection

```
from neo4jdecorators.db import Neo4j

...

Neo4j.initialize(host, username, password)
```

## Query Decorator Signature

```
from neo4jdecorators.query import Query

...

@Query([cypher statement], asTable=False)
def method_name(...):
...
```

* __asTable__: If true, the method will get the result parameter as a DataFrame Pandas object

## Transactional Decorator Signature

```
from neo4jdecorators.query import Query

...

@Transactional
def method_name(...):
...
```

## Minimum query decorated method signagure

```
def method_name(self, result, *args):
...
```

### Extra args passed could be

* __tx__: A transaction to be used (could be the one injected with Transactional decorator)
* __parameters__: A dictionary with statement parameters

## Minimum Transactional decorated method signature

```
def method_name(self, tx):
...
```

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

neo4j-decorators-1.2.tar.gz (1.8 kB view hashes)

Uploaded Source

Supported by

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