Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edgedb/edgedb-python
The official Python client library for EdgeDB
https://github.com/edgedb/edgedb-python
asynchronous asyncio database-driver edgedb high-performance python3 synchronous
Last synced: 13 days ago
JSON representation
The official Python client library for EdgeDB
- Host: GitHub
- URL: https://github.com/edgedb/edgedb-python
- Owner: edgedb
- License: apache-2.0
- Created: 2018-06-29T22:37:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-07T17:00:14.000Z (about 1 month ago)
- Last Synced: 2024-10-12T23:11:00.016Z (about 1 month ago)
- Topics: asynchronous, asyncio, database-driver, edgedb, high-performance, python3, synchronous
- Language: Python
- Homepage: https://edgedb.com
- Size: 1.53 MB
- Stars: 368
- Watchers: 13
- Forks: 44
- Open Issues: 29
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
The Python driver for EdgeDB
============================.. image:: https://github.com/edgedb/edgedb-python/workflows/Tests/badge.svg?event=push&branch=master
:target: https://github.com/edgedb/edgedb-python/actions.. image:: https://img.shields.io/pypi/v/edgedb.svg
:target: https://pypi.python.org/pypi/edgedb.. image:: https://img.shields.io/badge/join-github%20discussions-green
:target: https://github.com/edgedb/edgedb/discussions**edgedb-python** is the official EdgeDB driver for Python.
It provides both blocking IO and asyncio implementations.The library requires Python 3.8 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
-----------.. code-block:: python
import datetime
import edgedbdef main():
client = edgedb.create_client()
# Create a User object type
client.execute('''
CREATE TYPE User {
CREATE REQUIRED PROPERTY name -> str;
CREATE PROPERTY dob -> cal::local_date;
}
''')# Insert a new User object
client.query('''
INSERT User {
name := $name,
dob := $dob
}
''', name='Bob', dob=datetime.date(1984, 3, 1))# Select User objects.
user_set = client.query(
'SELECT User {name, dob} FILTER .name = $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.