Skip to content

Repository files navigation

The Python driver for EdgeDB

https://github.com/edgedb/edgedb-python/workflows/Tests/badge.svg?event=push&branch=masterhttps://img.shields.io/badge/join-github%20discussions-green

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

The library requires Python 3.7 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

importdatetimeimportedgedbdefmain():
client=edgedb.create_client()
# Create a User object typeclient.execute(''' CREATE TYPE User { CREATE REQUIRED PROPERTY name -> str; CREATE PROPERTY dob -> cal::local_date; } ''')
# Insert a new User objectclient.query(''' INSERT User { name := <str>$name, dob := <cal::local_date>$dob } ''', name='Bob', dob=datetime.date(1984, 3, 1))
# Select User objects.user_set=client.query(
'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 client.client.close()
if__name__=='__main__':
main()

Development

Instructions for installing EdgeDB and edgedb-python locally can be found at edgedb.com/docs/reference/dev.

To run the test suite, run $ python setup.py test.

License

edgedb-python is developed and distributed under the Apache 2.0 license.

About

Customed client library for EdgeDB

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages