diff --git a/src/autofaker/autodata.py b/src/autofaker/autodata.py index 792a09b..d7f9092 100644 --- a/src/autofaker/autodata.py +++ b/src/autofaker/autodata.py @@ -1,5 +1,6 @@ """ -Provides classes for anonymous object creation to help minimize the setup/arrange phase when writing unit tests +Provides classes for anonymous object creation to help minimize +the setup/arrange phase when writing unit tests """ import typing @@ -11,7 +12,8 @@ class Autodata: """ - Provides anonymous object creation functions to help minimize the setup/arrange phase when writing unit tests + Provides anonymous object creation functions to help minimize + the setup/arrange phase when writing unit tests """ @staticmethod @@ -19,19 +21,27 @@ def create(t, use_fake_data: bool = False): """ Creates an anonymous variable of the requested type - :param type t: type - The type to generate data for - :param use_fake_data: bool - Set this to True to use Faker to generate data, otherwise False to generate anonymous data + :param type t: + type - The type to generate data for + :param use_fake_data: + bool - Set this to True to use Faker to generate data + otherwise False to generate anonymous data """ return TypeDataGenerator.create(t, use_fake_data=use_fake_data).generate() @staticmethod def create_many(t, size: int = 3, use_fake_data: bool = False) -> List[typing.Any]: """ - Creates a list of anonymous variables of the requested type using the specified length (default 3) + Creates a list of anonymous variables of the requested + type using the specified length (default 3) - :param type t: type - The type to generate data for - :type size: int - The number of items to generate (default 3) - :param use_fake_data: bool - Set this to True to use Faker to generate data, otherwise False to generate anonymous data + :param type t: + type - The type to generate data for + :type size: + int - The number of items to generate (default 3) + :param use_fake_data: + bool - Set this to True to use Faker to generate data, + otherwise False to generate anonymous data """ items = [] for _ in range(size): @@ -41,10 +51,16 @@ def create_many(t, size: int = 3, use_fake_data: bool = False) -> List[typing.An @staticmethod def create_pandas_dataframe(t, rows: int = 3, use_fake_data: bool = False): """ - Create a Pandas DataFrame containing anonymous data with the specified number of rows (default 3) + Create a Pandas DataFrame containing anonymous data + with the specified number of rows (default 3) - :param type t: object - The class that represents the DataFrame. This can be a plain old class or a @dataclass - :param type rows: int - The number of rows to generate for the DataFrame (default 3) - :param use_fake_data: bool - Set this to True to use Faker to generate data, otherwise False to generate anonymous data + :param type t: + object - The class that represents the DataFrame. + This can be a plain old class or a @dataclass + :param type rows: + int - The number of rows to generate for the DataFrame (default 3) + :param use_fake_data: + bool - Set this to True to use Faker to generate data, + otherwise False to generate anonymous data """ return PandasDataFrameGenerator(t, rows, use_fake_data=use_fake_data).generate()