Metadata-Version: 2.4
Name: tree_types
Version: 0.2.0
Summary: A Class that computes the types of elements in a Object
Author-email: Mayron Moura Soares Junior <mayronjunior5@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/mayronjr/tree-types
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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.
