### Get Arguments Example Source: https://marketsquare.github.io/robotframework-faker Retrieve the value of a specific argument within a group or the entire group as a dictionary. This is used in conjunction with the set_arguments() method. ```python generator.get_arguments('small', 'max_value') generator.get_arguments('small') ``` -------------------------------- ### Get Providers Source: https://marketsquare.github.io/robotframework-faker Returns a list of all added providers. ```APIDOC ## Get Providers ### Description Returns added providers. ### Arguments - self ### Return Type List[BaseProvider] ``` -------------------------------- ### Xml Provider Source: https://marketsquare.github.io/robotframework-faker Returns some XML. This provider requires the xmltodict library to be installed. ```APIDOC ## Xml ### Description Returns some XML. ### Arguments * `nb_elements` (int) - Optional - Number of elements for the dictionary. Defaults to 10. * `variable_nb_elements` (bool) - Optional - Use variable number of elements for the dictionary. Defaults to True. * `value_types` (List[Type] | Tuple[Type, ...] | None) - Optional - Type of dictionary values. Defaults to None. * `allowed_types` (List[Type] | Tuple[Type, ...] | None) - Optional - Allowed types for dictionary values. Defaults to None. ### Return Type str ### Documentation Returns some XML. :nb_elements: number of elements for dictionary :variable_nb_elements: is use variable number of elements for dictionary :value_types: type of dictionary values Note: this provider required xmltodict library installed ``` -------------------------------- ### Random Sampling Examples Source: https://marketsquare.github.io/robotframework-faker Demonstrates various ways to use `fake.random_elements` for sampling with and without replacement, controlling length and using weighted distributions. ```robotframework :sample: elements=('a', 'b', 'c', 'd'), unique=False ``` ```robotframework :sample: elements=('a', 'b', 'c', 'd'), unique=True ``` ```robotframework :sample: elements=('a', 'b', 'c', 'd'), length=10, unique=False ``` ```robotframework :sample: elements=('a', 'b', 'c', 'd'), length=4, unique=True ``` ```robotframework :sample: elements=OrderedDict([ ("a", 0.45), ("b", 0.35), ("c", 0.15), ("d", 0.05), ]), length=20, unique=False ``` ```robotframework :sample: elements=OrderedDict([ ("a", 0.45), ("b", 0.35), ("c", 0.15), ("d", 0.05), ]), unique=True ``` -------------------------------- ### Float Conversion Example Source: https://marketsquare.github.io/robotframework-faker Conversion is done using Python's float built-in function. Spaces and underscores can be used as visual separators for digit grouping. ```python 3.14 ``` ```python 2.9979e8 ``` ```python 10 000.000 01 ``` -------------------------------- ### Iso 8601 Source: https://marketsquare.github.io/robotframework-faker Gets an ISO 8601 formatted string for a datetime between the UNIX epoch and now. ```APIDOC ## Iso 8601 ### Description Get an ISO 8601 string for a datetime between the UNIX epoch and now. ### Arguments - **tzinfo** (tzinfo | None) - Optional - timezone, instance of datetime.tzinfo subclass. - **end_datetime** (date | datetime | timedelta | string | int | None) - Optional - A `DateParseType`. Defaults to the current date and time. - **sep** (string) - Optional - separator between date and time, defaults to 'T'. - **timespec** (string) - Optional - format specifier for the time part, defaults to 'auto' - see datetime.isoformat() documentation. ### Return Type string ``` -------------------------------- ### Get Arguments Source: https://marketsquare.github.io/robotframework-faker Retrieves the value of an argument configured within an argument group, or the entire group as a dictionary. ```APIDOC ## Get Arguments ### Arguments self group str argument = None str | None ### Return Type Any ### Documentation Get the value of an argument configured within a argument group, or the entire group as a dictionary. Used in conjunction with the set_arguments() method. generator.get_arguments('small', 'max_value') generator.get_arguments('small') ``` -------------------------------- ### Get Formatter Source: https://marketsquare.github.io/robotframework-faker Retrieves a formatter based on its name. ```APIDOC ## Get Formatter ### Arguments self formatter str ### Return Type Callable ``` -------------------------------- ### Company Source: https://marketsquare.github.io/robotframework-faker Generates a company name as a string. Example: 'Acme Ltd'. ```APIDOC ## Company ### Description Generate a company name. ### Return Type str ### Example 'Acme Ltd' ``` -------------------------------- ### Integer Conversion Examples Source: https://marketsquare.github.io/robotframework-faker Conversion is done using Python's int built-in function. Floating point numbers are accepted only if they can be represented as integers exactly. Supports hexadecimal, octal, and binary numbers, as well as visual separators. ```python 42 ``` ```python -1 ``` ```python 0b1010 ``` ```python 10 000 000 ``` ```python 0xBAD_C0FFEE ``` -------------------------------- ### Company Suffix Source: https://marketsquare.github.io/robotframework-faker Generates a company suffix as a string. Example: 'Ltd'. ```APIDOC ## Company Suffix ### Description Generate a company suffix. ### Return Type str ### Example 'Ltd' ``` -------------------------------- ### None Data Type Example Source: https://marketsquare.github.io/robotframework-faker The string 'NONE' (case-insensitive) is converted to Python's None object. Other values will result in an error. ```robotframework NONE ``` -------------------------------- ### Literal Data Type Example Source: https://marketsquare.github.io/robotframework-faker Only specified values are accepted and converted using value type specific logic. Strings are case, space, underscore, and hyphen insensitive. ```robotframework value ``` -------------------------------- ### Get Words List Source: https://marketsquare.github.io/robotframework-faker Retrieves a list of words based on the specified part of speech or a custom word list. ```APIDOC ## Get Words List ### Description Get list of words. `ext_word_list` is a parameter that allows the user to provide a list of words to be used instead of the built-in word list. If `ext_word_list` is provided, then the value of `part_of_speech` is ignored. `part_of_speech` is a parameter that defines to what part of speech the returned word belongs. If `ext_word_list` is not `None`, then `part_of_speech` is ignored. If the value of `part_of_speech` does not correspond to an existent part of speech according to the set locale, then an exception is raised. :sample: part_of_speech="abc", ext_word_list=['abc', 'def', 'ghi', 'jkl'] :sample: part_of_speech="abc" :sample: ext_word_list=['abc', 'def', 'ghi', 'jkl'] .. warning:: Depending on the length of a locale provider's built-in word list or on the length of `ext_word_list` if provided, a large `nb` can exhaust said lists if `unique` is `True`, raising an exception. ### Arguments - part_of_speech (str | None) - Optional: Defines the part of speech for the returned words. Ignored if `ext_word_list` is provided. - ext_word_list (Sequence[str] | None) - Optional: A list of words to use instead of the built-in list. If provided, `part_of_speech` is ignored. ### Return Type List[str] ``` -------------------------------- ### Dictionary Literal Example Source: https://marketsquare.github.io/robotframework-faker Strings must be Python dictionary literals. They are converted to actual dictionaries using ast.literal_eval. Supports nested types. ```python {'a': 1, 'b': 2} ``` ```python {'key': 1, 'nested': {'key': 2}} ``` -------------------------------- ### List Data Type Example Source: https://marketsquare.github.io/robotframework-faker Strings must be Python list literals and are converted using ast.literal_eval. Nested types are automatically converted in Robot Framework 6.0+. ```robotframework ['one', 'two'] ``` ```robotframework [('one', 1), ('two', 2)] ``` -------------------------------- ### Generate Image with Polygon Source: https://marketsquare.github.io/robotframework-faker Generates an image with a random polygon drawn on it. Requires the Python Image Library (Pillow) to be installed. The image can be customized by size, format, hue, and luminosity. ```robotframework >>> image(size=(2, 2), hue='purple', luminosity='bright', image_format='pdf') ``` ```robotframework >>> image(size=(16, 16), hue=[90,270], image_format='ico') ``` -------------------------------- ### Time Series Source: https://marketsquare.github.io/robotframework-faker Returns a generator yielding tuples of (datetime, value), creating a time series with specified start date, end date, precision, and distribution. ```APIDOC ## Time Series ### Description Returns a generator yielding tuples of `(, )`. The data points will start at `start_date`, and be at every time interval specified by `precision`. ### Arguments - **start_date** (date | datetime | timedelta | str | int) - Optional. Defaults to `"-30d"`. - **end_date** (date | datetime | timedelta | str | int) - Optional. Defaults to `"now"`. - **precision** (float | None) - Optional. A float representing the time interval between data points. Defaults to 1/30th of the time. - **distrib** (Callable [datetime, float] | None) - Optional. A callable that accepts a datetime object and returns a value. Defaults to a uniform distribution. - **tzinfo** (tzinfo | None) - Optional. Timezone, instance of datetime.tzinfo subclass. ### Return Type Iterator [Tuple [datetime, Any] ] ### Sample ``` -------------------------------- ### Unix Time Source: https://marketsquare.github.io/robotframework-faker Get a timestamp between January 1, 1970 and now. Customizable with start and end datetimes. ```APIDOC ## Unix Time ### Arguments - `end_datetime` (date | datetime | timedelta | str | int | None, optional): The end of the time range. Defaults to the UNIX epoch. - `start_datetime` (date | datetime | timedelta | str | int | None, optional): The start of the time range. Defaults to the current date and time. ### Return Type float ### Documentation Get a timestamp between January 1, 1970 and now, unless passed explicit `start_datetime` or end_datetime values. On Windows, the decimal part is always 0. ### Parameters - `end_datetime`: A `DateParseType`. Defaults to the UNIX epoch - `start_datetime`: A `DateParseType`. Defaults to the current date and time ### Sample Usage ```python # Get a timestamp within the default range (epoch to now) timestamp = faker_instance.unix_time() # Get a timestamp within a custom range from datetime import datetime, timedelta start = datetime.now() - timedelta(days=1) end = datetime.now() timestamp_custom = faker_instance.unix_time(start_datetime=start, end_datetime=end) ``` ``` -------------------------------- ### Bs String Generation Source: https://marketsquare.github.io/robotframework-faker Generates a sample string, useful for quick placeholder text. ```APIDOC ## Bs ### Description Generate a sample string. ### Return Type str ### Example 'integrate extensible convergence' ``` -------------------------------- ### Safari Source: https://marketsquare.github.io/robotframework-faker Generate a Safari web browser user agent string. ```APIDOC ## Safari ### Description Generate a Safari web browser user agent string. ### Return Type str ``` -------------------------------- ### Profile Source: https://marketsquare.github.io/robotframework-faker Generates a complete profile. If 'fields' is not empty, only the fields in the list will be returned. ```APIDOC ## Profile ### Description Generates a complete profile. If "fields" is not empty, only the fields in the list will be returned. ### Arguments - **fields** (List[str] | None) - Optional. If provided, only these fields will be returned. - **sex** (Literal['M', 'F', 'X'] | None) - Optional. Specifies the sex for the profile ('M' for Male, 'F' for Female, 'X' for Nonbinary). ### Return Type Dict[str, str | Tuple[Decimal, Decimal] | List[str] | date ] ``` -------------------------------- ### Ean 8 Source: https://marketsquare.github.io/robotframework-faker Generates an EAN-8 barcode. It can optionally start with specified prefixes. ```APIDOC ## Ean 8 ### Description Generate an EAN-8 barcode. This method uses `ean` under the hood with the `length` argument explicitly set to `8`. If a value for `prefixes` is specified, the result will begin with one of the sequences in `prefixes`. ### Arguments - **prefixes** (Tuple[int | str | Tuple[int | str, ...], ...]) - Optional - Prefixes for the EAN-8 barcode. ### Return Type str ### Sample Usage ```python prefixes=('00',) prefixes=('45', '49') ``` ``` -------------------------------- ### Linux Platform Token Source: https://marketsquare.github.io/robotframework-faker Generate a Linux platform token for user agent strings. ```APIDOC ## Linux Platform Token ### Return Type str ### Documentation Generate a Linux platform token used in user agent strings. ``` -------------------------------- ### Pyint Source: https://marketsquare.github.io/robotframework-faker Generates a random integer within a specified range and step. ```APIDOC ## Pyint ### Description Generates a random integer. ### Arguments * **min_value** (int) - Optional. Defaults to 0. The minimum value for the integer. * **max_value** (int) - Optional. Defaults to 9999. The maximum value for the integer. * **step** (int) - Optional. Defaults to 1. The step between possible integer values. ### Return Type int ``` -------------------------------- ### Generate Hostname with Subdomain Levels Source: https://marketsquare.github.io/robotframework-faker Produces a hostname with a specified number of subdomain levels. Defaults to 1 level if not specified. ```robotframework >>> hostname() db-01.nichols-phillips.com >>> hostname(0) laptop-56 >>> hostname(2) web-12.williamson-hopkins.jackson.com ``` -------------------------------- ### Future Datetime Source: https://marketsquare.github.io/robotframework-faker Gets a datetime object based on a random date between 1 second from now and a given date. ```APIDOC ## Future Datetime ### Arguments end_date = +30d date | datetime | timedelta | str | int tzinfo = None tzinfo | None ### Return Type datetime ### Documentation Get a datetime object based on a random date between 1 second form now and a given date. :param end_date: A `DateParseType`. Defaults to `"+30d"` :param tzinfo: timezone, instance of datetime.tzinfo subclass :sample: :sample: end_date='+1y' ``` -------------------------------- ### Chrome Source: https://marketsquare.github.io/robotframework-faker Generates a Chrome web browser user agent string. ```APIDOC ## Chrome ### Description Generate a Chrome web browser user agent string. ### Arguments * `version_from` (int, optional, default=13) - The starting version for the user agent. * `version_to` (int, optional, default=63) - The ending version for the user agent. * `build_from` (int, optional, default=800) - The starting build number for the user agent. * `build_to` (int, optional, default=899) - The ending build number for the user agent. ### Return Type string ``` -------------------------------- ### Future Date Source: https://marketsquare.github.io/robotframework-faker Gets a Date object based on a random date between 1 day from now and a given date. ```APIDOC ## Future Date ### Arguments end_date = +30d date | datetime | timedelta | str | int ### Return Type date ### Documentation Get a Date object based on a random date between 1 day from now and a given date. :param end_date: A `DateParseType`. Defaults to `"+30d"` :param tzinfo: timezone, instance of datetime.tzinfo subclass :sample: :sample: end_date='+1y' ``` -------------------------------- ### Date Object Source: https://marketsquare.github.io/robotframework-faker Get a date object between January 1, 1970 and now. Accepts an optional end_datetime argument. ```APIDOC ## Date Object ### Description Get a date object between January 1, 1970 and now. ### Arguments - **end_datetime** (datetime | None) - Optional - Defaults to the current date and time. ### Return Type date ### Sample :sample: end_datetime='+1w' ``` -------------------------------- ### Pytuple Source: https://marketsquare.github.io/robotframework-faker Generates a tuple of fake data elements. Allows customization of the number of elements, whether the number of elements is variable, and the types of values to include. ```APIDOC ## Pytuple #### Arguments nb_elements = 10 int variable_nb_elements = True bool value_types = None List [ Type ] | Tuple [ Type , ... ] | None allowed_types = None List [ Type ] | Tuple [ Type , ... ] | None #### Return Type Tuple [Any, ... ] ``` -------------------------------- ### Boolean Generation Source: https://marketsquare.github.io/robotframework-faker Generates a random boolean value. The probability of getting 'true' can be controlled by the `chance_of_getting_true` argument. ```APIDOC ## Boolean ### Description Generate a random boolean value based on `chance_of_getting_true`. ### Arguments * **chance_of_getting_true** (int) - Optional, defaults to 50. The probability (0-100) of returning True. ### Return Type bool ### Examples chance_of_getting_true=25 chance_of_getting_true=50 chance_of_getting_true=75 ``` -------------------------------- ### hostname Source: https://marketsquare.github.io/robotframework-faker Produces a hostname with a specified number of subdomain levels. ```APIDOC ## hostname ### Description Produce a hostname with specified number of subdomain levels. ### Arguments - levels (int, optional): The number of subdomain levels. Defaults to 1. ### Return Type str ### Examples ```robotframework ${hostname} = hostname() ${hostname_0} = hostname(0) ${hostname_2} = hostname(2) ``` ``` -------------------------------- ### Past Datetime Source: https://marketsquare.github.io/robotframework-faker Get a datetime object based on a random date between a given date and 1 second ago. ```APIDOC ## Past Datetime ### Description Get a datetime object based on a random date between a given date and 1 second ago. ### Arguments - **start_date** (date | datetime | timedelta | str | int | tzinfo) - Optional - Defaults to "-30d" - **tzinfo** (tzinfo) - Optional - timezone, instance of datetime.tzinfo subclass ### Return Type datetime ### Example datetime('1999-02-02 11:42:52') ### Sample end_date='+1y' ``` -------------------------------- ### Nic Handles Source: https://marketsquare.github.io/robotframework-faker Generates a list of NIC Handle IDs. ```APIDOC ## Nic Handles ### Description Returns NIC Handle ID list. ### Arguments - **count** (int, optional, default=1) - The number of NIC Handles to generate. - **suffix** (str, optional, default='????') - The suffix for the NIC Handles. ### Return Type List [str] ### Documentation Returns NIC Handle ID list :rtype: list[str] ``` -------------------------------- ### Pylist Source: https://marketsquare.github.io/robotframework-faker Returns a list with a specified number of elements and value types. ```APIDOC ## Pylist ### Description Returns a list. ### Arguments * **nb_elements** (int) - Optional. Defaults to 10. The number of elements for the list. * **variable_nb_elements** (bool) - Optional. Defaults to True. If True, the list will have a variable number of elements. * **value_types** (List[Type] | Tuple[Type, ...] | None) - Optional. Specifies the types of the list elements. * **allowed_types** (List[Type] | Tuple[Type, ...] | None) - Optional. Specifies the allowed types for the list elements. ### Return Type List[Any] ``` -------------------------------- ### Past Date Source: https://marketsquare.github.io/robotframework-faker Get a Date object based on a random date between a given date and 1 day ago. ```APIDOC ## Past Date ### Description Get a Date object based on a random date between a given date and 1 day ago. ### Arguments - **start_date** (date | datetime | timedelta | str | int | tzinfo) - Optional - Defaults to "-30d" - **tzinfo** (tzinfo) - Optional - timezone, instance of datetime.tzinfo subclass ### Return Type date ### Sample start_date='-1y' ``` -------------------------------- ### Http Method Source: https://marketsquare.github.io/robotframework-faker Returns a random HTTP method. ```APIDOC ## Http Method ### Description Returns random HTTP method. ### Return Type str ### Examples ```robotframework ${method} = Http Method() ``` ``` -------------------------------- ### Date This Month Source: https://marketsquare.github.io/robotframework-faker Gets a Date object for the current month. Allows specifying whether to include days before or after today. ```APIDOC ## Date This Month ### Description Gets a Date object for the current month. ### Arguments - **before_today** (bool) - Optional - include days in current month before today. Defaults to True. - **after_today** (bool) - Optional - include days in current month after today. Defaults to False. ### Return Type date ### Sample :sample: before_today=False, after_today=True ``` -------------------------------- ### Simple Profile Source: https://marketsquare.github.io/robotframework-faker Generates a basic profile containing personal information. The profile includes details that can vary based on the optional `sex` argument. ```APIDOC ## Simple Profile ### Description Generates a basic profile with personal information. ### Arguments - **sex** (Literal [ 'M' , 'F' , 'X' ] | None) - Optional, defaults to `None`. Specifies the sex for the profile. ### Return Type Dict [str, str | date | Literal [ 'M' , 'F' , 'X' ] ] ``` -------------------------------- ### Date This Century Source: https://marketsquare.github.io/robotframework-faker Gets a Date object for the current century. Allows specifying whether to include days before or after today. ```APIDOC ## Date This Century ### Description Gets a Date object for the current century. ### Arguments - **before_today** (bool) - Optional - include days in current century before today. Defaults to True. - **after_today** (bool) - Optional - include days in current century after today. Defaults to False. ### Return Type date ### Sample :sample: before_today=False, after_today=True ``` -------------------------------- ### Generate Color with Hue and Luminosity Source: https://marketsquare.github.io/robotframework-faker Generate a color in a human-friendly way. Controls hue, luminosity, and output color format. ```robotframework Generate Color hue='red' ``` ```robotframework Generate Color luminosity='light' ``` ```robotframework Generate Color hue=(100, 200), color_format='rgb' ``` ```robotframework Generate Color hue='orange', luminosity='bright' ``` ```robotframework Generate Color hue=135, luminosity='dark', color_format='hsv' ``` ```robotframework Generate Color hue=(300, 20), luminosity='random', color_format='hsl' ``` -------------------------------- ### Name Source: https://marketsquare.github.io/robotframework-faker Generates a full name as a string. ```APIDOC ## Name ### Description Generates a full name as a string. ### Return Type str ### Documentation :example: 'John Doe' ``` -------------------------------- ### Generate Datetime for Current Year Source: https://marketsquare.github.io/robotframework-faker Gets a datetime object for the current year. Can include days before or after today, and specify a timezone. ```robotframework *** Keywords *** Get Datetime This Year Example ${datetime}= Faker.Date Time This Year before_now=${True} after_now=${False} Log ${datetime} ``` -------------------------------- ### Generate Domain Name by Date Source: https://marketsquare.github.io/robotframework-faker Generates a domain name using a Domain Generation Algorithm (DGA) based on a given date and optional parameters like TLD and length. ```robotframework *** Keywords *** Generate DGA Example ${domain}= Faker.Dga year=${2023} month=${10} day=${26} tld=${'com'} length=${10} Log ${domain} ``` -------------------------------- ### Generate Datetime for Current Month Source: https://marketsquare.github.io/robotframework-faker Gets a datetime object for the current month. Can include days before or after today, and specify a timezone. ```robotframework *** Keywords *** Get Datetime This Month Example ${datetime}= Faker.Date Time This Month before_now=${True} after_now=${False} Log ${datetime} ``` -------------------------------- ### Date Time Source: https://marketsquare.github.io/robotframework-faker Get a datetime object for a date between January 1, 1970 and a specified end_datetime. Supports timezone information. ```APIDOC ## Date Time ### Description Get a datetime object for a date between January 1, 1970 and a specified end_datetime. Supports timezone information. ### Arguments - **tzinfo** (tzinfo | None) - Optional - timezone, instance of datetime.tzinfo subclass. Defaults to None - **end_datetime** (date | datetime | timedelta | str | int | None) - Optional - A `DateParseType`. Defaults to the current date and time ### Return Type datetime ### Sample ```python # Example usage (assuming the function is imported and available) # datetime_func(end_datetime="2024-12-31 23:59:59") ``` ``` -------------------------------- ### Format Source: https://marketsquare.github.io/robotframework-faker Provides a secure way to create a fake data entry from another Provider. ```APIDOC ## Format ### Arguments self formatter str * args Any ** kwargs Any ### Return Type str ### Documentation This is a secure way to make a fake from another Provider. ``` -------------------------------- ### Date This Year Source: https://marketsquare.github.io/robotframework-faker Gets a Date object for the current year. It can include days before or after today based on the provided boolean arguments. ```APIDOC ## Date This Year ### Description Gets a Date object for the current year. It can include days before or after today based on the provided boolean arguments. ### Arguments - **before_today** (bool) - Optional - include days in current year before today. Defaults to True - **after_today** (bool) - Optional - include days in current year after today. Defaults to False ### Return Type date ### Sample ```python # Example usage (assuming the function is imported and available) # date_this_year(before_today=False, after_today=True) ``` ``` -------------------------------- ### Date This Decade Source: https://marketsquare.github.io/robotframework-faker Gets a Date object for the current decade year. Allows specifying whether to include days before or after today. ```APIDOC ## Date This Decade ### Description Gets a Date object for the decade year. ### Arguments - **before_today** (bool) - Optional - include days in current decade before today. Defaults to True. - **after_today** (bool) - Optional - include days in current decade after today. Defaults to False. ### Return Type date ### Sample :sample: before_today=False, after_today=True ``` -------------------------------- ### Lexify Source: https://marketsquare.github.io/robotframework-faker Generate a string by replacing placeholders with random characters. ```APIDOC ## Lexify ### Arguments - text (str, optional): Defaults to '????'. - letters (str, optional): Defaults to 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'. ### Return Type str ### Documentation Generate a string with each question mark ('?') in `text` replaced with a random character from `letters`. By default, `letters` contains all ASCII letters, uppercase and lowercase. :sample: text='Random Identifier: ??????????' :sample: text='Random Identifier: ??????????', letters='ABCDE' ``` -------------------------------- ### Date Source: https://marketsquare.github.io/robotframework-faker Generates a date string between January 1, 1970, and the current date, with a customizable pattern. ```APIDOC ## Date ### Description Get a date string between January 1, 1970 and now. ### Arguments - **pattern** (str): Format of the date (year-month-day by default). - **end_datetime** (date | datetime | timedelta | str | int | None): A `DateParseType`. Defaults to the current date and time. ### Return Type str ### Example :sample: pattern='%m/%d/%Y' :sample: end_datetime='+1w' ``` -------------------------------- ### Ean 13 Source: https://marketsquare.github.io/robotframework-faker Generates an EAN-13 barcode. Allows control over whether the barcode starts with a zero, and supports custom prefixes. ```APIDOC ## Ean 13 ### Description Generate an EAN-13 barcode. If `leading_zero` is `True`, the leftmost digit of the barcode will be set to `0`. If `False`, the leftmost digit cannot be `0`. If `None` (default), the leftmost digit can be any digit. If a value for `prefixes` is specified, the result will begin with one of the sequences in `prefixes` and will ignore `leading_zero`. This method uses the standard barcode provider's |ean13| under the hood with the `prefixes` argument set to the correct value to attain the behavior described above. ### Arguments - `prefixes` (Tuple[int | str | Tuple[int | str, ...], ...], optional, default=()): A tuple of sequences to prefix the generated barcode. If specified, this overrides `leading_zero`. - `leading_zero` (bool | None, optional, default=None): Controls whether the barcode starts with a zero. ### Return Type str: The generated EAN-13 barcode as a string. ### Sample Usage ```robotframework ${ean13} = Ean 13 ${ean13_no_leading_zero} = Ean 13 leading_zero=False ${ean13_with_leading_zero} = Ean 13 leading_zero=True ${ean13_with_prefix} = Ean 13 prefixes=('45', '49') ``` ``` -------------------------------- ### Random Sampling with Replacement Source: https://marketsquare.github.io/robotframework-faker Use `fake.random_elements` with `unique=False` to sample elements with replacement, respecting specified weights. The `elements` argument can be an OrderedDict for weighted sampling. ```robotframework fake.random_elements( elements=OrderedDict([ ("variable_1", 0.5), # Generates "variable_1" 50% of the time ("variable_2", 0.2), # Generates "variable_2" 20% of the time ("variable_3", 0.2), # Generates "variable_3" 20% of the time ("variable_4": 0.1), # Generates "variable_4" 10% of the time ]), unique=False ) ``` -------------------------------- ### Date Time Between Source: https://marketsquare.github.io/robotframework-faker Get a datetime object based on a random date between two given dates. Accepts date strings recognizable by strtotime(). ```APIDOC ## Date Time Between ### Description Get a datetime object based on a random date between two given dates. Accepts date strings recognizable by strtotime(). ### Arguments - **start_date** (date | datetime | timedelta | str | int) - Optional - A `DateParseType`. Defaults to 30 years ago - **end_date** (date | datetime | timedelta | str | int) - Optional - A `DateParseType`. Defaults to "now" - **tzinfo** (tzinfo | None) - Optional - timezone, instance of datetime.tzinfo subclass. Defaults to None ### Return Type datetime ### Sample ```python # Example usage (assuming the function is imported and available) # datetime_between(start_date="2022-01-01", end_date="2023-01-01") ``` ``` -------------------------------- ### Unix Device Source: https://marketsquare.github.io/robotframework-faker Generate a Unix device file name. A random prefix is used if none is provided. ```APIDOC ## Unix Device ### Arguments - `prefix` (str | None, optional): The prefix for the device name. Valid prefixes include 'sd', 'vd', and 'xvd'. Defaults to None. ### Return Type str ### Documentation Generate a Unix device file name. If `prefix` is `None`, a random prefix will be used. The list of valid prefixes include: `'sd'`, `'vd'`, and `'xvd'`. ### Sample Usage ```python # Using a specific prefix unix_device_name = faker_instance.unix_device(prefix='mmcblk') # Using a random prefix random_unix_device_name = faker_instance.unix_device() ``` ``` -------------------------------- ### Date Time Ad Source: https://marketsquare.github.io/robotframework-faker Get a datetime object for a date between January 1, 0001 and now. Supports timezone information and custom start/end datetimes. ```APIDOC ## Date Time Ad ### Description Get a datetime object for a date between January 1, 0001 and now. Supports timezone information and custom start/end datetimes. ### Arguments - **tzinfo** (tzinfo | None) - Optional - timezone, instance of datetime.tzinfo subclass. Defaults to None - **end_datetime** (date | datetime | timedelta | str | int | None) - Optional - A `DateParseType`. Defaults to the current date and time - **start_datetime** (date | datetime | timedelta | str | int | None) - Optional - A `DateParseType`. Defaults to UNIX timestamp `-62135596800`, equivalent to 0001-01-01 00:00:00 UTC ### Return Type datetime ### Sample ```python # Example usage (assuming the function is imported and available) # datetime_ad(start_datetime="2000-01-01", end_datetime="2023-01-01") ``` ``` -------------------------------- ### Sentences Source: https://marketsquare.github.io/robotframework-faker Generates a list of sentences. The `nb` argument specifies the number of sentences, and `ext_word_list` can provide a custom list of words. ```APIDOC ## Sentences ### Arguments - nb (int, optional, default=3): The number of sentences to generate. - ext_word_list (Sequence[str] | None, optional): A custom list of words to use for sentence generation. ### Return Type List[str] ### Documentation Generate a list of sentences. This method uses `|sentence|` under the hood to generate sentences, and the `nb` argument controls exactly how many sentences the list will contain. The `ext_word_list` argument works in exactly the same way as well. :sample: nb=5 :sample: nb=5, ext_word_list=['abc', 'def', 'ghi', 'jkl'] ``` -------------------------------- ### File Extension Source: https://marketsquare.github.io/robotframework-faker Generates a file extension, optionally filtered by category. ```APIDOC ## File Extension ### Description Generate a file extension under the specified `category`. If `category` is `None`, a random category will be used. The list of valid categories include: `'audio'`, `'image'`, `'office'`, `'text'`, and `'video'`. ### Arguments - **category** (str | None) - Optional. The category of the file extension to generate. ### Return Type str ### Sample Usage ```python category='image' ``` ``` -------------------------------- ### Generate Chrome User Agent Source: https://marketsquare.github.io/robotframework-faker Generate a Chrome web browser user agent string. Arguments control version and build ranges. ```robotframework Generate Chrome User Agent ``` -------------------------------- ### Uri Extension Source: https://marketsquare.github.io/robotframework-faker Generates a random URI extension. ```APIDOC ## Uri Extension ### Return Type str ``` -------------------------------- ### Date Time This Year Source: https://marketsquare.github.io/robotframework-faker Gets a datetime object for the current year. Allows inclusion of days before or after today within the current year, and supports timezone information. ```APIDOC ## Date Time This Year ### Description Gets a datetime object for the current year. ### Arguments * **before_now** (bool) - Optional - Include days in current year before today. Defaults to True. * **after_now** (bool) - Optional - Include days in current year after today. Defaults to False. * **tzinfo** (tzinfo | None) - Optional - Timezone, instance of datetime.tzinfo subclass. ### Return Type datetime ### Sample `before_now=False, after_now=True` ``` -------------------------------- ### Date Time This Month Source: https://marketsquare.github.io/robotframework-faker Gets a datetime object for the current month. Allows inclusion of days before or after today within the current month, and supports timezone information. ```APIDOC ## Date Time This Month ### Description Gets a datetime object for the current month. ### Arguments * **before_now** (bool) - Optional - Include days in current month before today. Defaults to True. * **after_now** (bool) - Optional - Include days in current month after today. Defaults to False. * **tzinfo** (tzinfo | None) - Optional - Timezone, instance of datetime.tzinfo subclass. ### Return Type datetime ### Sample `before_now=False, after_now=True` ``` -------------------------------- ### Pyset Source: https://marketsquare.github.io/robotframework-faker Generates a set of fake data elements. Allows customization of the number of elements, whether the number of elements is variable, and the types of values to include. ```APIDOC ## Pyset #### Arguments nb_elements = 10 int variable_nb_elements = True bool value_types = None List [ Type ] | Tuple [ Type , ... ] | None allowed_types = None List [ Type ] | Tuple [ Type , ... ] | None #### Return Type Set [Any] ``` -------------------------------- ### Internet Explorer User Agent Source: https://marketsquare.github.io/robotframework-faker Generates a user agent string for Internet Explorer. ```APIDOC ## Internet Explorer ### Description Generate an IE web browser user agent string. ### Return Type str ``` -------------------------------- ### User Agent Source: https://marketsquare.github.io/robotframework-faker Generates a random web browser user agent string. ```APIDOC ## User Agent ### Return Type str ### Documentation Generate a random web browser user agent string. ``` -------------------------------- ### Swift Source: https://marketsquare.github.io/robotframework-faker Generates a SWIFT code with optional length and primary branch designation. ```APIDOC ## Swift ### Description Generate a SWIFT code. SWIFT codes can have 8 or 11 characters. The `length` argument can be `None` (randomly assigns 8 or 11), `8`, or `11`. If `length` is `11` and `primary` is `True`, the code will end in 'XXX'. If `use_dataset` is `True`, locale-specific codes may be used; otherwise, codes are randomly generated. ### Arguments - **length** (int | None) - Optional. Specifies the length of the SWIFT code (8 or 11). Defaults to None (randomly 8 or 11). - **primary** (bool) - Optional. If True and length is 11, appends 'XXX' to denote a primary branch. Defaults to False. - **use_dataset** (bool) - Optional. If True, uses locale-specific codes if available. Defaults to False. ### Return Type string ### Examples - `length=8` - `length=8, use_dataset=True` - `length=11` - `length=11, primary=True` - `length=11, use_dataset=True` - `length=11, primary=True, use_dataset=True` ``` -------------------------------- ### Generate Random ITIN Source: https://marketsquare.github.io/robotframework-faker Generates a random United States Individual Taxpayer Identification Number (ITIN). ITINs are nine-digit numbers starting with 9, with specific ranges for the fourth and fifth digits. ```robotframework *** Settings *** Library Faker *** Test Cases *** Generate ITIN ${itin}= Faker.Itin Log ${itin} ``` -------------------------------- ### Linux Processor Source: https://marketsquare.github.io/robotframework-faker Generates a Linux processor token suitable for user agent strings. ```APIDOC ## Linux Processor ### Documentation Generate a Linux processor token used in user agent strings. ### Return Type str ``` -------------------------------- ### Generate Domain Name Source: https://marketsquare.github.io/robotframework-faker Produces an Internet domain name. The 'levels' argument specifies the number of subdomain levels. ```python fake.domain_name() ``` ```python fake.domain_name(2) ``` -------------------------------- ### Currency Code Source: https://marketsquare.github.io/robotframework-faker Returns a string representing a currency code. ```APIDOC ## Currency Code ### Description Returns a string representing a currency code. ### Return Type str ``` -------------------------------- ### City Prefix Source: https://marketsquare.github.io/robotframework-faker Generates a fake city prefix as a string. ```APIDOC ## City Prefix ### Description Generates a fake city prefix. ### Return Type string ``` -------------------------------- ### Color Source: https://marketsquare.github.io/robotframework-faker Generates a color in a human-friendly way, with options for hue, luminosity, and format. ```APIDOC ## Color ### Description Generate a color in a human-friendly way. ### Arguments * `hue` (str | float | int | Sequence[int] | None, optional, default=None) - Controls the H value of the generated color. Can be a number (0-360), a tuple/list of two numbers (range), or a string ('monochrome', 'red', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink'). * `luminosity` (str | None, optional, default=None) - Influences S and V values. Accepts 'bright', 'dark', 'light', or 'random'. * `color_format` (str, optional, default='hex') - The color model for the output. Valid values are 'hsv', 'hsl', 'rgb', or 'hex'. ### Return Type string ### Examples * `hue='red'` * `luminosity='light'` * `hue=(100, 200), color_format='rgb'` * `hue='orange', luminosity='bright'` * `hue=135, luminosity='dark', color_format='hsv'` * `hue=(300, 20), luminosity='random', color_format='hsl' ` ``` -------------------------------- ### Tar Source: https://marketsquare.github.io/robotframework-faker Generates a random valid tar file as a bytes object, with options to control its size, number of files, and compression type. ```APIDOC ## Tar ### Description Generate a bytes object containing a random valid tar file. The number and sizes of files contained inside the resulting archive can be controlled using the following arguments. ### Arguments - `uncompressed_size` (int, optional, default=65536): The total size of files before compression, 16 KiB by default. - `num_files` (int, optional, default=1): The number of files archived in the resulting tar file, 1 by default. - `min_file_size` (int, optional, default=4096): The minimum size of each file before compression, 4 KiB by default. - `compression` (str | None, optional, default=None): Specifies the compression type. Accepted values are 'bzip2' or 'bz2' for BZIP2, 'lzma' or 'xz' for LZMA, and 'gzip' or 'gz' for GZIP. No compression is used by default. ### Return Type bytes ### Sample ```python # Example usage: tar(uncompressed_size=256, num_files=4, min_file_size=32) tar(uncompressed_size=256, num_files=32, min_file_size=4, compression='bz2') ``` ``` -------------------------------- ### File Path Generation Source: https://marketsquare.github.io/robotframework-faker Generates a random file path with configurable depth, extension, and file system rules. ```APIDOC ## File Path ### Description Generate a pathname to a file. This method uses `file_name` to generate the file name itself. `depth` controls the depth of the directory path, and `word` is used to generate directory names. If `absolute` is `True` (default), the generated path starts with `/` and is absolute. Otherwise, the generated path is relative. If `extension` is used, it can be a string, a sequence of strings (one will be picked at random), or an empty sequence (the path will have no extension). If `file_system` is set (default='linux'), the generated path uses the specified file system path standard. ### Arguments - depth (int, optional, default=1): The number of directory levels in the path. - category (str | None, optional, default=None): The category to use for generating the file name's extension. - extension (str | Sequence[str] | None, optional, default=None): The extension for the file name. Can be a string, a list of strings, or an empty list/string for no extension. - absolute (bool, optional, default=True): Whether the generated path should be absolute or relative. - file_system (Literal['linux', 'windows'], optional, default='linux'): The file system standard to use for path generation. ### Return Type str: The generated file path. ### Sample Usage - `faker.file_path(size=10)` - `faker.file_path(depth=3)` - `faker.file_path(depth=5, category='video')` - `faker.file_path(depth=5, category='video', extension='abcdef')` - `faker.file_path(extension=[])` - `faker.file_path(extension='')` - `faker.file_path(extension=['a', 'bc', 'def'])` - `faker.file_path(depth=5, category='video', extension='abcdef', file_system='windows')` ``` -------------------------------- ### Windows Platform Token Source: https://marketsquare.github.io/robotframework-faker Generates a Windows platform token, which is used in user agent strings. ```APIDOC ## Windows Platform Token ### Description Generate a Windows platform token used in user agent strings. ### Return Type str ``` -------------------------------- ### Month Source: https://marketsquare.github.io/robotframework-faker Generates a month as a string. ```APIDOC ## Month ### Description Generates a month as a string. ### Return Type str ``` -------------------------------- ### Mac Platform Token Generation Source: https://marketsquare.github.io/robotframework-faker Generates a token string suitable for use in MacOS user agent strings. ```APIDOC ## Mac Platform Token ### Description Generate a MacOS platform token used in user agent strings. ### Return Type str ### Example ```python faker.mac_platform_token() ``` ``` -------------------------------- ### Unix Partition Source: https://marketsquare.github.io/robotframework-faker Generate a Unix partition name. This method utilizes `unix_device()` internally. ```APIDOC ## Unix Partition ### Arguments - `prefix` (str | None, optional): The prefix for the partition name. Defaults to None. ### Return Type str ### Documentation Generate a Unix partition name. This method uses |unix_device| under the hood to create a device file name with the specified `prefix`. ### Sample Usage ```python # Using a specific prefix partition_name = faker_instance.unix_partition(prefix='mmcblk') # Using a default prefix (if any) partition_name_default = faker_instance.unix_partition() ``` ``` -------------------------------- ### Generate Random HTTP Method Source: https://marketsquare.github.io/robotframework-faker Returns a random HTTP method. Refer to MDN documentation for a list of methods. ```robotframework >>> http_method() 'GET' ``` -------------------------------- ### Currency Name Source: https://marketsquare.github.io/robotframework-faker Returns a string representing a currency name. ```APIDOC ## Currency Name ### Description Returns a string representing a currency name. ### Return Type str ``` -------------------------------- ### Catch Phrase Source: https://marketsquare.github.io/robotframework-faker Generates a fake catch phrase as a string. ```APIDOC ## Catch Phrase ### Description Generates a fake catch phrase. ### Return Type string ### Example ``` 'Robust full-range hub' ``` ```