This example demonstrates how to use read and write queries via the gqlalchemy Python client.
The script performs the following actions:
- Connects to a running Memgraph instance using
gqlalchemy. - Creates an
Personnode — creating a node with multiple properties. - Execute query - showcasing how to run write queries
- Creates a read query and executes read query showcasing how to read data from Memgraph.
- Showcasing manipulation over Node object:
- How to access labels.
- How to access properties.
- How to access specific property.
To run Memgraph Community using Docker:
docker run -it --rm -p 7687:7687 memgraph/memgraph:3.2Install dependencies with:
pip install -r requirements.txtYour requirements.txt should include:
gqlalchemy
Once Memgraph is running:
python3 creating_and_reading_nodes.pyThis example was built and tested with:
- Memgraph v3.2
If you run into any issues or have questions, feel free to reach out on the Memgraph Discord server. We're happy to help!
This example works with Memgraph Community Edition