Skip to main content

A Class that computes the types of elements in a Object

Project description

tree_types

A module that help with identifying the types of objects in a list or dictionary.

How to use

After installing it with pip install, import in your project and use as follows:

from tree_types import TreeTypes

obj = {
    'v1': [1, 2, 3, 4],
    'v2': {
        'v1': 1,
        'v2': 2
    }
}

tt = TreeTypes(obj)
tt.process()

print(tt)
>> <TreeTypes(type=dict[str,list[int]|dict[str,int]])>

Print Mode

You can chose how the Class will print the class tree by using the arg print_mode during instancing of class.

The arg receives a instance of the class PrintMode that is defined in this module too. It is defined as a Enum that has 2 modes:

  • Class mode: the Tree is printed as a Class like the exemple above.
  • Pretty mode: the Tree is printed as a text class, with indication of the itens in the object with the type of the item.

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

tree_types-0.2.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

tree_types-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file tree_types-0.2.0.tar.gz.

File metadata

  • Download URL: tree_types-0.2.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for tree_types-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0d3219ad4bda43319fb3b07a046ef0e551b70eb5e94dace7ac44334e993f469e
MD5 a0df574ba4f6336f529c99a4db0e788a
BLAKE2b-256 593e9d0c2e8d6fbb11c89d339aa74a0e0a9909a0878909681b02f66a1306807e

See more details on using hashes here.

File details

Details for the file tree_types-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tree_types-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for tree_types-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2489fb86a1120e59fe4b732a3477046d5bb15d5888a0c78c4a774f237f66190
MD5 ea37274b9cd33a508fcc310cc7de9085
BLAKE2b-256 5d635591bc451944fb9887e60020db17da332603a30a983764d0dd6dae069816

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