Skip to main content

A Python package for managing tables with content, read-only indices, and size constraints.

Project description

Extended Dictionary Python Package

This Python package that defines the Table class, which represents a table with content, read-only indices, and size constraints. It provides various methods and properties to manage a table with content, enforce size limits, and support operations such as adding, removing, and retrieving items.

Features

  • Table Class: A class to represent and manage tables with content and size constraints.
  • Size Constraints: Supports properties for setting minimum and maximum size limits.
  • Read-Only Indices: Manages indices in a read-only manner.

Installation

To install this package, simply use pip:

pip install extdict

Example Usage

from extdict import Table

new_table = Table({0: 2}) + Table({1: 2, 2: 3})
new_table.minimum_size = 3

print(new_table) # {0: 2, 1: 2, 2: 3}
print(new_table.find_index(2)) # (0, 1)

try:
    print(new_table - Table({2: 3}))
except KeyError: # Minimum size has been reached
    new_table.minimum_size = 2
    print(new_table - Table({2: 3})) # {0: 2, 1: 2}

new_table.read_only_indices = {0}
new_table[1] = 0

try:
    new_table[0] = False
except KeyError: # Index 0 is read-only
    new_table.read_only_indices.remove(0)
    new_table[0] = True

print(new_table) # {0: True, 1: 0, 2: 3}

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

extdict-1.0.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

extdict-1.0.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file extdict-1.0.0.tar.gz.

File metadata

  • Download URL: extdict-1.0.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for extdict-1.0.0.tar.gz
Algorithm Hash digest
SHA256 491e651b60f6a17e7aee5b5f7c1fe61dceb6e41c2bfbfeaa073720b6960517e5
MD5 306df30e6b2e6dba6bb3da482fcdee08
BLAKE2b-256 b614cff2b9fab69a704fd517ffa9558f3f26a1c5406ba904946106b154f7e025

See more details on using hashes here.

File details

Details for the file extdict-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: extdict-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for extdict-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7d512b10944be7c817aaa46ee4212e0f69daa6e22d19cf222dd93b93540e2f3
MD5 d04fb332ce93013cedffcec068c13da6
BLAKE2b-256 ccf16f9618258a0b468dd00c88829d1d13adc07bbf7cfe25855fa4c40a48e07d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page