Skip to main content

A convenient wrapper around faunadb-py that abstracts away FQL code for the database service faunadb.

Project description

Fauna Easy Python

A convenient wrapper around faunadb for python that abstracts away FQL code for the database service faunadb

Installation

Use the package manager pip to install fauna-easy.

pip install fauna_easy

QuickStart

from fauna_easy.base_model import FaunaEasyBaseModel
from pydantic import BaseModel
from faunadb.client import FaunaClient

if __name__ == '__main__':
    class NewPost(BaseModel):
        title: str
        content: str

    fauna_client = FaunaClient('YOUR_CLIENT_SECRET')

    Post = FaunaEasyBaseModel('posts', NewPost)

    create_query = Post.create({
        'title': 'my post title',
        'content': 'my post content'
    }) # Will not automatically create document in database. This merely creates the query

    created_documents = fauna_client.query(create_query) # creates document in database
    print(created_documents)

Documentation

Still under development :)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fauna_easy-0.0.1.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

fauna_easy-0.0.1-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

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