A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/1st1/gel-python below:

1st1/gel-python: The official Python client library for Gel

The Python driver for Gel

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

The library requires Python 3.9 or later.

The project documentation can be found here.

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

$ pip install gel
import datetime
import gel

def main():
    client = gel.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()

Instructions for installing Gel and gel-python locally can be found at docs.geldata.com/resources/guides/contributing/code.

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

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4