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.1.tar.gz (3.5 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.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tree_types-0.2.1.tar.gz
  • Upload date:
  • Size: 3.5 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.1.tar.gz
Algorithm Hash digest
SHA256 64f3f2d2e305ce0ec0219b8ad5c049f85cf30feb293b5ce04db96e25afd9a09b
MD5 9d4ff105d5a099aacd82f77d281a4da9
BLAKE2b-256 4412b94d9ae11a6904b158abd752d86fb9e54b4f470c8b47c5a8d63102df7304

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tree_types-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28b2a764dde664206e82a0181ec1fe510df98dfc9ffa74e53fc6040c8d29fa75
MD5 3c84aa410e7362ea90b9c5a6a0fa0ef2
BLAKE2b-256 341836fab39636e88def81a4d8d4d353acd6dac504794622bf3a1d4129c0f286

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