Skip to main content

Data Snack - Dynamic entity

About

Used to dynamically load data-snack Entity objects from json schema. Especially useful for complex dataset with many fields.

Install

Data Snack can be easily installed using pypi repository.

pip install data_snack_dynamic_entity

Usage

1. Define Entity template

First you need to define a dictionary containing the template - a configuration for your Entity type. Template should contain:

  • the name of the new Entity type and its properties
  • each property should have:
    • type - type of the field
    • default - default value (optional property)
    • optional - true if the field is optional (optional property)

Notice that your template can be saved in any file of your choosing. Just make sure it's later parsed to a dictionary in the right format.

The template is defined using following schema: src/data_snack_dynamic_entity/entityTemplates.schema.json.

Example

{
    "Car": {
        "properties": {
            "name": {
                "type": "str"
            },
            "cost": {
                "type": "float",
                "default": 10.0,
                "optional": True
            }
        }
    }
}

2. Load the template and create new types

Now you are ready to create entities based on your template:

from data_snack_dynamic_entity.factory import load_entities

entities = load_entities(templates=your_config)

After that entities will contain a dictionary in the following format:

{
    "entity_name": EntityType
}

Contact

Plugin was created by the Data Science team from Webinterpret.

Release files for data-snack-dynamic-entity 0.3.4

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

Source distribution (sdist)

Source distribution for data-snack-dynamic-entity 0.3.4
File Size Uploaded
data_snack_dynamic_entity-0.3.4.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for data-snack-dynamic-entity 0.3.4
File Interpreter ABI Platform
data_snack_dynamic_entity-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 17.0 kB

Release files / data_snack_dynamic_entity-0.3.4.tar.gz

Download URL data_snack_dynamic_entity-0.3.4.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cd0ae91c021894594cb46e9a669457ca1e56505914af381a11a5217f424ce00e
BLAKE2b-256 checksum
How to use checksums
329e6cc41d315af41a21526d0907e154bb445e1cdbf0e2c9e63aa81413521474
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / data_snack_dynamic_entity-0.3.4-py3-none-any.whl

Download URL data_snack_dynamic_entity-0.3.4-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10ee907bf05214e8ab9a26e83f523a0edefffea8de4379c89cc0a99900dd3566
BLAKE2b-256 checksum
How to use checksums
6bd79ae9d2ee05284099b7e93e6956494240bdd6cc2e46dbdffc6cd6ddf04656
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

1 release file

0.0.1

2 release files

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