Skip to main content

Eluvia Base

Schema

eluvia.integrations.schemas.Empty

Empty object is a singleton which purpose is to define unset value.

eluvia.integrations.schemas.empty

Empty is instance of the Empty object. The value bool(empty) is False which can simplify value checking implementations.

eluvia.integrations.schemas.Dataclass

Dataclass is base class for service integration data objects. The class static method map_from_dict is a factory class that initialize object from a dict. It provides simple way how to convert a service response in a JSON format to the data class object. Example:

from uuid import UUID
from dataclasses import dataclass

from eluvia.integrations.schemas import Dataclass, Empty, empty

@dataclass
class Role(Dataclass):
    
    name: str | Empty = empty

@dataclass
class User(Dataclass):
    
    id: UUID
    name: str | Empty = empty
    email: str | Empty = empty
    role: Role | Empty = empty


response_data = {
    'id': 'd2aa2bd0-b040-4348-9a18-4b717582048c',
    'name': 'Pert',
    'email': 'petr@eluvia.com',
    'role': {
        'name': 'capitan'
    }
}

User.map_from_dict(response_data)  # will create User and related Role objects

eluvia.integrations.signals

Signals is a module that provides two signals schema_obj_post_save and schema_obj_post_delete that are emitted if schema object is saved or deleted. You can use reciever decorator to register a callback function to the signal.

from eluvia.integrations.signals import schema_obj_post_save, receiver


@receiver(schema_obj_post_save, sender=MySchema)
def my_callback(sender, instance, **kwargs):
    print(f'{sender} object {instance} was saved')

More signals can be registered to the same callback function.

from eluvia.integrations.signals import schema_obj_post_save, schema_obj_post_delete, receiver


@receiver([schema_obj_post_save, schema_obj_post_delete], sender=MySchema)
def my_callback(sender, **kwargs):
    print(f'{sender} object was saved')

Metadata

Release files for eluvia-base 2.0.2

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

Source distribution (sdist)

Source distribution for eluvia-base 2.0.2
File Size Uploaded Provenance Actions
eluvia_base-2.0.2.tar.gz 18.2 kB Without provenance Details for eluvia_base-2.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eluvia-base 2.0.2
File Interpreter ABI Platform Actions
eluvia_base-2.0.2-py3-none-any.whl Python 3 none any Details for eluvia_base-2.0.2-py3-none-any.whl

Total release size: 38.0 kB

Release files / eluvia_base-2.0.2.tar.gz

Download URL eluvia_base-2.0.2.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
30c4926f1ca49561be32c539c7992e74211f32b6e17bbe46d9a86832cd83caef
BLAKE2b-256 checksum
How to use checksums
441ca0c1c53cf9fe6b4047c888d01c2ab433155664d8724bae117021f5d521d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release files / eluvia_base-2.0.2-py3-none-any.whl

Download URL eluvia_base-2.0.2-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c57d715d0086c020c4ca45b05b604c6c8c520052c85d71d9d97c73e29b24cbed
BLAKE2b-256 checksum
How to use checksums
4cdf1de71e99fac282322d06a72f83413d58c12c7c05b415ea9a45e56c5cc780
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Security for eluvia-base 2.0.2

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.

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 release files No provenance

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