graflo 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of graflo might be problematic. Click here for more details.

Files changed (45) hide show
  1. graflo/README.md +18 -0
  2. graflo/__init__.py +39 -0
  3. graflo/architecture/__init__.py +37 -0
  4. graflo/architecture/actor.py +974 -0
  5. graflo/architecture/actor_util.py +425 -0
  6. graflo/architecture/edge.py +295 -0
  7. graflo/architecture/onto.py +374 -0
  8. graflo/architecture/resource.py +161 -0
  9. graflo/architecture/schema.py +136 -0
  10. graflo/architecture/transform.py +292 -0
  11. graflo/architecture/util.py +93 -0
  12. graflo/architecture/vertex.py +277 -0
  13. graflo/caster.py +409 -0
  14. graflo/cli/__init__.py +14 -0
  15. graflo/cli/ingest.py +144 -0
  16. graflo/cli/manage_dbs.py +193 -0
  17. graflo/cli/plot_schema.py +132 -0
  18. graflo/cli/xml2json.py +93 -0
  19. graflo/db/__init__.py +32 -0
  20. graflo/db/arango/__init__.py +16 -0
  21. graflo/db/arango/conn.py +734 -0
  22. graflo/db/arango/query.py +180 -0
  23. graflo/db/arango/util.py +88 -0
  24. graflo/db/connection.py +304 -0
  25. graflo/db/manager.py +104 -0
  26. graflo/db/neo4j/__init__.py +16 -0
  27. graflo/db/neo4j/conn.py +432 -0
  28. graflo/db/util.py +49 -0
  29. graflo/filter/__init__.py +21 -0
  30. graflo/filter/onto.py +400 -0
  31. graflo/logging.conf +22 -0
  32. graflo/onto.py +186 -0
  33. graflo/plot/__init__.py +17 -0
  34. graflo/plot/plotter.py +556 -0
  35. graflo/util/__init__.py +23 -0
  36. graflo/util/chunker.py +739 -0
  37. graflo/util/merge.py +148 -0
  38. graflo/util/misc.py +37 -0
  39. graflo/util/onto.py +63 -0
  40. graflo/util/transform.py +406 -0
  41. graflo-1.1.0.dist-info/METADATA +157 -0
  42. graflo-1.1.0.dist-info/RECORD +45 -0
  43. graflo-1.1.0.dist-info/WHEEL +4 -0
  44. graflo-1.1.0.dist-info/entry_points.txt +5 -0
  45. graflo-1.1.0.dist-info/licenses/LICENSE +126 -0
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: graflo
3
+ Version: 1.1.0
4
+ Summary: (!) Deprecated: this package has been renamed to GraFlo. A framework for transforming tabular (CSV, SQL) and hierarchical data (JSON, XML) into property graphs and ingesting them into graph databases (ArangoDB, Neo4j)
5
+ Author-email: Alexander Belikov <alexander@growgraph.dev>
6
+ License-File: LICENSE
7
+ Requires-Python: ~=3.11.0
8
+ Requires-Dist: click<9,>=8.2.0
9
+ Requires-Dist: ijson<4,>=3.2.3
10
+ Requires-Dist: neo4j<6,>=5.22.0
11
+ Requires-Dist: networkx~=3.3
12
+ Requires-Dist: pandas-stubs==2.3.0.250703
13
+ Requires-Dist: pandas<3,>=2.0.3
14
+ Requires-Dist: python-arango<9,>=8.1.2
15
+ Requires-Dist: suthing<0.5,>=0.4.1
16
+ Requires-Dist: xmltodict<0.15,>=0.14.2
17
+ Description-Content-Type: text/markdown
18
+
19
+ # GraFlo <img src="https://raw.githubusercontent.com/growgraph/graflo/main/docs/assets/favicon.ico" alt="graflo logo" style="height: 32px; width:32px;"/>
20
+
21
+ A framework for transforming **tabular** (CSV, SQL) and **hierarchical** data (JSON, XML) into property graphs and ingesting them into graph databases (ArangoDB, Neo4j).
22
+
23
+ > **⚠️ Package Renamed**: This package was formerly known as `graphcast`.
24
+
25
+ [Rest of your existing README content...]
26
+
27
+ ![Python](https://img.shields.io/badge/python-3.11-blue.svg)
28
+ [![PyPI version](https://badge.fury.io/py/graflo.svg)](https://badge.fury.io/py/graflo)
29
+ [![PyPI Downloads](https://static.pepy.tech/badge/graflo)](https://pepy.tech/projects/graflo)
30
+ [![License: BSL](https://img.shields.io/badge/license-BSL--1.1-green)](https://github.com/growgraph/graflo/blob/main/LICENSE)
31
+ [![pre-commit](https://github.com/growgraph/graflo/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/growgraph/graflo/actions/workflows/pre-commit.yml)
32
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15446131.svg)]( https://doi.org/10.5281/zenodo.15446131)
33
+
34
+ ## Core Concepts
35
+
36
+ ### Property Graphs
37
+ graflo works with property graphs, which consist of:
38
+
39
+ - **Vertices**: Nodes with properties and optional unique identifiers
40
+ - **Edges**: Relationships between vertices with their own properties
41
+ - **Properties**: Both vertices and edges may have properties
42
+
43
+ ### Schema
44
+ The Schema defines how your data should be transformed into a graph and contains:
45
+
46
+ - **Vertex Definitions**: Specify vertex types, their properties, and unique identifiers
47
+ - **Edge Definitions**: Define relationships between vertices and their properties
48
+ - **Resource Mapping**: describe how data sources map to vertices and edges
49
+ - **Transforms**: Modify data during the casting process
50
+
51
+ ### Resources
52
+ Resources are your data sources that can be:
53
+
54
+ - **Table-like**: CSV files, database tables
55
+ - **JSON-like**: JSON files, nested data structures
56
+
57
+ ## Features
58
+
59
+ - **Graph Transformation Meta-language**: A powerful declarative language to describe how your data becomes a property graph:
60
+ - Define vertex and edge structures
61
+ - Set compound indexes for vertices and edges
62
+ - Use blank vertices for complex relationships
63
+ - Specify edge constraints and properties
64
+ - Apply advanced filtering and transformations
65
+ - **Parallel processing**: Use as many cores as you have
66
+ - **Database support**: Ingest into ArangoDB and Neo4j using the same API (database agnostic)
67
+
68
+ ## Documentation
69
+ Full documentation is available at: [growgraph.github.io/graflo](https://growgraph.github.io/graflo)
70
+
71
+ ## Installation
72
+
73
+ ```bash
74
+ pip install graflo
75
+ ```
76
+
77
+ ## Usage Examples
78
+
79
+ ### Simple ingest
80
+
81
+ ```python
82
+ from suthing import ConfigFactory, FileHandle
83
+
84
+ from graflo import Schema, Caster, Patterns
85
+
86
+
87
+ schema = Schema.from_dict(FileHandle.load("schema.yaml"))
88
+
89
+ conn_conf = ConfigFactory.create_config({
90
+ "protocol": "http",
91
+ "hostname": "localhost",
92
+ "port": 8535,
93
+ "username": "root",
94
+ "password": "123",
95
+ "database": "_system",
96
+ }
97
+ )
98
+
99
+ patterns = Patterns.from_dict(
100
+ {
101
+ "patterns": {
102
+ "work": {"regex": "\Sjson$"},
103
+ }
104
+ }
105
+ )
106
+
107
+ schema.fetch_resource()
108
+
109
+ caster = Caster(
110
+ schema,
111
+ )
112
+
113
+ caster.ingest_files(
114
+ path="./data",
115
+ conn_conf=conn_conf,
116
+ patterns=patterns,
117
+ )
118
+ ```
119
+
120
+ ## Development
121
+
122
+ To install requirements
123
+
124
+ ```shell
125
+ git clone git@github.com:growgraph/graflo.git && cd graflo
126
+ uv sync --dev
127
+ ```
128
+
129
+ ### Tests
130
+
131
+ #### Test databases
132
+ Spin up Arango from [arango docker folder](./docker/arango) by
133
+
134
+ ```shell
135
+ docker-compose --env-file .env up arango
136
+ ```
137
+
138
+ and Neo4j from [neo4j docker folder](./docker/arango) by
139
+
140
+ ```shell
141
+ docker-compose --env-file .env up neo4j
142
+ ```
143
+
144
+ To run unit tests
145
+
146
+ ```shell
147
+ pytest test
148
+ ```
149
+
150
+ ## Requirements
151
+
152
+ - Python 3.11+
153
+ - python-arango
154
+
155
+ ## Contributing
156
+
157
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,45 @@
1
+ graflo/README.md,sha256=epqV1Cpmogy6RnTNeu-K0JhO_gVY82RzeLFN6kvG7Is,377
2
+ graflo/__init__.py,sha256=f_g9EmicA3JZYUTRsmSpsNvtLafU4DsUPhBy0Rss-R8,1146
3
+ graflo/caster.py,sha256=OyFYBtbHz8HsYlYHmRuZy1KH-Ia6DlHWV6KmreqOwzA,15519
4
+ graflo/logging.conf,sha256=coIMi-VlXrBEfoczsY986ax20NZ2e11yi4hFWSwpwDM,372
5
+ graflo/onto.py,sha256=znY0uMqtPcK0qCSNSsipFTmoq_-88o2lHpmOPRr7jZ4,5745
6
+ graflo/architecture/__init__.py,sha256=aNEXtm5HKqpKSI0EQRbWY1PcttgnBlS3tUTxq_xT3fo,1065
7
+ graflo/architecture/actor.py,sha256=w3ZpQUV5_bIEllQ3_myIt_E4urZFiKkC9RmoytCDu2c,30125
8
+ graflo/architecture/actor_util.py,sha256=7bcQbUffQ-wu6OpWViTWNcC7m4h09_E2yz4UGEWwmRQ,16064
9
+ graflo/architecture/edge.py,sha256=sPdF3yg-e-IyLJRhSu_lidJsVAdXtrj5ze1bjDYDAYM,9343
10
+ graflo/architecture/onto.py,sha256=CRqiuyf7hmPxvNElOkfQZ7Mmr_SAecDG0FFfawgWA4s,11378
11
+ graflo/architecture/resource.py,sha256=IqSoLlFfygWUf_1Z6Sh66CW6N8BRU49oJWJXtzcQ4a4,5048
12
+ graflo/architecture/schema.py,sha256=2pi4RVCQ-jXADIVm8geMy1Yjkn1smRp-uTZdpjXMDM4,4506
13
+ graflo/architecture/transform.py,sha256=xdtRbb7wJelK0bCSPQO1DAS6a84C2mYtweX308siA9A,9431
14
+ graflo/architecture/util.py,sha256=UYu_WP5aKxL92rzBWHJHMQ0B-i3eFfdQqDKJZaAXaIc,2971
15
+ graflo/architecture/vertex.py,sha256=haHs9RA9co9yCVzBdwh2pXcLX4S8RtKsgB_nyCVPoQ0,8254
16
+ graflo/cli/__init__.py,sha256=u5YFigokhv46foL9P5YQDOIICQ2v6CMErlByucaarSs,449
17
+ graflo/cli/ingest.py,sha256=z7wUgTAxKny5buyQuh1R05zt8SrQfC3Mn_cnzeNZJZQ,4175
18
+ graflo/cli/manage_dbs.py,sha256=bHm3A-beVSzeddISXcX1GOwbSiq_ALss6l_RYIyVniw,6146
19
+ graflo/cli/plot_schema.py,sha256=rRmg8VfOl23fhebD2NahembfiWywvBU_4yXU_VVkCYQ,4300
20
+ graflo/cli/xml2json.py,sha256=pi4KDtOsVVVuxmu0DtZUOJCP3VXjDGOfHQOR6HaVQk4,2668
21
+ graflo/db/__init__.py,sha256=smVgLwrIUH6eD1EmMbITKZOnEMkRjeqdibExaVyYXr0,1037
22
+ graflo/db/connection.py,sha256=VqFXfuN-HMTEsBuvlHm5imMf_GkWuh4HHgw--PYss3s,8701
23
+ graflo/db/manager.py,sha256=40hVWjOsGi2N2jJx5ET8Yy4gVaEz41ConeukixvTK5o,3322
24
+ graflo/db/util.py,sha256=IgS32BaWKoSpsq1yqIfq9iVmXkJJFdRBDX4NOi66dgA,1461
25
+ graflo/db/arango/__init__.py,sha256=P3ASimdlyX-8FuSH0kBsNdGI9AIomCuYI8izs6tP__A,567
26
+ graflo/db/arango/conn.py,sha256=UzyiTtcPTe4L1NIvjAOTWYNU0OMhh5ht0YMis_uFP4w,25584
27
+ graflo/db/arango/query.py,sha256=t_RKltpWh0L3V0FJst38vMf7QsmjzTndgBR3ooAahmM,5655
28
+ graflo/db/arango/util.py,sha256=uSjWSb1QobzymZUZxOqneSbsHkj8DqIa9ejQts3P4XA,2955
29
+ graflo/db/neo4j/__init__.py,sha256=KB4zd06CNCmTs5KotfQ_4petaCLOJnUZ1oD4CaRJTnQ,547
30
+ graflo/db/neo4j/conn.py,sha256=7kLUdORqErxXL7oCfAfOKnbcGyw_7w99gz8TMGMt6R8,13681
31
+ graflo/filter/__init__.py,sha256=OyV5pavlOrWQeS4fwHA-tcKcNccXxGr2d--TKPYlXyE,814
32
+ graflo/filter/onto.py,sha256=Kf-I5KBVxorEpUV_rviG0XS6uwqTF9Xd7DkPGPZAPgw,11657
33
+ graflo/plot/__init__.py,sha256=ITlvw8_FRNXPqtjiou946Hv923iixGvR6c4Uqrg-L2o,485
34
+ graflo/plot/plotter.py,sha256=yv-tyKJViLU3CKg8lfBWJ8_WCxdcnGgY1G_VzhHq0lE,17710
35
+ graflo/util/__init__.py,sha256=aZsSxHD1vzADUvzHVuYrx2TL-EUye7tcw2IeX81EB38,706
36
+ graflo/util/chunker.py,sha256=U27d9_baVTtDaAJX0GxhfoN7SN6VPNbx7ArwkSMaIgI,21382
37
+ graflo/util/merge.py,sha256=jKs7o7xPkXJIy52Uaz0rtHyhXoIJAZUmiD0N4ObT8PE,5397
38
+ graflo/util/misc.py,sha256=Fwl8HhbBm-ZXbqDotnZ39gDPoTfUKeonZAi4pPWY99M,1171
39
+ graflo/util/onto.py,sha256=W1i00XP-qsQpTlGqCiR1J_EawcsKNLr4Qfts0uGbKiM,1911
40
+ graflo/util/transform.py,sha256=tnZbNLw4ArdpR62bXUPhDvQ547OZGLGUBkJHTn7O0zo,10984
41
+ graflo-1.1.0.dist-info/METADATA,sha256=c6aTKMKuc8-nN2LQcPEs3lyGry8oglqF61efko3isbg,4636
42
+ graflo-1.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
+ graflo-1.1.0.dist-info/entry_points.txt,sha256=kjDXqHgIrppqxQe6RO6XjLrq7VL50AaVHhLg7c95Oxc,190
44
+ graflo-1.1.0.dist-info/licenses/LICENSE,sha256=ILn9MXR5AfuRRtOF8abQWhm0wO8kckf4IBdc6mKaRG8,5593
45
+ graflo-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ ingest = graflo.cli.ingest:ingest
3
+ manage_dbs = graflo.cli.manage_dbs:manage_dbs
4
+ plot_schema = graflo.cli.plot_schema:plot_schema
5
+ xml2json = graflo.cli.plot_schema:xml2json
@@ -0,0 +1,126 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: Growgraph SAS
6
+ Licensed Work: GraFlo
7
+ The Licensed Work is (c) 2025 GraFlo
8
+ Formerly GraphCast
9
+
10
+ Additional Use Grant:
11
+ The Licensor hereby grants you the right to make production use of the Licensed Work
12
+ if any of the following conditions are met:
13
+
14
+ - Your organization's annual revenue does not exceed USD 100,000
15
+ - You are not offering a commercially available product or service that
16
+ competes with the Licensor's products or services
17
+
18
+ Definitions:
19
+ "Production Use" means any use of the Licensed Work in a production environment,
20
+ including but not limited to:
21
+
22
+ - Deploying the Licensed Work to serve production traffic
23
+ - Using the Licensed Work to process real customer data
24
+ - Incorporating the Licensed Work into a commercial product or service
25
+ - Using the Licensed Work to generate revenue directly or indirectly
26
+
27
+ "Competing Product or Service" means any product or service that:
28
+
29
+ - Provides substantially similar functionality to the Licensed Work
30
+ - Offers the Licensed Work as a hosted or managed service
31
+ - Incorporates the Licensed Work into a broader product or service that competes
32
+ with the Licensor's current or reasonably anticipated products or services
33
+
34
+ "Non-Production Use" means:
35
+
36
+ - Development and testing in isolated environments
37
+ - Academic research and educational purposes
38
+ - Evaluation of the Licensed Work for potential purchase of a commercial license
39
+ - Personal, non-commercial projects where the Licensed Work is not used to generate revenue
40
+
41
+ Change Date: 2029-05-01
42
+
43
+ Change License: Apache License, Version 2.0
44
+
45
+ For information about alternative licensing arrangements for the Software,
46
+ please contact: <team@growgraph.dev>
47
+
48
+ Notice
49
+
50
+ The Business Source License (this document, or the “License”) is not an Open
51
+ Source license. However, the Licensed Work will eventually be made available
52
+ under an Open Source License, as stated in this License.
53
+
54
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
55
+ “Business Source License” is a trademark of MariaDB Corporation Ab.
56
+
57
+ -----------------------------------------------------------------------------
58
+
59
+ Business Source License 1.1
60
+
61
+ Terms
62
+
63
+ The Licensor hereby grants you the right to copy, modify, create derivative
64
+ works, redistribute, and make non-production use of the Licensed Work. The
65
+ Licensor may make an Additional Use Grant, above, permitting limited
66
+ production use.
67
+
68
+ Effective on the Change Date, or the fourth anniversary of the first publicly
69
+ available distribution of a specific version of the Licensed Work under this
70
+ License, whichever comes first, the Licensor hereby grants you rights under
71
+ the terms of the Change License, and the rights granted in the paragraph
72
+ above terminate.
73
+
74
+ If your use of the Licensed Work does not comply with the requirements
75
+ currently in effect as described in this License, you must purchase a
76
+ commercial license from the Licensor, its affiliated entities, or authorized
77
+ resellers, or you must refrain from using the Licensed Work.
78
+
79
+ All copies of the original and modified Licensed Work, and derivative works
80
+ of the Licensed Work, are subject to this License. This License applies
81
+ separately for each version of the Licensed Work and the Change Date may vary
82
+ for each version of the Licensed Work released by Licensor.
83
+
84
+ You must conspicuously display this License on each original or modified copy
85
+ of the Licensed Work. If you receive the Licensed Work in original or
86
+ modified form from a third party, the terms and conditions set forth in this
87
+ License apply to your use of that work.
88
+
89
+ Any use of the Licensed Work in violation of this License will automatically
90
+ terminate your rights under this License for the current and all other
91
+ versions of the Licensed Work.
92
+
93
+ This License does not grant you any right in any trademark or logo of
94
+ Licensor or its affiliates (provided that you may use a trademark or logo of
95
+ Licensor as expressly required by this License).
96
+
97
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
98
+ AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
99
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
100
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
101
+ TITLE.
102
+
103
+ MariaDB hereby grants you permission to use this License’s text to license
104
+ your works, and to refer to it using the trademark “Business Source License”,
105
+ as long as you comply with the Covenants of Licensor below.
106
+
107
+ Covenants of Licensor
108
+
109
+ In consideration of the right to use this License’s text and the “Business
110
+ Source License” name and trademark, Licensor covenants to MariaDB, and to all
111
+ other recipients of the licensed work to be provided by Licensor:
112
+
113
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
114
+ or a license that is compatible with GPL Version 2.0 or a later version,
115
+ where “compatible” means that software provided under the Change License can
116
+ be included in a program with software provided under GPL Version 2.0 or a
117
+ later version. Licensor may specify additional Change Licenses without
118
+ limitation.
119
+
120
+ 2. To either: (a) specify an additional grant of rights to use that does not
121
+ impose any additional restriction on the right granted in this License, as
122
+ the Additional Use Grant; or (b) insert the text “None”.
123
+
124
+ 3. To specify a Change Date.
125
+
126
+ 4. Not to modify this License in any other way.