Locale fr_CA

faker.providers.address

class faker.providers.address.fr_CA.Provider(*args, **kwargs)

Bases: faker.providers.address.en_CA.Provider

address() → str
Example:‘791 Crist Parks, Sashabury, IL 86039-9874’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.address()
...
'48764 route Charron Apt. 824\nBaie-Mont--Boulanger, ON M6E 8C9'
'5938 allé Fréchette Suite 080\nLac- Martineau, YT V6N 2K4'
'87115 rue Gaudreault\nFortier, SK Y4N 9Y5'
'659 boulevard Martin\nSaint- Bernard -sur-Mer, QC V3C3C1'
'848 avenue Pauline Suite 947\nAuger, QC C8N6E4'
administrative_unit() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.administrative_unit()
...
'Nouvelle-Écosse'
'Yukon'
'Nouvelle-Écosse'
'Alberta'
'Terre-Neuve-et-Labrador'
building_number() → str
Example:‘791’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.building_number()
...
'6048'
'6475'
'382'
'2194'
'924'
city() → str
Example:‘Sashabury’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.city()
...
'Lac- Charles'
"L'Île- Florence"
'Mont- Émilie'
'Sainte- Hélène'
'Mont--Saint--St-Jean'
city_prefix() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.city_prefix()
...
'Lac-'
'Lac-'
'Ville'
'Mont-'
"L'Île-"
city_suffix() → str
Example:‘town’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.city_suffix()
...
'Ouest'
'Ouest'
'Est'
'Ouest'
'-sur-Mer'
country() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.country()
...
'Tanzania'
'Hungary'
'Senegal'
'Tuvalu'
'Italy'
country_code(representation: str = 'alpha-2') → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.country_code()
...
'MV'
'PS'
'NL'
'BB'
'IL'
current_country() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.current_country()
...
'Canada'
'Canada'
'Canada'
'Canada'
'Canada'
current_country_code() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.current_country_code()
...
'CA'
'CA'
'CA'
'CA'
'CA'
postal_code_letter() → str

Returns a random letter from the list of allowable letters in a canadian postal code

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.postal_code_letter()
...
'R'
'S'
'B'
'L'
'X'
postalcode() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.postalcode()
...
'S9B8L7'
'V9P3J5'
'E3L 5Y2'
'N2V 6Y7'
'J8Y9V5'
postalcode_in_province(province_abbr: Optional[str] = None) → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.postalcode_in_province()
...
'B8L7X5'
'X5X3G2'
'C2M6E8'
'M4S 9N8'
'X2Y7A1'
postcode() → str

Returns a random postcode

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.postcode()
...
'S9B8L7'
'V9P3J5'
'E3L 5Y2'
'N2V 6Y7'
'J8Y9V5'
postcode_in_province(province_abbr: Optional[str] = None) → str

Returns a random postcode within the provided province abbreviation

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.postcode_in_province()
...
'B8L7X5'
'X5X3G2'
'C2M6E8'
'M4S 9N8'
'X2Y7A1'
province() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.province()
...
'Nouvelle-Écosse'
'Yukon'
'Nouvelle-Écosse'
'Alberta'
'Terre-Neuve-et-Labrador'
province_abbr() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.province_abbr()
...
'NS'
'YT'
'NS'
'AB'
'NL'
secondary_address() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.secondary_address()
...
'Suite 604'
'Suite 647'
'Suite 938'
'Apt. 421'
'Suite 892'
street_address() → str
Example:‘791 Crist Parks’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.street_address()
...
'0487 boulevard Duguay Suite 593'
'2194 boulevard Gilles'
'578 route Danielle'
'387 montée Ménard Apt. 801'
'097 avenue Dupont Suite 139'
street_name() → str
Example:‘Crist Parks’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.street_name()
...
'rang Ouellet'
'montée Rioux'
'boulevard Duguay'
'route Charron'
'montée Jonathan'
street_prefix() → str
Example:‘rue’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.street_prefix()
...
'rang'
'rang'
'rue'
'boulevard'
'montée'
street_suffix() → str
Example:‘Avenue’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.street_suffix()
...
'Vista'
'Lights'
'Trace'
'Manor'
'Canyon'

faker.providers.barcode

class faker.providers.barcode.fr_CA.Provider(generator: Any)

