Generate valid data for an
This module can be run as a library or as a program. It contains
variables and functions that can be used to generate a random
Note that this program does not write data to a file. Instead, it prints the data to standard out. If you would like to save the generated data to a file, consider using file redirection like so:
python3.5 generate.py --inators=5 > data.json
> data.json part tells your shell to redirect output from
the standard out pipe to a file instead.
Return a generator that yields
The generator yields randomly spaced
datetimes in reverse chronological order. That is, every yielded
datetimerepresents a time that is further in the past than the one yielded before it. The difference between two successive
datetimes is a random value between 24 to 72 hours.
Return an inator record.
Return a dictionary that represents data for an inator. Each record contains a randomly generated identifier, a random location, a random condition, and a random description. The name of the inator and the date/time it was added are requried as parameters.
- name (str) – The name of the inator
- added (datetime.datetime) – The date/time the inator record was added to the searchinator.
A dictionary representing an inator
Generate num random inators.
Parameters: num (int) – The number of inators to generate Returns: A dict mapping an inator’s identifier to its record Return type: dict
Return credential information.
Format the credential data in lst so that it works with the searchinator. lst should contain strings of the format:
Parameters: lst (list) – A list of colon-separated username/password pairs Returns: A dict mapping usernames to their username/passwords Return type: dict
Generate data suitable for use in the searchinator.
For usage information, try running this module as a program like so:
python3.5 generate.py --help