headfake.field.faker
NameField
— Base for a name field which uses faker to generate. The supplied 'gender_field' points to the field in the fieldset which generates the gender value. It uses this field and row value to determine whether the generated name is male or female.TimeField
— Create mock time using fakerFirstNameField
— Generate first name based on gender using the faker module (see NameField).LastNameField
— Generate last name using the faker module.MiddleNameField
— Mock middle name field.AddressField
— Mock address line field.PostcodeField
— Mock postcode field.PhoneField
— Mock phone number field.EmailField
— Create mock email using fakerPasswordField
— Create mock password using fakerTextField
— Generate text using the faker.lorem provider. 'max_length' controls how long the text is allowed to be.MemoField
— Generate paragraphs using the faker.lorem provider. 'sentences' controls the exact number of sentences, when 'exact' is set to True, when set to False it will return a variable number of sentences (never less than 1) +- 40% of the 'sentences' parameter.
headfake.field.faker.
NameField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, gender_field
)
Base for a name field which uses faker to generate. The supplied 'gender_field' points to the field in the fieldset which generates the gender value. It uses this field and row value to determine whether the generated name is male or female.
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
— Fieldset to initialise from
None
headfake.field.faker.
TimeField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, format='%H:%M'
)
Create mock time using faker
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
(headfake.Fieldset) — Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
headfake.field.faker.
FirstNameField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, gender_field
)
Generate first name based on gender using the faker module (see NameField).
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
— Fieldset to initialise from
None
headfake.field.faker.
LastNameField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, gender_field
)
Generate last name using the faker module.
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
— Fieldset to initialise from
None
headfake.field.faker.
MiddleNameField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, gender_field
, first_name_field
)
Mock middle name field.
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
— Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
— Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
— The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
headfake.field.faker.
AddressField
(
line_no
, transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
)
Mock address line field.
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
(headfake.Fieldset) — Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
headfake.field.faker.
PostcodeField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
)
Mock postcode field.
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
(headfake.Fieldset) — Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
headfake.field.faker.
PhoneField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, type='default'
)
Mock phone number field.
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
(headfake.Fieldset) — Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
headfake.field.faker.
EmailField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, safe=True
)
Create mock email using faker
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
(headfake.Fieldset) — Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
headfake.field.faker.
PasswordField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, length=16
, special_chars=True
, digits=True
, upper_case=True
, lower_case=True
)
Create mock password using faker
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
(headfake.Fieldset) — Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
headfake.field.faker.
TextField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, max_length=50
)
Generate text using the faker.lorem provider. 'max_length' controls how long the text is allowed to be.
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
(headfake.Fieldset) — Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value
headfake.field.faker.
MemoField
(
transformers=NOTHING
, final_transformers=NOTHING
, name='field_1'
, hidden=False
, error_value=None
, transform=NOTHING
, fake=NOTHING
, sentences=3
, exact=False
)
Generate paragraphs using the faker.lorem provider. 'sentences' controls the exact number of sentences, when 'exact' is set to True, when set to False it will return a variable number of sentences (never less than 1) +- 40% of the 'sentences' parameter.
init_from_fieldset
(
fieldset
)
— Initialises field in fieldset.next_value
(
row
)
(Union(any, dict(str: any))) — Gets next generated value for field.
init_from_fieldset
(
fieldset
)
Initialises field in fieldset.
This is run once all fields have been setup. It is generally used by fields in the fieldset to obtain information from other fields in the fieldset for later use.
fieldset
(headfake.Fieldset) — Fieldset to initialise from
None
next_value
(
row
)
Gets next generated value for field.
Acts as a decorator around the private '_next_value' method. If 'transformers' have been provided in the constructor they will act on the value after it has been generated.
row
(dict(str: any)) — The current data row as a dictionary
Dictionary containing multiple fields OR a single field value