You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54-18Lines changed: 54 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,33 +14,68 @@
14
14
15
15
An Object Graph Mapper or OGM provides a developer-friendly workflow that allows for writing object-oriented notation to communicate with graph databases. Instead of writing Cypher queries, you will be able to write object-oriented code, which the OGM will automatically translate into Cypher queries.
16
16
17
+
## Installation
18
+
17
19
GQLAlchemy is built on top of Memgraph's low-level Python client `pymgclient`
To install GQLAlchemy, you first need to install `pymgclient`[build prerequisites](https://memgraph.github.io/pymgclient/introduction.html#build-prerequisites).
23
25
24
-
Before you install `gqlalchemy`, make sure that you have `cmake` installed by running:
25
-
```
26
-
cmake --version
27
-
```
28
-
You can install `cmake` by following the [official instructions](https://cgold.readthedocs.io/en/latest/first-step/installation.html#).
26
+
After you have installed the prerequisites, run the following command:
29
27
30
-
To install `gqlalchemy`, simply run the following command:
31
-
```
32
-
pip install gqlalchemy
28
+
`pip install gqlalchemy`
29
+
30
+
With the above command, you get the basic GQLAlchemy capabilities. To add additional import/export capabilities, install GQLAlchemy with one of the following commands:
31
+
32
+
-`pip install gqlalchemy[arrow]` # Support for the CSV, Parquet, ORC and IPC/Feather/Arrow formats
33
+
-`pip install gqlalchemy[dgl]` # DGL support (includes PyTorch)
34
+
35
+
-`pip install gqlalchemy[all]` # All of the above
36
+
37
+
If you intend to use GQLAlchemy with PyTorch Geometric support, that library must be installed manually:
If you are using [Conda](https://docs.conda.io/en/latest/) for Python environment management, you can install GQLAlchemy through pip.
36
45
37
46
## Build & Test
38
47
39
-
The project uses [Poetry](https://python-poetry.org/) to build the GQLAlchemy Python library. To build and run tests, execute the following command:
40
-
`poetry install`
48
+
The project uses [Poetry](https://python-poetry.org/) to build the library. Clone or download the [GQLAlchemy source code](https://github.com/memgraph/gqlalchemy) locally and run the following command to build it from source with Poetry:
49
+
50
+
```bash
51
+
poetry install --all-extras
52
+
```
41
53
42
-
Before starting the tests, make sure you have an active Memgraph instance running. Execute the following command:
43
-
`poetry run pytest .`
54
+
The ``poetry install --all-extras``command installs GQLAlchemy with all extras
55
+
(optional dependencies). Alternatively, you can use the ``-E`` option to define
56
+
what extras to install:
57
+
58
+
```bash
59
+
poetry install # No extras
60
+
61
+
poetry install -E arrow # Support for the CSV, Parquet, ORC and IPC/Feather/Arrow formats
62
+
poetry install -E dgl # DGL support (also includes torch)
63
+
```
64
+
65
+
To run the tests, make sure you have an [active Memgraph instance](/memgraph), and execute one of the following commands:
66
+
67
+
```bash
68
+
poetry run pytest . -k "not slow" # If all extras installed
69
+
70
+
poetry run pytest . -k "not slow and not extras" # Otherwise
71
+
```
72
+
73
+
If you’ve installed only certain extras, it’s also possible to run their associated tests:
74
+
75
+
```bash
76
+
poetry run pytest . -k "arrow"
77
+
poetry run pytest . -k "dgl"
78
+
```
44
79
45
80
## GQLAlchemy capabilities
46
81
@@ -235,10 +270,11 @@ Since Memgraph is an in-memory graph database, the GQLAlchemy library provides a
235
270
If you want to learn more about OGM, query builder, managing streams, importing data from different source, managing Memgraph instances, managing database triggers and using on-disk storage, check out the GQLAlchemy [how-to guides](https://memgraph.com/docs/gqlalchemy/how-to-guides).
236
271
237
272
## Development (how to build)
238
-
```
273
+
274
+
```bash
239
275
poetry run flake8 .
240
276
poetry run black .
241
-
poetry run pytest . -k "not slow"
277
+
poetry run pytest . -k "not slow and not extras"
242
278
```
243
279
244
280
## Documentation
@@ -247,8 +283,8 @@ The GQLAlchemy documentation is available on [memgraph.com/docs/gqlalchemy](http
0 commit comments