Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

No SeiQueLa ORM

IN DEVELOPMENT

🇧🇷 Documentação em Português

No SeiQueLa is a small and expressive ORM (Object Relational Mapper) to interact with Google Datastore inspired by Django, Mongo-Engine and Peewee.

Requirements

Installing

The library can be installed using pip:

pip install noseiquela_orm

Usage

Creating model classes:

from noseiquela_orm.entity import Model
from noseiquela_orm.key import Key, ParentKey
from noseiquela_orm import properties


class Customer(Model):
    name = properties.StringProperty(required=True)
    age = properties.IntegerProperty(required=True)
    is_deleted = properties.BooleanProperty(default=False, required=True)


class CustomerAddress(Model):
    __kind__ = "Address"
    __parent__ = properties.ParentKey(Customer, required=True)

    number = properties.IntegerProperty(required=True)
    address_one = properties.StringProperty(required=True)
    address_two = properties.StringProperty()
    is_default = properties.BooleanProperty(required=True)
    is_deleted = properties.BooleanProperty(default=False, required=True)

In case the project name, namespace (or any other parameter of the google.cloud.datastore.Client) needs to be changed, simply create a Meta class inside the template with the desired information.

class Product(Model):
    quantity = properties.IntegerProperty(required=True)
    name = properties.StringProperty(required=True)
    value = properties.FloatProperty(required=True)

    class Meta:
        namespace = "production"
        project = "products"

Adding new entities:

new_customer = Customer(
    name="Geraldo Castro",
    age=29,
)

new_customer.save()

new_address = CustomerAddress(
    parent_id=new_customer.id,
    number=199,
    address_one="Some St.",
    is_default=True
)

new_address.save()

Query on database:

customer = Customer.query.filter(name="Geraldo Castro").first()
customer_address = Customer.query.filter(parend_id=customer.id)

less_than_or_eq_29 = Customer.query.filter(age__le=29) # age <= 29
more_than_30 = Customer.query.filter(age__gt=30) # age > 30

all_customers = [
    customer.to_dict()
    for customer in Customer.query.all()
]

Authentication

The library uses the standard way of authenticating Google libraries (google-auth-library-python).

The search for credentials happens in the following order:

  1. If the environment variable GOOGLE_APPLICATION_CREDENTIALS is set to a valid service account path.

  2. If the Google Cloud SDK is installed and has the credentials of the application to be used, these will be loaded.

  3. If the application is running in the App Engine standard environment (first generation), then the credentials and project ID are taken from the App Identity Service.

  4. If the application is running in Compute Engine, Cloud Run, App Engine flexible environment or App Engine standard environment (second generation), then the credentials and project ID are taken from the Metadata Service.

More details at this link.

Metadata

Release files for noseiquela-orm 0.0.4-dev6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for noseiquela-orm 0.0.4-dev6
File Size Uploaded Provenance Actions
noseiquela_orm-0.0.4-dev6.tar.gz 10.6 kB Without provenance Details for noseiquela_orm-0.0.4-dev6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for noseiquela-orm 0.0.4-dev6
File Interpreter ABI Platform Actions
noseiquela_orm-0.0.4.dev6-py3-none-any.whl Python 3 none any Details for noseiquela_orm-0.0.4.dev6-py3-none-any.whl

Total release size: 21.5 kB

Release files / noseiquela_orm-0.0.4-dev6.tar.gz

Download URL noseiquela_orm-0.0.4-dev6.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a7f3fe5f11980b4ff3be1ebc1a5bb213c5ae3f718127ef022bc4eddf71bc68d0
BLAKE2b-256 checksum
How to use checksums
11b6e8772e27fcf1d98221af5f1e19fb35c774d3a58ef609b12abb970151ae4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release files / noseiquela_orm-0.0.4.dev6-py3-none-any.whl

Download URL noseiquela_orm-0.0.4.dev6-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1995ad63153d3b9f4d6f22e64306fbca5d0a3d91e0c8ad561e13fc9f35b12249
BLAKE2b-256 checksum
How to use checksums
422c95f80e5057a9f4c97ee6f66ba1cd9c3e2cd024d4316e9f40127e1e878d91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Security for noseiquela-orm 0.0.4-dev6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page