gws_core

Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

Utils

Functions
get_model_type @classmethod

Get the type of a registered model using its litteral type

type_str : str
Return type : Optional
model_type_exists @classmethod
type_str : str
Return type : bool
stringify_type @classmethod
type_ : Type
include_module : bool - False
assert_json_equals @staticmethod

Assert a json with possibility to ignore key

json_1 : Union
json_2 : Union
ignore_keys : List
generate_unique_str_for_list @staticmethod

Generate a unique str for a list of str. Append _1, _2... at the end if the str is already in the list

list_ : List
str_ : str
Return type : str
get_all_subclasses @staticmethod

Return all the subclasses type of a class, it does not include the main class

class_ : Type
class to retrieve the subclasses
Return type : Set
get_literal_values @staticmethod

Return the list of literal values

literal_type : Any
Return type : List
get_parent_classes @staticmethod

Return a list of parent class of class_ arg (containing class_).

class_ : Type
[description]
max_parent : Type
if provided, doesn't return parent of max_parent class
Return type : List
is_json @staticmethod

Check if an object is a json. Ok is type is primitive or a list or a dict containing list dict or primitive...

obj : Any
Return type : bool
is_primitive @staticmethod

Check if an object is a primitive type

obj : Any
Return type : bool
issubclass @staticmethod

issubclass safe that check the input is a class and avoid exception

_Utils__cls : type
_Utils__class_or_tuple : Union
Return type : bool
json_are_equals @staticmethod

Check if two json are equals

json1 : Any
json2 : Any
Return type : bool
json_equals @staticmethod

Assert a json with possibility to ignore key

json_1 : Union
json_2 : Union
ignore_keys : List
Return type : bool
rename_duplicate_in_str_list @staticmethod

Rename all duplicated element in a list of str with _1, _2... at the end

list_ : List
Return type : List
sort_dict_by_key @staticmethod
json_dict : Any
value_is_in_literal @staticmethod

Check wheter a value in in a listeral list

value : Any
literal_type : Any
Return type : bool
walk_dir @staticmethod
path : Any
Return type : Tuple