It's a python package that allows you to convert pandas dataframe into Cypher insert queries. It gives you a way to specify your record linking algorithms for determining edges and setting attributes.
Project description
Graphpanda 🛠
Graphpanda is a python package that allows you to convert pandas dataframe into Cypher insert queries. It gives you a way to specify your record linking algorithms for determining edges and setting attributes.
Who should use it?
Anyone who is analyzing data in python using pandas and wants to have a way to analyze it with cypher in a graph database.
Installation
Use the package manager pip to install graphpanda.
pip install -e path_to_graphpanda
Usage
df = pd.DataFrame(data=[
{"c1": 1, "c2": 2, "c3": "wow"},
{"c1": 1, "c2": 2, "c3": "wow"},
{"c1": 1, "c2": 2, "c3": "wow"},
])
df2 = pd.DataFrame(data=[
{"d1": 1},
{"d1": 2},
{"d1": 3},
])
domain1 = form_node_domain(df, ("TestNode", ["c2"]))
domain2 = form_node_domain(df2, ("Node2", ["d1"]))
get_selection_func1 = domain1.get_selection_function(["c2"])
get_selection_func2 = domain2.get_selection_function(["d1"])
exact_match_one_field = exact_match(
get_selection_func1, get_selection_func2)
graph = form_edges(domain1, domain2, exact_match_one_field)
cypher_graph = CypherGraph(graph)
out = cypher_graph.get_create_statements()
print(out)
CREATE (node_339606590492800375:Node2 {d1:2})
CREATE (node_4387139851793128730:Node2 {d1:1})
CREATE (node_4180099955292202157:Node2 {d1:3})
CREATE (node_5208008065052232978:TestNode {c2:2})
CREATE
(node_5208008065052232978)-[:EXACT_MATCH {}]->(node_339606590492800375)
Contributing 💓
Pull requests are welcome. For significant changes, please open an issue first to discuss what you would like to change. Please make sure to update the tests as appropriate. It would be nice to ask @Bobrinik before to make sure that we follow the same guidelines and vision.
Future work
- Add more record linking functions:
License
Project details
Release history Release notifications | RSS feed
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 graphpanda-0.1.0.tar.gz.
File metadata
- Download URL: graphpanda-0.1.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
245e6c0103e1205a9c10a33cdd39e0875f02ec471d5d122000bd9fef37252e02
|
|
| MD5 |
500528101b85b90564a35885f726f0a1
|
|
| BLAKE2b-256 |
b003d6631cc8a7ef8d3a7a07758a22ce00a244394ea3635d469bb5243adc0ac9
|
File details
Details for the file graphpanda-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: graphpanda-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.6.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13f1f2d1d320b200e0db74eb432b66ba6374e6584f8000251f4fab16e99bf99c
|
|
| MD5 |
098a4995527c9ce2614021e0c87b932d
|
|
| BLAKE2b-256 |
037b3020c60a91939a7ac634abae234a7f3562401c3f342694cf0d47abc2a526
|