Bases: faker.providers.barcode.en_CA.Provider

Implement bank provider for fr_CA locale.

There is no difference from the en_CA implementation.

ean(length: int = 13, prefixes: Tuple[Union[int, str, Tuple[Union[int, str], ...]], ...] = ()) → str

Generate an EAN barcode of the specified length.

The value of length can only be 8 or 13 (default) which will create an EAN-8 or an EAN-13 barcode respectively.

If a value for prefixes is specified, the result will begin with one of the sequences in prefixes.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean(length=13)
...
'6604876475937'
'8242194892418'
'1578156593879'
'7840801609759'
'3513933287112'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean(length=8)
...
'66048763'
'47593824'
'42194897'
'24115780'
'15659385'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean(prefixes=('00', ))
...
'0004876475931'
'0019489241156'
'0056593877840'
'0016097535134'
'0087115871480'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean(prefixes=('45', '49'))
...
'4504876475932'
'4919489241155'
'4556593877841'
'4516097535135'
'4987115871489'
ean13(prefixes: Tuple[Union[int, str, Tuple[Union[int, str], ...]], ...] = (), leading_zero: Optional[bool] = None) → str

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.

Note

EAN-13 barcode that starts with a zero can be converted to UPC-A by dropping the leading zero. This may cause problems with readers that treat all of these code as UPC-A codes and drop the first digit when reading it.

You can set the argument prefixes ( or leading_zero for convenience) explicitly to avoid or to force the generated barcode to start with a zero. You can also generate actual UPC-A barcode with EnUsBarcodeProvider.upc_a().

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean13()
...
'6604876475937'
'8242194892418'
'1578156593879'
'7840801609759'
'3513933287112'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean13(leading_zero=False)
...
'7048764759386'
'5194892411572'
'6593877840809'
'7975351393329'
'2587148418587'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean13(leading_zero=True)
...
'0604876475933'
'0219489241150'
'0156593877847'
'0016097535134'
'0287115871484'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean13(prefixes=('00', ))
...
'0004876475931'
'0019489241156'
'0056593877840'
'0016097535134'
'0087115871480'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean13(prefixes=('45', '49'))
...
'4504876475932'
'4919489241155'
'4556593877841'
'4516097535135'
'4987115871489'
ean8(prefixes: Tuple[()] = ()) → str

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.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean8()
...
'66048763'
'47593824'
'42194897'
'24115780'
'15659385'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean8(prefixes=('00', ))
...
'00048767'
'00938242'
'00489249'
'00781565'
'00877848'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.ean8(prefixes=('45', '49'))
...
'49048766'
'45938245'
'45489242'
'49781564'
'45877841'
localized_ean(length: int = 13) → str

Generate a localized EAN barcode of the specified length.

The value of length can only be 8 or 13 (default) which will create an EAN-8 or an EAN-13 barcode respectively.

This method uses the standard barcode provider’s ean() under the hood with the prefixes argument explicitly set to local_prefixes of a localized barcode provider implementation.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.localized_ean()
...
'0804876475937'
'7521948924119'
'7581565938777'
'0908016097536'
'0839332871152'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.localized_ean(length=13)
...
'0804876475937'
'7521948924119'
'7581565938777'
'0908016097536'
'0839332871152'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.localized_ean(length=8)
...
'75048761'
'06593827'
'06948924'
'07578151'
'06387785'
localized_ean13() → str

Generate a localized EAN-13 barcode.

This method uses localized_ean() under the hood with the length argument explicitly set to 13.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.localized_ean13()
...
'0804876475937'
'7521948924119'
'7581565938777'
'0908016097536'
'0839332871152'
localized_ean8() → str

Generate a localized EAN-8 barcode.

This method uses localized_ean() under the hood with the length argument explicitly set to 8.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.localized_ean8()
...
'75048761'
'06593827'
'06948924'
'07578151'
'06387785'
upc_a(upc_ae_mode: bool = False, base: Optional[str] = None, number_system_digit: Optional[int] = None) → str

Generate a 12-digit UPC-A barcode.

The value of upc_ae_mode controls how barcodes will be generated. If False (default), barcodes are not guaranteed to have a UPC-E equivalent. In this mode, the method uses EnUsBarcodeProvider.ean13() under the hood, and the values of base and number_system_digit will be ignored.

