Skip to main content

AttrTables

AttrTables is a library for storing attributes of entities in a database, where the entities are rows and the attributes are columns in an automatically managed set of tables.

Basic concepts

Each entity (identified by an unique ID) can have as many attributes as desired. These consist in one or multiple values, each stored in an independent database column. New attributes can be added at any time.

Alongside with the values, attributes can store a computation ID (which can refer to an external table of computation metadata). Computation IDs can be stored for individual attributes and optionally also for groups of attributes.

The attribute columns are automatically spread among multiple database tables, so that the total number of columns does not exceed a given limit.

Comparison to entity-attribute-value

An alternative to the model implemented by AttrTables is the entity-attribute-value (EAV) model, in which there is a single table, where entities are rows and the attribute name and value are two columns.

The EAV model has some disadvantages, compared to AttrTables:

  • the values of a single attribute generally cannot be indexed
  • the values must be stored in a generic data type (such as blobs), and the application must convert back and forth to the correct datatype

Setup

The library is based on SqlAlchemy, which must be installed (see requirements.txt).

Furthermore, a database must be setup. The connection to the database is done using SqlAlchemy, and the connectable is passed to the library, as explained below.

Running the tests suite

To run the test suite, a database is needed, where the test tables can be stored. The user must create such database.

The database configuration is provided using a YAML configuration file "config.yaml", which shall be stored in the "tests" subdirectory (see as an example "tests/config.yaml").

Usage

The usage of the library is explained in the user manual.

Metadata

Release files for attrtables 1.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 attrtables 1.2
File Size Uploaded
attrtables-1.2.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for attrtables 1.2
File Interpreter ABI Platform
attrtables-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 30.3 kB

Release files / attrtables-1.2.tar.gz

Download URL attrtables-1.2.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
273352a166f4ba93307c3ed1384649037d9112ba715bb3d9076bd3ba36d8d423
BLAKE2b-256 checksum
How to use checksums
e402fd9179674a6326eaa33e1af78ab9e9da72b09ec1396d0fdbc0ad05b41bb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release files / attrtables-1.2-py3-none-any.whl

Download URL attrtables-1.2-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6af587674c90ae42cebd3c66140844321805f334d8cacb6d54bb43b2333eb3fb
BLAKE2b-256 checksum
How to use checksums
53eeba275842fa27faeffecda5ce40f82d07e5865fedbd126e32c7d077e942b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0

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