faker.providers.internet.fr_FR

Package Contents

Classes

InternetProvider

Provider

class faker.providers.internet.fr_FR.InternetProvider(generator: Any)

Bases: faker.providers.BaseProvider

safe_domain_names: faker.providers.ElementsType[str] = ('example.org', 'example.com', 'example.net')
free_email_domains: faker.providers.ElementsType[str] = ('gmail.com', 'yahoo.com', 'hotmail.com')
tlds: faker.providers.ElementsType[str] = ('com', 'com', 'com', 'com', 'com', 'com', 'biz', 'info', 'net', 'org')
hostname_prefixes: faker.providers.ElementsType[str] = ('db', 'srv', 'desktop', 'laptop', 'lt', 'email', 'web')
uri_pages: faker.providers.ElementsType[str] = ('index', 'home', 'search', 'main', 'post', 'homepage', 'category', 'register', 'login', 'faq',...
uri_paths: faker.providers.ElementsType[str] = ('app', 'main', 'wp-content', 'search', 'category', 'tag', 'categories', 'tags', 'blog',...
uri_extensions: faker.providers.ElementsType[str] = ('.html', '.html', '.html', '.htm', '.htm', '.php', '.php', '.jsp', '.asp')
http_methods: faker.providers.ElementsType[str] = ('GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH')
user_name_formats: faker.providers.ElementsType[str] = ('{{last_name}}.{{first_name}}', '{{first_name}}.{{last_name}}', '{{first_name}}##', '?{{last_name}}')
email_formats: faker.providers.ElementsType[str] = ('{{user_name}}@{{domain_name}}', '{{user_name}}@{{free_email_domain}}')
url_formats: faker.providers.ElementsType[str] = ('www.{{domain_name}}/', '{{domain_name}}/')
image_placeholder_services: faker.providers.ElementsType[str] = ('https://picsum.photos/{width}/{height}', 'https://dummyimage.com/{width}x{height}',...
replacements: Tuple[Tuple[str, str], Ellipsis] = ()
_to_ascii(string: str) str
email(safe: bool = True, domain: Optional[str] = None) str
safe_domain_name() str
safe_email() str
free_email() str
company_email() str
free_email_domain() str
ascii_email() str
ascii_safe_email() str
ascii_free_email() str
ascii_company_email() str
user_name() str
hostname(levels: int = 1) str

Produce a hostname with specified number of subdomain levels.

>>> hostname()
db-01.nichols-phillips.com
>>> hostname(0)
laptop-56
>>> hostname(2)
web-12.williamson-hopkins.jackson.com
domain_name(levels: int = 1) str

Produce an Internet domain name with the specified number of subdomain levels.

>>> domain_name()
nichols-phillips.com
>>> domain_name(2)
williamson-hopkins.jackson.com
domain_word() str
dga(year: Optional[int] = None, month: Optional[int] = None, day: Optional[int] = None, tld: Optional[str] = None, length: Optional[int] = None) str

Generates a domain name by given date https://en.wikipedia.org/wiki/Domain_generation_algorithm

Return type

str

tld() str
http_method() str

Returns random HTTP method https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods

Return type

str

url(schemes: Optional[List[str]] = None) str
Parameters

schemes – a list of strings to use as schemes, one will chosen randomly. If None, it will generate http and https urls. Passing an empty list will result in schemeless url generation like “://domain.com”.

Returns

a random url string.

_get_all_networks_and_weights(address_class: Optional[str] = None) Tuple[List[ipaddress.IPv4Network], List[int]]

Produces a 2-tuple of valid IPv4 networks and corresponding relative weights

Parameters

address_class – IPv4 address class (a, b, or c)

_get_private_networks_and_weights(address_class: Optional[str] = None) Tuple[List[ipaddress.IPv4Network], List[int]]

Produces an OrderedDict of valid private IPv4 networks and corresponding relative weights

Parameters

address_class – IPv4 address class (a, b, or c)

_get_public_networks_and_weights(address_class: Optional[str] = None) Tuple[List[ipaddress.IPv4Network], List[int]]

Produces a 2-tuple of valid public IPv4 networks and corresponding relative weights

Parameters

address_class – IPv4 address class (a, b, or c)

_random_ipv4_address_from_subnets(subnets: List[ipaddress.IPv4Network], weights: Optional[List[int]] = None, network: bool = False) str

Produces a random IPv4 address or network with a valid CIDR from within the given subnets using a distribution described by weights.

Parameters
  • subnets – List of IPv4Networks to choose from within

  • weights – List of weights corresponding to the individual IPv4Networks

  • network – Return a network address, and not an IP address

Returns

_exclude_ipv4_networks(networks: List[ipaddress.IPv4Network], networks_to_exclude: List[ipaddress.IPv4Network]) List[ipaddress.IPv4Network]

Exclude the list of networks from another list of networks and return a flat list of new networks.

Parameters
  • networks – List of IPv4 networks to exclude from

  • networks_to_exclude – List of IPv4 networks to exclude

Returns

Flat list of IPv4 networks

ipv4_network_class() str

Returns a IPv4 network class ‘a’, ‘b’ or ‘c’.

Returns

IPv4 network class

ipv4(network: bool = False, address_class: Optional[str] = None, private: Optional[str] = None) str

Returns a random IPv4 address or network with a valid CIDR.

Parameters
  • network – Network address

  • address_class – IPv4 address class (a, b, or c)

  • private – Public or private

Returns

IPv4

ipv4_private(network: bool = False, address_class: Optional[str] = None) str

Returns a private IPv4.

Parameters
  • network – Network address

  • address_class – IPv4 address class (a, b, or c)

Returns

Private IPv4

ipv4_public(network: bool = False, address_class: Optional[str] = None) str

Returns a public IPv4 excluding private blocks.

Parameters
  • network – Network address

  • address_class – IPv4 address class (a, b, or c)

Returns

Public IPv4

ipv6(network: bool = False) str

Produce a random IPv6 address or network with a valid CIDR

mac_address() str
port_number(is_system: bool = False, is_user: bool = False, is_dynamic: bool = False) int

Returns a network port number https://tools.ietf.org/html/rfc6335

Parameters
  • is_system – System or well-known ports

  • is_user – User or registered ports

  • is_dynamic – Dynamic / private / ephemeral ports

Return type

int

uri_page() str
uri_path(deep: Optional[int] = None) str
uri_extension() str
uri(schemes: Optional[List[str]] = None, deep: Optional[int] = None) str
Parameters
  • schemes – a list of strings to use as schemes, one will chosen randomly. If None, it will generate http and https uris. Passing an empty list will result in schemeless uri generation like “://domain.com/index.html”.

  • deep – an integer specifying how many path components the URI should have..

Returns

a random url string.

slug(value: Optional[str] = None) str

Django algorithm

image_url(width: Optional[int] = None, height: Optional[int] = None, placeholder_url: Optional[str] = None) str

Returns URL to placeholder image Example: http://placehold.it/640x480

Parameters
  • width – Optional image width

  • height – Optional image height

  • placeholder_url – Optional template string of image URLs from custom placeholder service. String must contain {width} and {height} placeholders, eg: https:/example.com/{width}/{height}.

Return type

str

iana_id() str

Returns IANA Registrar ID https://www.iana.org/assignments/registrar-ids/registrar-ids.xhtml

Return type

str

ripe_id() str

Returns RIPE Organization ID https://www.ripe.net/manage-ips-and-asns/db/support/organisation-object-in-the-ripe-database

Return type

str

nic_handle(suffix: str = 'FAKE') str

Returns NIC Handle ID https://www.apnic.net/manage-ip/using-whois/guide/person/

Return type

str

nic_handles(count: int = 1, suffix: str = '????') List[str]

Returns NIC Handle ID list

Return type

list[str]

class faker.providers.internet.fr_FR.Provider(generator: Any)

Bases: faker.providers.internet.Provider

safe_email_tlds = ('com', 'net', 'fr', 'fr')
free_email_domains = ('voila.fr', 'gmail.com', 'hotmail.fr', 'yahoo.fr', 'laposte.net', 'free.fr', 'sfr.fr',...
tlds = ('com', 'com', 'com', 'net', 'org', 'fr', 'fr', 'fr')
replacements = (('à', 'a'), ('â', 'a'), ('ä', 'a'), ('ç', 'c'), ('é', 'e'), ('è', 'e'), ('ê', 'e'), ('ë', 'e'),...