Locale es

faker.providers.address

class faker.providers.address.es.Provider(generator: Any)

Bases: faker.providers.address.Provider

address() → str
Example:‘791 Crist Parks, Sashabury, IL 86039-9874’
building_number() → str
Example:‘791’
city() → str
Example:‘Sashabury’
city_suffix() → str
Example:‘town’
country() → str
country_code(representation: str = 'alpha-2') → str
current_country() → str
current_country_code() → str
postcode() → str
Example:86039-9874
street_address() → str
Example:‘791 Crist Parks’
street_name() → str
Example:‘Crist Parks’
street_suffix() → str
Example:‘Avenue’

faker.providers.color

class faker.providers.color.es.Provider(generator: Any)

Bases: faker.providers.color.Provider

Implement color provider for es locale.

color(hue: Optional[HueType] = None, luminosity: Optional[str] = None, color_format: str = 'hex') → str

Generate a color in a human-friendly way.

Under the hood, this method first creates a color represented in the HSV color model and then converts it to the desired color_format. The argument hue controls the H value according to the following rules:

  • If the value is a number from 0 to 360, it will serve as the H value of the generated color.
  • If the value is a tuple/list of 2 numbers from 0 to 360, the color’s H value will be randomly selected from that range.
  • If the value is a valid string, the color’s H value will be randomly selected from the H range corresponding to the supplied string. Valid values are 'monochrome', 'red', 'orange', 'yellow', 'green', 'blue', 'purple', and 'pink'.

The argument luminosity influences both S and V values and is partially affected by hue as well. The finer details of this relationship are somewhat involved, so please refer to the source code instead if you wish to dig deeper. To keep the interface simple, this argument either can be omitted or can accept the following string values:'bright', 'dark', 'light', or 'random'.

The argument color_format controls in which color model the color is represented. Valid values are 'hsv', 'hsl', 'rgb', or 'hex' (default).

Sample:hue=’red’
Sample:luminosity=’light’
Sample:hue=(100, 200), color_format=’rgb’
Sample:hue=’orange’, luminosity=’bright’
Sample:hue=135, luminosity=’dark’, color_format=’hsv’
Sample:hue=(300, 20), luminosity=’random’, color_format=’hsl’
color_name() → str

Generate a color name.

hex_color() → str

Generate a color formatted as a hex triplet.

rgb_color() → str

Generate a color formatted as a comma-separated RGB value.

rgb_css_color() → str

Generate a color formatted as a CSS rgb() function.

safe_color_name() → str

Generate a web-safe color name.

safe_hex_color() → str

Generate a web-safe color formatted as a hex triplet.

faker.providers.currency

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

Bases: faker.providers.currency.Provider

cryptocurrency() → Tuple[str, str]
cryptocurrency_code() → str
cryptocurrency_name() → str
currency() → Tuple[str, str]
currency_code() → str
currency_name() → str
currency_symbol(code: Optional[str] = None) → str
Example:$
pricetag() → str

faker.providers.date_time

class faker.providers.date_time.es.Provider(generator: Any)

Bases: faker.providers.date_time.Provider

am_pm() → str
century() → str
Example:‘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
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

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

date_object(end_datetime: datetime.datetime = None) → datetime.date

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

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

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

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

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

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

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

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

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

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

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

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

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

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

day_of_month() → str
day_of_week()
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

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

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’

month() → str
month_name()
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

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

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
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’

time_delta(end_datetime: Union[datetime.date, datetime.datetime, datetime.timedelta, str, int, None] = None) → datetime.timedelta

Get a timedelta object

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)

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>

timezone() → str
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

year() → str

faker.providers.job

class faker.providers.job.es.Provider(generator: Any)

Bases: faker.providers.job.Provider

job() → str

faker.providers.person

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

Bases: faker.providers.person.Provider

first_name() → str
first_name_female() → str
first_name_male() → str
first_name_nonbinary() → str
language_name() → str

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

last_name() → str
last_name_female() → str
last_name_male() → str
last_name_nonbinary() → str
name() → str

:example ‘John Doe’

name_female() → str
name_male() → str
name_nonbinary() → str
prefix() → str
prefix_female() → str
prefix_male() → str
prefix_nonbinary() → str
suffix() → str
suffix_female() → str
suffix_male() → str
suffix_nonbinary() → str