Metadata-Version: 2.1
Name: edgedb
Version: 2.0.1
Summary: EdgeDB Python driver
Home-page: https://github.com/edgedb/edgedb-python
Author: MagicStack Inc
Author-email: hello@magic.io
License: Apache License, Version 2.0
Platform: macOS
Platform: POSIX
Platform: Windows
Provides: edgedb
Requires-Python: >=3.8
License-File: LICENSE
Requires-Dist: certifi>=2021.5.30; platform_system == "Windows"
Provides-Extra: ai
Requires-Dist: httpx~=0.27.0; extra == "ai"
Requires-Dist: httpx-sse~=0.4.0; extra == "ai"
Provides-Extra: docs
Requires-Dist: sphinx~=4.2.0; extra == "docs"
Requires-Dist: sphinxcontrib-asyncio~=0.3.0; extra == "docs"
Requires-Dist: sphinx_rtd_theme~=1.0.0; extra == "docs"
Provides-Extra: test
Requires-Dist: pycodestyle~=2.11.1; extra == "test"
Requires-Dist: pyflakes~=3.2.0; extra == "test"
Requires-Dist: flake8-bugbear~=24.4.26; extra == "test"
Requires-Dist: flake8~=7.0.0; extra == "test"
Requires-Dist: uvloop>=0.15.1; platform_system != "Windows" and extra == "test"
Provides-Extra: dev
Requires-Dist: Cython<0.30.0,>=0.29.24; extra == "dev"
Requires-Dist: pytest>=3.6.0; extra == "dev"
Requires-Dist: sphinx~=4.2.0; extra == "dev"
Requires-Dist: sphinxcontrib-asyncio~=0.3.0; extra == "dev"
Requires-Dist: sphinx_rtd_theme~=1.0.0; extra == "dev"
Requires-Dist: pycodestyle~=2.11.1; extra == "dev"
Requires-Dist: pyflakes~=3.2.0; extra == "dev"
Requires-Dist: flake8-bugbear~=24.4.26; extra == "dev"
Requires-Dist: flake8~=7.0.0; extra == "dev"
Requires-Dist: uvloop>=0.15.1; platform_system != "Windows" and extra == "dev"

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 <https://edgedb.com/docs/clients/00_python/index>`_.


Installation
------------

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

    $ pip install edgedb


Basic Usage
-----------

.. code-block:: python

    import datetime
    import edgedb

    def 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 := <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 <https://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.
