Skip to main content

EdgeDB Python driver

Project description

edgedb-python is the official EdgeDB driver for Python. It provides both blocking IO and asyncio implementations.

The library requires Python 3.6 or later.

Documentation

The project documentation can be found here.

Installation

The library is available on PyPI. Use pip to install it:

$ pip install edgedb

Basic Usage

import datetime
import edgedb

def main():
    # Establish a connection to an existing database named "test"
    # as an "edgedb" user.
    conn = edgedb.connect('edgedb://edgedb@localhost/test')
    # Create a User object type
    conn.execute('''
        CREATE TYPE User {
            CREATE REQUIRED PROPERTY name -> str;
            CREATE PROPERTY dob -> local_date;
        }
    ''')

    # Insert a new User object
    conn.fetchall('''
        INSERT User {
            name := <str>$name,
            dob := <local_date>$dob
        }
    ''', name='Bob', dob=datetime.date(1984, 3, 1))

    # Select User objects.
    user_set = conn.fetchall(
        'SELECT User {name, dob} FILTER .name = <str>$name', name='Bob')
    # *user_set* now contains
    # Set{Object{name := 'Bob', dob := datetime.date(1984, 3, 1)}}

    # Close the connection.
    conn.close()

if __name__ == '__main__':
    main()

License

edgedb-python is developed and distributed under the Apache 2.0 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

edgedb-0.6.1.tar.gz (640.7 kB view details)

Uploaded Source

Built Distributions

edgedb-0.6.1-cp37-cp37m-manylinux1_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.7m

edgedb-0.6.1-cp37-cp37m-manylinux1_i686.whl (2.2 MB view details)

Uploaded CPython 3.7m

edgedb-0.6.1-cp37-cp37m-macosx_10_13_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7m macOS 10.13+ x86-64

File details

Details for the file edgedb-0.6.1.tar.gz.

File metadata

  • Download URL: edgedb-0.6.1.tar.gz
  • Upload date:
  • Size: 640.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for edgedb-0.6.1.tar.gz
Algorithm Hash digest
SHA256 bde117e4ccb02dc8c8e3ea94b7cd7c45331bc1fad23308e5c6adbf82d014d959
MD5 c5f4b05160e6a7edaa12eb1507f66418
BLAKE2b-256 d6ec5a809dc0b77742571ee8e7b543853f7686676e338a59306beb08408d7652

See more details on using hashes here.

File details

Details for the file edgedb-0.6.1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: edgedb-0.6.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for edgedb-0.6.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 efb9073317f12a7c2e731740669e57590a525359d34417a532523611dfb29222
MD5 c102105be6138e32c307f87cad839691
BLAKE2b-256 4bd51fd8d966f9d8fa18216650d0cbcc90741cfd1ead5da8e7c2c8da6bf6b9fe

See more details on using hashes here.

File details

Details for the file edgedb-0.6.1-cp37-cp37m-manylinux1_i686.whl.

File metadata

  • Download URL: edgedb-0.6.1-cp37-cp37m-manylinux1_i686.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for edgedb-0.6.1-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 3472856c2fece0a327f9415588b6c3ae094e2654382614e885f08a6e4f1714fc
MD5 81e865560ecd9a4346ddedb8010586bb
BLAKE2b-256 2eaa9ebfd84a3c34f4a765daf7c2a98121766a5d206d7ec5e468a4718700516c

See more details on using hashes here.

File details

Details for the file edgedb-0.6.1-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: edgedb-0.6.1-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for edgedb-0.6.1-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 239b9bda95dab3e93802529f7bfc72f930b642e834672c2b0145db624aadce3b
MD5 1463934c78975ce3ccc47f3277baa8f1
BLAKE2b-256 1ee9779181448cb60c269485d33683dad75e342f8cd1618c54ac944569889cee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page