If upc_ae_mode is True, the resulting barcodes are guaranteed to have a UPC-E equivalent, and the values of base and number_system_digit will be used to control what is generated.

Under this mode, base is expected to have a 6-digit string value. If any other value is supplied, a random 6-digit string will be used instead. As for number_system_digit, the expected value is a 0 or a 1. If any other value is provided, this method will randomly choose from the two.

Important

When upc_ae_mode is enabled, you might encounter instances where different values of base (e.g. '120003' and '120004') produce the same UPC-A barcode. This is normal, and the reason lies within the whole conversion process. To learn more about this and what base and number_system_digit actually represent, please refer to EnUsBarcodeProvider.upc_e().

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_a()
...
'604876475933'
'219489241150'
'156593877847'
'016097535134'
'287115871484'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_a(upc_ae_mode=True, number_system_digit=0)
...
'066048000075'
'064700000593'
'082421000098'
'048100009240'
'015781000057'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_a(upc_ae_mode=True, number_system_digit=1)
...
'166048000072'
'164700000590'
'182421000095'
'148100009247'
'115781000054'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_a(upc_ae_mode=True, base='123456', number_system_digit=0)
...
'012345000065'
'012345000065'
'012345000065'
'012345000065'
'012345000065'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_a(upc_ae_mode=True, base='120003', number_system_digit=0)
...
'012000000003'
'012000000003'
'012000000003'
'012000000003'
'012000000003'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_a(upc_ae_mode=True, base='120004', number_system_digit=0)
...
'012000000003'
'012000000003'
'012000000003'
'012000000003'
'012000000003'
upc_e(base: Optional[str] = None, number_system_digit: Optional[int] = None, safe_mode: bool = True) → str

Generate an 8-digit UPC-E barcode.

UPC-E barcodes can be expressed in 6, 7, or 8-digit formats, but this method uses the 8 digit format, since it is trivial to convert to the other two formats. The first digit (starting from the left) is controlled by number_system_digit, and it can only be a 0 or a 1. The last digit is the check digit that is inherited from the UPC-E barcode’s UPC-A equivalent. The middle six digits are collectively referred to as the base (for a lack of a better term).

On that note, this method uses base and number_system_digit to first generate a UPC-A barcode for the check digit, and what happens next depends on the value of safe_mode. The argument safe_mode exists, because there are some UPC-E values that share the same UPC-A equivalent. For example, any UPC-E barcode of the form abc0000d, abc0003d, and abc0004d share the same UPC-A value abc00000000d, but that UPC-A value will only convert to abc0000d because of (a) how UPC-E is just a zero-suppressed version of UPC-A and (b) the rules around the conversion.

If safe_mode is True (default), this method performs another set of conversions to guarantee that the UPC-E barcodes generated can be converted to UPC-A, and that UPC-A barcode can be converted back to the original UPC-E barcode. Using the example above, even if the bases 120003 or 120004 are used, the resulting UPC-E barcode will always use the base 120000.

If safe_mode is False, then the number_system_digit, base, and the computed check digit will just be concatenated together to produce the UPC-E barcode, and attempting to convert the barcode to UPC-A and back again to UPC-E will exhibit the behavior described above.

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e()
...
'16604872'
'04759386'
'04219484'
'04115786'
'15659385'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='123456')
...
'11234562'
'11234562'
'01234565'
'11234562'
'11234562'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='123456', number_system_digit=0)
...
'01234565'
'01234565'
'01234565'
'01234565'
'01234565'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='123456', number_system_digit=1)
...
'11234562'
'11234562'
'11234562'
'11234562'
'11234562'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='120000', number_system_digit=0)
...
'01200003'
'01200003'
'01200003'
'01200003'
'01200003'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='120003', number_system_digit=0)
...
'01200003'
'01200003'
'01200003'
'01200003'
'01200003'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='120004', number_system_digit=0)
...
'01200003'
'01200003'
'01200003'
'01200003'
'01200003'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='120000', number_system_digit=0, safe_mode=False)
...
'01200003'
'01200003'
'01200003'
'01200003'
'01200003'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='120003', number_system_digit=0, safe_mode=False)
...
'01200033'
'01200033'
'01200033'
'01200033'
'01200033'
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.upc_e(base='120004', number_system_digit=0, safe_mode=False)
...
'01200043'
'01200043'
'01200043'
'01200043'
'01200043'

