Memgraph database adapter for Python language
Project description
pymgclient - Memgraph database adapter for Python language
pymgclient is a Memgraph database adapter for Python programming language compliant with the DB-API 2.0 specification described by PEP 249.
mgclient module is the current implementation of the adapter. It is implemented in C as a wrapper around mgclient, the official Memgraph client library. As a C extension, it is only compatible with the CPython implementation of the Python programming language.
pymgclient only works with Python 3.
Check out the documentation if you need help with installation or if you want to build pymgclient for yourself!
Documentation
Online documentation can be found on GitHub pages.
You can also build a local version of the documentation by running make
from
the docs
directory. You will need Sphinx
installed in order to do that.
Code sample
Here is an example of an interactive session showing some of the basic commands:
>>> import mgclient
# Make a connection to the database
>>> conn = mgclient.connect(host='127.0.0.1', port=7687)
# Create a cursor for query execution
>>> cursor = conn.cursor()
# Execute a query
>>> cursor.execute("""
CREATE (n:Person {name: 'John'})-[e:KNOWS]->
(m:Person {name: 'Steve'})
RETURN n, e, m
""")
# Fetch one row of query results
>>> row = cursor.fetchone()
>>> print(row[0])
(:Person {'name': 'John'})
>>> print(row[1])
[:KNOWS]
>>> print(row[2])
(:Person {'name': 'Steve'})
# Make database changes persistent
>>> conn.commit()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pymgclient-1.2.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a123eeda47d8c2cb90ea8fe765041f0324dd36b9db60664dad62969a5a581bd0 |
|
MD5 | 32223b94544d400c2c4ca655d8ac22e4 |
|
BLAKE2b-256 | 96d8542d6ad7f98c1056575c562619801ec528df44932a3eccdb51e8634cda16 |
Hashes for pymgclient-1.2.0-cp310-cp310-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a78a48c84ff77733fde72c29c2fbbafa3fb81150171ef336976c18e17a655b18 |
|
MD5 | b1d7e3363f112ab8bc9b4bca2443f719 |
|
BLAKE2b-256 | d6c7527d83cce55364a4e491eb2527c5d1bfb3a5b4681ef225de65de77c6000d |
Hashes for pymgclient-1.2.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 908b039188c31b0fc6117aacc040c0ed33067a9e09cb14c934eecf73e429f961 |
|
MD5 | ba6bfd6bc9e4782dc36742791763ebac |
|
BLAKE2b-256 | 2ee9f0b145d6d57a640ee67b3fe0c06e6d90ecd0813dddade64f8f3b101159fc |
Hashes for pymgclient-1.2.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49c47e9dc6d228607589494cafecf402e76c4d22c864951392495069c6ff95ec |
|
MD5 | e5bfbd0692aa83dbe022625a1f443d2c |
|
BLAKE2b-256 | d5a91c6ae8541ac3111e9e7855179be3f8234071628aa37d71f44b822b17b88d |
Hashes for pymgclient-1.2.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3855b32d6c011dcf85b6d0533e1546ba8cefd2cd936824156c313465a2f5c23 |
|
MD5 | 6f74d2c0f9502e3ec4ebedf25904bcbe |
|
BLAKE2b-256 | 2a52dc7ff464aa28157cc825a6e636972ede0b86eb7ff9100ec80dcdf150cdcf |
Hashes for pymgclient-1.2.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b77941967bc7d24009a125d0dbf6bd4fa04dd5ba102d30360408fd609a397025 |
|
MD5 | 7710ad92827e16cc5bc29be3195b5e80 |
|
BLAKE2b-256 | 7e7ec88c17971870652716bff01fdfc1039655abea186bb39e45e37dfc3cc707 |
Hashes for pymgclient-1.2.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c6cb017e7e41ae47c1c23d5503ee2fc2dfee7166c08742dd7c83b1d4942517c |
|
MD5 | d9cecd262cc8b466cb19e6408dd7381c |
|
BLAKE2b-256 | 6ebb32026f8bd19a4ab614fc219c55a2158c1efbe39dc8f03674b76997aa9404 |
Hashes for pymgclient-1.2.0-cp38-cp38-macosx_12_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3197e71aa32df6069cef5bb8da74248bc4a3f260a9ccde5efc939f0ffce21a2 |
|
MD5 | 0944dc90832756b8d1419785daa930fa |
|
BLAKE2b-256 | 466d8b63f9b1d464d31d8aee8511afce662bd331adec76d8a403f34ad04cfc3f |
Hashes for pymgclient-1.2.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 660806bdb256ca3eb0220dea36f4bca5b7d2ce867295113b88c0ffacedcd011a |
|
MD5 | 1c95757b249e65fe01d81e4796dd9199 |
|
BLAKE2b-256 | 80623411ebc940f5ec3acc1afbaee98a48154e7428c35be59d0e43a9865567d0 |
Hashes for pymgclient-1.2.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88d8809b0048a0cfc61636290d57f7230b34d28bbc8be429f8b4e7e84e697804 |
|
MD5 | 7a0b5f9b2913f93056a3999d6f2a0857 |
|
BLAKE2b-256 | 73b7bd4d6429a187f3d958177531424aeda99867a7c1201db2ed0172754ea212 |
Hashes for pymgclient-1.2.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e66f519d17995812be06ca3d4cf8c476e8b3740226abd1655bbd8817c572bd |
|
MD5 | d0ba771affbb3347f1013c3adede95b5 |
|
BLAKE2b-256 | b6bce2fe9ce308210b658fed0b82fe437720d216954ff9e418b10ad17521a788 |