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.2.tar.gz (3.7 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.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tree_types-0.2.2.tar.gz
  • Upload date:
  • Size: 3.7 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.2.tar.gz
Algorithm Hash digest
SHA256 052399bd0a611bdc1513e60ebcdd50670ccbd5fb6ccc38e0af5bcd2fc5b7e9e9
MD5 72f57ec91e88c21dc5b9281349f9e86c
BLAKE2b-256 9dd302e201a94a9b33248c090b6de1f4e9a4f3797286b892a3d1fe3f205bc69b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tree_types-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a2c8cf7bafb70894f1851916f0f823bb08dd7d1d27fb4726b7c2d7e1fa1a2c3
MD5 fa8cf1642e9041ac8be0f150c1455ceb
BLAKE2b-256 deb701117db0c231743c3563a526ebb08df291f660b4865a6c517fec1472c40f

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