faker.providers.currency

class faker.providers.currency.fr_CA.Provider(generator: Any)

Bases: faker.providers.currency.Provider

cryptocurrency() → Tuple[str, str]
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.cryptocurrency()
...
('XRP', 'Ripple')
('STC', 'SwiftCoin')
('BC', 'BlackCoin')
('NXT', 'Nxt')
('IOTA', 'IOTA')
cryptocurrency_code() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.cryptocurrency_code()
...
'XRP'
'STC'
'BC'
'NXT'
'IOTA'
cryptocurrency_name() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.cryptocurrency_name()
...
'Ripple'
'SwiftCoin'
'BlackCoin'
'Nxt'
'IOTA'
currency() → Tuple[str, str]
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.currency()
...
('MWK', 'Malawian kwacha')
('NZD', 'New Zealand dollar')
('BAM', 'Bosnia and Herzegovina convertible mark')
('IRR', 'Iranian rial')
('SPL', 'Seborga luigino')
currency_code() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.currency_code()
...
'MWK'
'NZD'
'BAM'
'IRR'
'SPL'
currency_name() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.currency_name()
...
'Malawian kwacha'
'New Zealand dollar'
'Bosnia and Herzegovina convertible mark'
'Iranian rial'
'Seborga luigino'
currency_symbol(code: Optional[str] = None) → str
Example:$
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.currency_symbol()
...
'$'
'₨'
'$'
'₹'
'£'
pricetag() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.pricetag()
...
'7.604,87\xa0$'
'975,93\xa0$'
'54,21\xa0$'
'89.241,15\xa0$'
'91.565,93\xa0$'

faker.providers.date_time

class faker.providers.date_time.fr_CA.Provider(*args, **kwargs)

Bases: faker.providers.date_time.fr_FR.Provider

