nodestream-plugin-neo4j


Namenodestream-plugin-neo4j JSON
Version 0.12.2 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2024-04-22 17:47:40
maintainerNone
docs_urlNone
authorZach Probst
requires_python<4.0,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Neo4j Nodestream Plugin for Nodestream

This plugin provides a [Nodestream](https://github.com/nodestream-proj/nodestream) interface to Neo4j. 

## Installation

```bash
pip install nodestream-plugin-neo4j
```

## Usage

```yaml
# nodestream.yaml
targets:
  neo4j:
    database: neo4j
    uri: bolt://localhost:7687
    username: neo4j
    password: neo4j
    database_name: neo4j # optional; name of the database to use.
    use_enterprise_features: false # optional; use enterprise features (e.g. node key constraints)
```

### Extractor 

The `Neo4jExtractor` class represents an extractor that reads records from a Neo4j database. It takes a single Cypher query as
input and yields the records read from the database. The extractor will automatically paginate through the database until it reaches the end. Therefore, the query needs to include a `SKIP` and `LIMIT` clause. For example:

```yaml
- implementation: nodestream_plugin_neo4j.extractor:Neo4jExtractor
  arguments:
    query: MATCH (p:Person) WHERE p.name = $name RETURN p.name SKIP $offset LIMIT $limit
    uri: bolt://localhost:7687
    username: neo4j
    password: neo4j
    database_name: my_database # Optional; defaults to neo4j
    limit: 100000 # Optional; defaults to 100
    parameters:
      # Optional; defaults to {}
      # Any parameters to be passed to the query
      # For example, if you want to pass a parameter called "name" with the value "John Doe", you would do this:
      name: John Doe
```

The extractor will automatically add the `SKIP` and `LIMIT` clauses to the query. The extractor will also automatically add the `offset` and `limit` parameters to the query. The extractor will start with `offset` set to `0` and `limit` set to `100` (unless overridden by setting `limit`) The extractor will continue to paginate through the database until the query returns no results. 

## Concepts 

### Migrations 

The plugin supports migrations. Migrations are used to create indexes and constraints on the database. 

As part of the migration process, the plugin will create  `__NodestreamMigration__` nodes in the database. 
This node will have a `name` property that is set to the name of the migration. 

Additionally, the plugin will create a `__NodestreamMigrationLock__` node in the database. 
This node will be exit when the migration process is running and will be deleted when the migration process is complete.
This is used to prevent multiple migration processes from running at the same time.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nodestream-plugin-neo4j",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Zach Probst",
    "author_email": "Zach_Probst@intuit.com",
    "download_url": "https://files.pythonhosted.org/packages/af/d8/6a754312169cd949755294be4eda441fa65cec7463c614f0b6f595cfd5cd/nodestream_plugin_neo4j-0.12.2.tar.gz",
    "platform": null,
    "description": "# Neo4j Nodestream Plugin for Nodestream\n\nThis plugin provides a [Nodestream](https://github.com/nodestream-proj/nodestream) interface to Neo4j. \n\n## Installation\n\n```bash\npip install nodestream-plugin-neo4j\n```\n\n## Usage\n\n```yaml\n# nodestream.yaml\ntargets:\n  neo4j:\n    database: neo4j\n    uri: bolt://localhost:7687\n    username: neo4j\n    password: neo4j\n    database_name: neo4j # optional; name of the database to use.\n    use_enterprise_features: false # optional; use enterprise features (e.g. node key constraints)\n```\n\n### Extractor \n\nThe `Neo4jExtractor` class represents an extractor that reads records from a Neo4j database. It takes a single Cypher query as\ninput and yields the records read from the database. The extractor will automatically paginate through the database until it reaches the end. Therefore, the query needs to include a `SKIP` and `LIMIT` clause. For example:\n\n```yaml\n- implementation: nodestream_plugin_neo4j.extractor:Neo4jExtractor\n  arguments:\n    query: MATCH (p:Person) WHERE p.name = $name RETURN p.name SKIP $offset LIMIT $limit\n    uri: bolt://localhost:7687\n    username: neo4j\n    password: neo4j\n    database_name: my_database # Optional; defaults to neo4j\n    limit: 100000 # Optional; defaults to 100\n    parameters:\n      # Optional; defaults to {}\n      # Any parameters to be passed to the query\n      # For example, if you want to pass a parameter called \"name\" with the value \"John Doe\", you would do this:\n      name: John Doe\n```\n\nThe extractor will automatically add the `SKIP` and `LIMIT` clauses to the query. The extractor will also automatically add the `offset` and `limit` parameters to the query. The extractor will start with `offset` set to `0` and `limit` set to `100` (unless overridden by setting `limit`) The extractor will continue to paginate through the database until the query returns no results. \n\n## Concepts \n\n### Migrations \n\nThe plugin supports migrations. Migrations are used to create indexes and constraints on the database. \n\nAs part of the migration process, the plugin will create  `__NodestreamMigration__` nodes in the database. \nThis node will have a `name` property that is set to the name of the migration. \n\nAdditionally, the plugin will create a `__NodestreamMigrationLock__` node in the database. \nThis node will be exit when the migration process is running and will be deleted when the migration process is complete.\nThis is used to prevent multiple migration processes from running at the same time.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "0.12.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ba1c9cfa057c9d3a52c0e2eda51f4dabdca854f5c5fa36579593626b8122515",
                "md5": "8d321123e5ca1dcedc535dc8249fe30a",
                "sha256": "abc0784484721601e8c3948187673128ecc7bbec161e2350c771b4bbb3907bb0"
            },
            "downloads": -1,
            "filename": "nodestream_plugin_neo4j-0.12.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8d321123e5ca1dcedc535dc8249fe30a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 13622,
            "upload_time": "2024-04-22T17:47:32",
            "upload_time_iso_8601": "2024-04-22T17:47:32.340688Z",
            "url": "https://files.pythonhosted.org/packages/1b/a1/c9cfa057c9d3a52c0e2eda51f4dabdca854f5c5fa36579593626b8122515/nodestream_plugin_neo4j-0.12.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "afd86a754312169cd949755294be4eda441fa65cec7463c614f0b6f595cfd5cd",
                "md5": "284d961b050309e92da8745c66ca8b2b",
                "sha256": "27c552ed323189526865c8d86a5f784c0ffa31cf03f6c67f2710ca6e6f63a67b"
            },
            "downloads": -1,
            "filename": "nodestream_plugin_neo4j-0.12.2.tar.gz",
            "has_sig": false,
            "md5_digest": "284d961b050309e92da8745c66ca8b2b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 11212,
            "upload_time": "2024-04-22T17:47:40",
            "upload_time_iso_8601": "2024-04-22T17:47:40.399924Z",
            "url": "https://files.pythonhosted.org/packages/af/d8/6a754312169cd949755294be4eda441fa65cec7463c614f0b6f595cfd5cd/nodestream_plugin_neo4j-0.12.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 17:47:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "nodestream-plugin-neo4j"
}
        
Elapsed time: 0.22782s