am_pm() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.am_pm()
...
'AM'
'AM'
'AM'
'AM'
'AM'
century() → str
Example:‘XVII’
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.century()
...
'XIII'
'XIV'
'II'
'IX'
'XVII'
date(pattern: str = '%Y-%m-%d', end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → str

Get a date string between January 1, 1970 and now.

Parameters:pattern – Format of the date (year-month-day by default)
Example:‘2008-11-27’
Returns:Date
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date()
...
'1996-03-20'
'2021-07-31'
'1998-08-15'
'1972-10-03'
'1987-08-15'
date_between(start_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = '-30y', end_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = 'today') → datetime.date

Get a Date object based on a random date between two given dates. Accepts date strings that can be recognized by strtotime().

Parameters:
  • start_date – Defaults to 30 years ago
  • end_date – Defaults to “today”
Example:

Date(‘1999-02-02’)

Returns:

Date

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_between()
...
datetime.date(2021, 10, 20)
datetime.date(2006, 3, 6)
datetime.date(2018, 11, 10)
datetime.date(2007, 5, 19)
datetime.date(1994, 6, 13)
date_between_dates(date_start: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None, date_end: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → datetime.date

Takes two Date objects and returns a random date between the two given dates. Accepts Date or datetime objects

Parameters:
  • date_start – Date
  • date_end – Date
Returns:

Date

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_between_dates()
...
datetime.date(2023, 1, 27)
datetime.date(2023, 1, 27)
datetime.date(2023, 1, 27)
datetime.date(2023, 1, 27)
datetime.date(2023, 1, 27)
date_object(end_datetime: Optional[datetime.datetime] = None) → datetime.date

Get a date object between January 1, 1970 and now :example: datetime.date(2016, 9, 20)

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_object()
...
datetime.date(1996, 3, 20)
datetime.date(2021, 7, 31)
datetime.date(1998, 8, 15)
datetime.date(1972, 10, 3)
datetime.date(1987, 8, 15)
date_of_birth(tzinfo: Optional[datetime.tzinfo] = None, minimum_age: int = 0, maximum_age: int = 115) → datetime.date

Generate a random date of birth represented as a Date object, constrained by optional miminimum_age and maximum_age parameters.

Parameters:
  • tzinfo – Defaults to None.
  • minimum_age – Defaults to 0.
  • maximum_age – Defaults to 115.
Example:

Date(‘1979-02-02’)

Returns:

Date

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_of_birth()
...
datetime.date(2021, 12, 30)
datetime.date(1959, 7, 3)
datetime.date(2010, 3, 25)
datetime.date(1964, 4, 23)
datetime.date(1912, 7, 31)
date_this_century(before_today: bool = True, after_today: bool = False) → datetime.date

Gets a Date object for the current century.

Parameters:
  • before_today – include days in current century before today
  • after_today – include days in current century after today
Example:

Date(‘2012-04-04’)

Returns:

Date

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_this_century()
...
datetime.date(2013, 2, 8)
datetime.date(2014, 4, 23)
datetime.date(2001, 5, 18)
datetime.date(2008, 10, 22)
datetime.date(2017, 5, 24)
date_this_decade(before_today: bool = True, after_today: bool = False) → datetime.date

Gets a Date object for the decade year.

Parameters:
  • before_today – include days in current decade before today
  • after_today – include days in current decade after today
Example:

Date(‘2012-04-04’)

Returns:

Date

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_this_decade()
...
datetime.date(2021, 8, 21)
datetime.date(2021, 10, 15)
datetime.date(2020, 3, 3)
datetime.date(2021, 2, 6)
datetime.date(2022, 3, 5)
date_this_month(before_today: bool = True, after_today: bool = False) → datetime.date

Gets a Date object for the current month.

Parameters:
  • before_today – include days in current month before today
  • after_today – include days in current month after today
Example:

dtdate(‘2012-04-04’)

Returns:

dtdate

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_this_month()
...
datetime.date(2023, 1, 19)
datetime.date(2023, 1, 21)
datetime.date(2023, 1, 2)
datetime.date(2023, 1, 13)
datetime.date(2023, 1, 25)
date_this_year(before_today: bool = True, after_today: bool = False) → datetime.date

Gets a Date object for the current year.

Parameters:
  • before_today – include days in current year before today
  • after_today – include days in current year after today
Example:

Date(‘2012-04-04’)

Returns:

Date

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_this_year()
...
datetime.date(2023, 1, 19)
datetime.date(2023, 1, 21)
datetime.date(2023, 1, 2)
datetime.date(2023, 1, 13)
datetime.date(2023, 1, 25)
date_time(tzinfo: Optional[datetime.tzinfo] = None, end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → datetime.datetime

Get a datetime object for a date between January 1, 1970 and now :param tzinfo: timezone, instance of datetime.tzinfo subclass :example: datetime(‘2005-08-16 20:39:21’) :return: datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_time()
...
datetime.datetime(1996, 3, 20, 7, 46, 39)
datetime.datetime(2021, 7, 31, 1, 24, 38)
datetime.datetime(1998, 8, 15, 8, 43, 22)
datetime.datetime(1972, 10, 3, 5, 52, 26)
datetime.datetime(1987, 8, 15, 9, 51, 25)
date_time_ad(tzinfo: Optional[datetime.tzinfo] = None, end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None, start_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → datetime.datetime

Get a datetime object for a date between January 1, 001 and now :param tzinfo: timezone, instance of datetime.tzinfo subclass :example: datetime(‘1265-03-22 21:15:52’) :return: datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_time_ad()
...
datetime.datetime(932, 7, 17, 1, 20, 13)
datetime.datetime(2009, 8, 3, 21, 25)
datetime.datetime(58, 3, 29, 17, 26, 45)
datetime.datetime(1023, 4, 21, 11, 47, 46)
datetime.datetime(1961, 7, 18, 3, 50, 16)
date_time_between(start_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = '-30y', end_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = 'now', tzinfo: Optional[datetime.tzinfo] = None) → datetime.datetime

Get a datetime object based on a random date between two given dates. Accepts date strings that can be recognized by strtotime().

Parameters:
  • start_date – Defaults to 30 years ago
  • end_date – Defaults to “now”
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

datetime(‘1999-02-02 11:42:52’)

Returns:

datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_time_between()
...
datetime.datetime(2021, 10, 21, 15, 18, 31)
datetime.datetime(2006, 3, 8, 4, 34, 11)
datetime.datetime(2018, 11, 12, 1, 23, 11)
datetime.datetime(2007, 5, 21, 5, 2, 33)
datetime.datetime(1994, 6, 14, 15, 37, 5)
date_time_between_dates(datetime_start: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None, datetime_end: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None, tzinfo: Optional[datetime.tzinfo] = None) → datetime.datetime

Takes two datetime objects and returns a random datetime between the two given datetimes. Accepts datetime objects.

Parameters:
  • datetime_start – datetime
  • datetime_end – datetime
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

datetime(‘1999-02-02 11:42:52’)

Returns:

datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_time_between_dates()
...
datetime.datetime(2023, 1, 27, 17, 28, 52)
datetime.datetime(2023, 1, 27, 17, 28, 52)
datetime.datetime(2023, 1, 27, 17, 28, 52)
datetime.datetime(2023, 1, 27, 17, 28, 52)
datetime.datetime(2023, 1, 27, 17, 28, 52)
date_time_this_century(before_now: bool = True, after_now: bool = False, tzinfo: Optional[datetime.tzinfo] = None) → datetime.datetime

Gets a datetime object for the current century.

Parameters:
  • before_now – include days in current century before today
  • after_now – include days in current century after today
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

datetime(‘2012-04-04 11:02:02’)

Returns:

datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_time_this_century()
...
datetime.datetime(2013, 2, 8, 15, 53, 19)
datetime.datetime(2014, 4, 23, 16, 21, 41)
datetime.datetime(2001, 5, 18, 2, 56, 13)
datetime.datetime(2008, 10, 22, 16, 55, 42)
datetime.datetime(2017, 5, 24, 21, 37, 28)
date_time_this_decade(before_now: bool = True, after_now: bool = False, tzinfo: Optional[datetime.tzinfo] = None) → datetime.datetime

Gets a datetime object for the decade year.

Parameters:
  • before_now – include days in current decade before today
  • after_now – include days in current decade after today
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

datetime(‘2012-04-04 11:02:02’)

Returns:

datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_time_this_decade()
...
datetime.datetime(2021, 8, 21, 10, 59, 9)
datetime.datetime(2021, 10, 15, 8, 2, 42)
datetime.datetime(2020, 3, 3, 21, 22, 1)
datetime.datetime(2021, 2, 6, 5, 6, 57)
datetime.datetime(2022, 3, 5, 5, 42, 11)
date_time_this_month(before_now: bool = True, after_now: bool = False, tzinfo: Optional[datetime.tzinfo] = None) → datetime.datetime

Gets a datetime object for the current month.

Parameters:
  • before_now – include days in current month before today
  • after_now – include days in current month after today
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

datetime(‘2012-04-04 11:02:02’)

Returns:

datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_time_this_month()
...
datetime.datetime(2023, 1, 19, 16, 50, 35)
datetime.datetime(2023, 1, 21, 10, 0, 5)
datetime.datetime(2023, 1, 2, 23, 10, 3)
datetime.datetime(2023, 1, 13, 13, 39, 35)
datetime.datetime(2023, 1, 25, 19, 40, 41)
date_time_this_year(before_now: bool = True, after_now: bool = False, tzinfo: Optional[datetime.tzinfo] = None) → datetime.datetime

Gets a datetime object for the current year.

Parameters:
  • before_now – include days in current year before today
  • after_now – include days in current year after today
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

datetime(‘2012-04-04 11:02:02’)

Returns:

datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.date_time_this_year()
...
datetime.datetime(2023, 1, 19, 16, 50, 35)
datetime.datetime(2023, 1, 21, 10, 0, 5)
datetime.datetime(2023, 1, 2, 23, 10, 3)
datetime.datetime(2023, 1, 13, 13, 39, 35)
datetime.datetime(2023, 1, 25, 19, 40, 41)
day_of_month() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.day_of_month()
...
'20'
'31'
'15'
'03'
'15'
day_of_week() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.day_of_week()
...
'mercredi'
'samedi'
'samedi'
'mardi'
'samedi'
future_date(end_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = '+30d', tzinfo: Optional[datetime.tzinfo] = None) → datetime.date

Get a Date object based on a random date between 1 day from now and a given date. Accepts date strings that can be recognized by strtotime().

Parameters:
  • end_date – Defaults to “+30d”
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

dtdate(‘2030-01-01’)

Returns:

dtdate

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.future_date()
...
datetime.date(2023, 2, 15)
datetime.date(2023, 2, 17)
datetime.date(2023, 1, 29)
datetime.date(2023, 2, 9)
datetime.date(2023, 2, 21)
future_datetime(end_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = '+30d', tzinfo: Optional[datetime.tzinfo] = None) → datetime.datetime

Get a datetime object based on a random date between 1 second form now and a given date. Accepts date strings that can be recognized by strtotime().

Parameters:
  • end_date – Defaults to “+30d”
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

datetime(‘1999-02-02 11:42:52’)

Returns:

datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.future_datetime()
...
datetime.datetime(2023, 2, 15, 10, 19, 28)
datetime.datetime(2023, 2, 17, 3, 28, 58)
datetime.datetime(2023, 1, 29, 16, 38, 56)
datetime.datetime(2023, 2, 9, 7, 8, 28)
datetime.datetime(2023, 2, 21, 13, 9, 34)
iso8601(tzinfo: Optional[datetime.tzinfo] = None, end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None, sep: str = 'T', timespec: str = 'auto') → str

Get a timestamp in ISO 8601 format (or one of its profiles). :param tzinfo: timezone, instance of datetime.tzinfo subclass :param sep: separator between date and time, defaults to ‘T’ :param timespec: format specifier for the time part, defaults to ‘auto’ - see datetime.isoformat() documentation :example: ‘2003-10-21T16:05:52+0000’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.iso8601()
...
'1996-03-20T07:46:39'
'2021-07-31T01:24:38'
'1998-08-15T08:43:22'
'1972-10-03T05:52:26'
'1987-08-15T09:51:25'
month() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.month()
...
'03'
'07'
'08'
'10'
'08'
month_name() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.month_name()
...
'Mars'
'Juillet'
'Août'
'Octobre'
'Août'
past_date(start_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = '-30d', tzinfo: Optional[datetime.tzinfo] = None) → datetime.date

Get a Date object based on a random date between a given date and 1 day ago. Accepts date strings that can be recognized by strtotime().

Parameters:
  • start_date – Defaults to “-30d”
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

dtdate(‘1999-02-02’)

Returns:

dtdate

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.past_date()
...
datetime.date(2023, 1, 15)
datetime.date(2023, 1, 17)
datetime.date(2022, 12, 29)
datetime.date(2023, 1, 9)
datetime.date(2023, 1, 21)
past_datetime(start_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = '-30d', tzinfo: Optional[datetime.tzinfo] = None) → datetime.datetime

Get a datetime object based on a random date between a given date and 1 second ago. Accepts date strings that can be recognized by strtotime().

Parameters:
  • start_date – Defaults to “-30d”
  • tzinfo – timezone, instance of datetime.tzinfo subclass
Example:

datetime(‘1999-02-02 11:42:52’)

Returns:

datetime

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.past_datetime()
...
datetime.datetime(2023, 1, 16, 10, 19, 27)
datetime.datetime(2023, 1, 18, 3, 28, 57)
datetime.datetime(2022, 12, 30, 16, 38, 55)
datetime.datetime(2023, 1, 10, 7, 8, 27)
datetime.datetime(2023, 1, 22, 13, 9, 33)
pytimezone(*args, **kwargs) → Optional[datetime.tzinfo]

Generate a random timezone (see faker.timezone for any args) and return as a python object usable as a tzinfo to datetime or other fakers.

Example:faker.pytimezone()
Returns:dateutil.tz.tz.tzfile
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.pytimezone()
...
tzfile('/usr/share/zoneinfo/Indian/Maldives')
tzfile('/usr/share/zoneinfo/America/Barbados')
tzfile('/usr/share/zoneinfo/Europe/Stockholm')
tzfile('/usr/share/zoneinfo/Africa/Windhoek')
tzfile('/usr/share/zoneinfo/Asia/Qatar')
time(pattern: str = '%H:%M:%S', end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → str

Get a time string (24h format by default) :param pattern: format :example: ‘15:02:34’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.time()
...
'07:46:39'
'01:24:38'
'08:43:22'
'05:52:26'
'09:51:25'
time_delta(end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → datetime.timedelta

Get a timedelta object

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.time_delta()
...
datetime.timedelta(0)
datetime.timedelta(0)
datetime.timedelta(0)
datetime.timedelta(0)
datetime.timedelta(0)
time_object(end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → datetime.time

Get a time object :example: datetime.time(15, 56, 56, 772876)

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.time_object()
...
datetime.time(7, 46, 39)
datetime.time(1, 24, 38)
datetime.time(8, 43, 22)
datetime.time(5, 52, 26)
datetime.time(9, 51, 25)
time_series(start_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = '-30d', end_date: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int] = 'now', precision: Optional[float] = None, distrib: Optional[Callable[[datetime.datetime], float]] = None, tzinfo: Optional[datetime.tzinfo] = None) → Iterator[Tuple[datetime.datetime, Any]]

Returns a generator yielding tuples of (<datetime>, <value>).

The data points will start at start_date, and be at every time interval specified by precision. distrib is a callable that accepts <datetime> and returns <value>

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.time_series()
...
<generator object Provider.time_series at 0x7fdd73076bd0>
<generator object Provider.time_series at 0x7fdd73076bd0>
<generator object Provider.time_series at 0x7fdd73076bd0>
<generator object Provider.time_series at 0x7fdd73076bd0>
<generator object Provider.time_series at 0x7fdd73076bd0>
timezone() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.timezone()
...
'Indian/Maldives'
'America/Barbados'
'Europe/Stockholm'
'Africa/Windhoek'
'Asia/Qatar'
unix_time(end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None, start_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → int

Get a timestamp between January 1, 1970 and now, unless passed explicit start_datetime or end_datetime values. :example: 1061306726

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.unix_time()
...
827307999
1627694678
903170602
86939546
556019485
year() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.year()
...
'1996'
'2021'
'1998'
'1972'
'1987'

faker.providers.person

class faker.providers.person.fr_CA.Provider(generator: Any)

Bases: faker.providers.person.Provider

first_name() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.first_name()
...
'Céline'
'Claude'
'Charles'
'Roland'
'Henriette'
first_name_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.first_name_female()
...
'Virginie'
'Geneviève'
'Rosalie'
'Isabelle'
'Anaïs'
first_name_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.first_name_male()
...
'Maurice'
'Noël'
'Arthur'
'Jean'
'Roger'
first_name_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.first_name_nonbinary()
...
'Céline'
'Claude'
'Charles'
'Roland'
'Henriette'
language_name() → str

Generate a random i18n language name (e.g. English).

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.language_name()
...
'Luba-Katanga'
'Malay'
'Aymara'
'Interlingue'
'Quechua'
last_name() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.last_name()
...
'Brisson'
'Jean'
'Plourde'
'Germain'
'Moreau'
last_name_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.last_name_female()
...
'Brisson'
'Jean'
'Plourde'
'Germain'
'Moreau'
last_name_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.last_name_male()
...
'Brisson'
'Jean'
'Plourde'
'Germain'
'Moreau'
last_name_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.last_name_nonbinary()
...
'Brisson'
'Jean'
'Plourde'
'Germain'
'Moreau'
name() → str

:example ‘John Doe’

Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.name()
...
'Rosalie Germain'
'Anaïs Ménard'
'Henriette-Sophie Maltais'
'Juliette Boivin'
'Robert Martel-Champagne'
name_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.name_female()
...
'Rosalie Germain-Moreau'
'Denise Duguay'
'Henriette-Sophie Maltais'
'Juliette Boivin'
'Laurence Martel'
name_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.name_male()
...
'Noël Ouellet-Ménard'
'Nathan-Julien Duguay'
'Maxime-Victor Larivière'
'Robert Martel'
'Éric St-Jean'
name_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.name_nonbinary()
...
'Rosalie Germain'
'Anaïs Ménard'
'Henriette-Sophie Maltais'
'Juliette Boivin'
'Robert Martel-Champagne'
prefix() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.prefix()
...
''
''
''
''
''
prefix_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.prefix_female()
...
''
''
''
''
''
prefix_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.prefix_male()
...
''
''
''
''
''
prefix_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.prefix_nonbinary()
...
''
''
''
''
''
suffix() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.suffix()
...
''
''
''
''
''
suffix_female() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.suffix_female()
...
''
''
''
''
''
suffix_male() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.suffix_male()
...
''
''
''
''
''
suffix_nonbinary() → str
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.suffix_nonbinary()
...
''
''
''
''
''