Faker is a Python package that generates fake data for you.

Overview

Faker is a Python package that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.

Faker is heavily inspired by PHP Faker, Perl Faker, and by Ruby Faker.


_|_|_|_|          _|
_|        _|_|_|  _|  _|      _|_|    _|  _|_|
_|_|_|  _|    _|  _|_|      _|_|_|_|  _|_|
_|      _|    _|  _|  _|    _|        _|
_|        _|_|_|  _|    _|    _|_|_|  _|

Latest version released on PyPI Build status of the master branch on Mac/Linux Build status of the master branch on Windows Test coverage Package license


Compatibility

Starting from version 4.0.0, Faker dropped support for Python 2 and from version 5.0.0 only supports Python 3.6 and above. If you still need Python 2 compatibility, please install version 3.0.1 in the meantime, and please consider updating your codebase to support Python 3 so you can enjoy the latest features Faker has to offer. Please see the extended docs for more details, especially if you are upgrading from version 2.0.4 and below as there might be breaking changes.

This package was also previously called fake-factory which was already deprecated by the end of 2016, and much has changed since then, so please ensure that your project and its dependencies do not depend on the old package.

Basic Usage

Install with pip:

pip install Faker

Use faker.Faker() to create and initialize a faker generator, which can generate data by accessing properties named after the type of data you want.

from faker import Faker
fake = Faker()

fake.name()
# 'Lucy Cechtelar'

fake.address()
# '426 Jordy Lodge
#  Cartwrightshire, SC 88120-6700'

fake.text()
# 'Sint velit eveniet. Rerum atque repellat voluptatem quia rerum. Numquam excepturi
#  beatae sint laudantium consequatur. Magni occaecati itaque sint et sit tempore. Nesciunt
#  amet quidem. Iusto deleniti cum autem ad quia aperiam.
#  A consectetur quos aliquam. In iste aliquid et aut similique suscipit. Consequatur qui
#  quaerat iste minus hic expedita. Consequuntur error magni et laboriosam. Aut aspernatur
#  voluptatem sit aliquam. Dolores voluptatum est.
#  Aut molestias et maxime. Fugit autem facilis quos vero. Eius quibusdam possimus est.
#  Ea quaerat et quisquam. Deleniti sunt quam. Adipisci consequatur id in occaecati.
#  Et sint et. Ut ducimus quod nemo ab voluptatum.'

Each call to method fake.name() yields a different (random) result. This is because faker forwards faker.Generator.method_name() calls to faker.Generator.format(method_name).

for _ in range(10):
  print(fake.name())

# 'Adaline Reichel'
# 'Dr. Santa Prosacco DVM'
# 'Noemy Vandervort V'
# 'Lexi O'Conner'
# 'Gracie Weber'
# 'Roscoe Johns'
# 'Emmett Lebsack'
# 'Keegan Thiel'
# 'Wellington Koelpin II'
# 'Ms. Karley Kiehn V'

Pytest fixtures

Faker also has its own pytest plugin which provides a faker fixture you can use in your tests. Please check out the pytest fixture docs to learn more.

Providers

Each of the generator properties (like name, address, and lorem) are called "fake". A faker generator has many of them, packaged in "providers".

from faker import Faker
from faker.providers import internet

fake = Faker()
fake.add_provider(internet)

print(fake.ipv4_private())

Check the extended docs for a list of bundled providers and a list of community providers.

Localization

faker.Faker can take a locale as an argument, to return localized data. If no localized provider is found, the factory falls back to the default en_US locale.

from faker import Faker
fake = Faker('it_IT')
for _ in range(10):
    print(fake.name())

# 'Elda Palumbo'
# 'Pacifico Giordano'
# 'Sig. Avide Guerra'
# 'Yago Amato'
# 'Eustachio Messina'
# 'Dott. Violante Lombardo'
# 'Sig. Alighieri Monti'
# 'Costanzo Costa'
# 'Nazzareno Barbieri'
# 'Max Coppola'

faker.Faker also supports multiple locales. New in v3.0.0.

from faker import Faker
fake = Faker(['it_IT', 'en_US', 'ja_JP'])
for _ in range(10):
    print(fake.name())

# 鈴木 陽一
# Leslie Moreno
# Emma Williams
# 渡辺 裕美子
# Marcantonio Galuppi
# Martha Davis
# Kristen Turner
# 中津川 春香
# Ashley Castillo
# 山田 桃子

You can check available Faker locales in the source code, under the providers package. The localization of Faker is an ongoing process, for which we need your help. Please don't hesitate to create a localized provider for your own locale and submit a Pull Request (PR).

Optimizations

The Faker constructor takes a performance-related argument called use_weighting. It specifies whether to attempt to have the frequency of values match real-world frequencies (e.g. the English name Gary would be much more frequent than the name Lorimer). If use_weighting is False, then all items have an equal chance of being selected, and the selection process is much faster. The default is True.

Command line usage

When installed, you can invoke faker from the command-line:

faker [-h] [--version] [-o output]
      [-l {bg_BG,cs_CZ,...,zh_CN,zh_TW}]
      [-r REPEAT] [-s SEP]
      [-i {package.containing.custom_provider otherpkg.containing.custom_provider}]
      [fake] [fake argument [fake argument ...]]

Where:

  • faker: is the script when installed in your environment, in development you could use python -m faker instead
  • -h, --help: shows a help message
  • --version: shows the program's version number
  • -o FILENAME: redirects the output to the specified filename
  • -l {bg_BG,cs_CZ,...,zh_CN,zh_TW}: allows use of a localized provider
  • -r REPEAT: will generate a specified number of outputs
  • -s SEP: will generate the specified separator after each generated output
  • -i {my.custom_provider other.custom_provider} list of additional custom providers to use. Note that is the import path of the package containing your Provider class, not the custom Provider class itself.
  • fake: is the name of the fake to generate an output for, such as name, address, or text
  • [fake argument ...]: optional arguments to pass to the fake (e.g. the profile fake takes an optional list of comma separated field names as the first argument)

Examples:

$ faker address
968 Bahringer Garden Apt. 722
Kristinaland, NJ 09890

$ faker -l de_DE address
Samira-Niemeier-Allee 56
94812 Biedenkopf

$ faker profile ssn,birthdate
{'ssn': u'628-10-1085', 'birthdate': '2008-03-29'}

$ faker -r=3 -s=";" name
Willam Kertzmann;
Josiah Maggio;
Gayla Schmitt;

How to create a Provider

from faker import Faker
fake = Faker()

# first, import a similar Provider or use the default one
from faker.providers import BaseProvider

# create new provider class
class MyProvider(BaseProvider):
    def foo(self):
        return 'bar'

# then add new provider to faker instance
fake.add_provider(MyProvider)

# now you can use:
fake.foo()
# 'bar'

How to customize the Lorem Provider

You can provide your own sets of words if you don't want to use the default lorem ipsum one. The following example shows how to do it with a list of words picked from cakeipsum :

from faker import Faker
fake = Faker()

my_word_list = [
'danish','cheesecake','sugar',
'Lollipop','wafer','Gummies',
'sesame','Jelly','beans',
'pie','bar','Ice','oat' ]

fake.sentence()
# 'Expedita at beatae voluptatibus nulla omnis.'

fake.sentence(ext_word_list=my_word_list)
# 'Oat beans oat Lollipop bar cheesecake.'

How to use with Factory Boy

Factory Boy already ships with integration with Faker. Simply use the factory.Faker method of factory_boy:

import factory
from myapp.models import Book

class BookFactory(factory.Factory):
    class Meta:
        model = Book

    title = factory.Faker('sentence', nb_words=4)
    author_name = factory.Faker('name')

Accessing the random instance

The .random property on the generator returns the instance of random.Random used to generate the values:

from faker import Faker
fake = Faker()
fake.random
fake.random.getstate()

By default all generators share the same instance of random.Random, which can be accessed with from faker.generator import random. Using this may be useful for plugins that want to affect all faker instances.

Unique values

Through use of the .unique property on the generator, you can guarantee that any generated values are unique for this specific instance.

from faker import Faker
fake = Faker()
names = [fake.unique.first_name() for i in range(500)]
assert len(set(names)) == len(names)

Calling fake.unique.clear() clears the already seen values. Note, to avoid infinite loops, after a number of attempts to find a unique value, Faker will throw a UniquenessException. Beware of the birthday paradox, collisions are more likely than you'd think.

from faker import Faker

fake = Faker()
for i in range(3):
     # Raises a UniquenessException
     fake.unique.boolean()

In addition, only hashable arguments and return values can be used with .unique.

Seeding the Generator

When using Faker for unit testing, you will often want to generate the same data set. For convenience, the generator also provide a seed() method, which seeds the shared random number generator. Calling the same methods with the same version of faker and seed produces the same results.

from faker import Faker
fake = Faker()
Faker.seed(4321)

print(fake.name())
# 'Margaret Boehm'

Each generator can also be switched to its own instance of random.Random, separate to the shared one, by using the seed_instance() method, which acts the same way. For example:

from faker import Faker
fake = Faker()
fake.seed_instance(4321)

print(fake.name())
# 'Margaret Boehm'

Please note that as we keep updating datasets, results are not guaranteed to be consistent across patch versions. If you hardcode results in your test, make sure you pinned the version of Faker down to the patch number.

If you are using pytest, you can seed the faker fixture by defining a faker_seed fixture. Please check out the pytest fixture docs to learn more.

Tests

Run tests:

$ tox

Write documentation for providers:

$ python -m faker > docs.txt

Contribute

Please see CONTRIBUTING.

License

Faker is released under the MIT License. See the bundled LICENSE file for details.

Credits

Comments
  • Move to 'faker' on Pypi

    Move to 'faker' on Pypi

    Looks like the Faker namespace on Pypi has been abandoned for quite a while: https://pypi.python.org/pypi/Faker

    This project's owner @joke2k should file a request to have the namespace transferred to this project.

    It would reduce confusion between Faker (project name) and fake-factory (how it gets pip installed).

    The pypi team is pretty good about transferring namespaces if they're clearly abandoned (which seems to be the case here).

    opened by jeffwidman 30
  • Reproducibility of results broken between Faker-0.7.18 and (Faker-0.8.0, 0.8.7)

    Reproducibility of results broken between Faker-0.7.18 and (Faker-0.8.0, 0.8.7)

    Faker-0.8.0 and Faker-0.7.18 generate different values when given the same random source.

    Is the deterministic generation a goal of the project or not? I assumed that it is before… because the README specifically says that it's useful for unit testing, which is how I use it.

    opened by sp-1234 23
  • AttributeError: 'module' object has no attribute 'Provider'   on Faker()

    AttributeError: 'module' object has no attribute 'Provider' on Faker()

    When i create a Faker class i got following error:

    ERROR: Failure: AttributeError ('module' object has no attribute 'Provider')
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
        addr.filename, addr.module)
      File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
        return self.importFromDir(dir_path, fqname)
      File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
        mod = load_module(part_fqname, fh, filename, desc)
      File "/home/rentapplication/django-rentapplication/rentapplication/tests/test_api/test_sessions.py", line 10, in <module>
        from rentapplication.tests.helpers import ReferrerFactory, LandlordFactory
      File "/home/rentapplication/django-rentapplication/rentapplication/tests/helpers.py", line 35, in <module>
        f = Faker()
      File "/usr/local/lib/python2.7/dist-packages/faker/factory.py", line 38, in create
        prov_cls, lang_found = cls._get_provider_class(prov_name, locale)
      File "/usr/local/lib/python2.7/dist-packages/faker/factory.py", line 49, in _get_provider_class
        provider_class = cls._find_provider_class(provider, locale)
      File "/usr/local/lib/python2.7/dist-packages/faker/factory.py", line 87, in _find_provider_class
        return provider_module.Provider
    AttributeError: 'module' object has no attribute 'Provider'```
    
    opened by aldarund 22
  • Typing [Fixed #1489!]

    Typing [Fixed #1489!]

    What does this change?

    Added type annotation hints to all functions/classes in faker!

    What was wrong

    faker did not include type annotations (issue #1489).

    How this fixes it

    • Added automatic type annotations with monkeytype (https://monkeytype.readthedocs.io/en/latest/) for all files in which it did not throw errors.
    • Manual linter fixes.
    • Manual fixes of missing type annotations or unknown type annotations (e.g. type None). Did a lot of code analysis myself, but would also like to credit @nicarl for his earlier work on type annotations (e.g. in documentory.py and generator.py).
    • mypy compliant (mypy -m faker). Also added mypy -m faker test to tox.ini!
    • flake8 compliant (flake8 faker tests)
    • isort compliant (python3 -m isort --check-only --diff .)
    bump-version:minor hacktoberfest-accepted 
    opened by MarcelRobeer 21
  • 8.7.0: pytest is failing

    8.7.0: pytest is failing

    • Faker version: 8.7.0
    • OS: Linux/x86_64

    Brief summary of the issue goes here.

    Steps to reproduce

    • "python setup.py build"
    • "python setup.py install --root </install/prefix>"
    • "/usr/bin/pytest" wyth PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
    + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-faker-8.7.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-faker-8.7.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
    + PYTHONDONTWRITEBYTECODE=1
    + /usr/bin/pytest -ra -q --ignore tests/providers/test_ssn.py
    =========================================================================== test session starts ============================================================================
    platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
    benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
    rootdir: /home/tkloczko/rpmbuild/BUILD/faker-8.7.0, configfile: setup.cfg
    plugins: Faker-8.7.0, forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1
    collected 1117 items / 2 errors / 1115 selected
    
    ================================================================================== ERRORS ==================================================================================
    _____________________________________________________________ ERROR collecting tests/sphinx/test_docstring.py ______________________________________________________________
    ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/faker-8.7.0/tests/sphinx/test_docstring.py'.
    Hint: make sure your test modules/packages have valid Python names.
    Traceback:
    /usr/lib64/python3.8/importlib/__init__.py:127: in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    tests/sphinx/test_docstring.py:8: in <module>
        from faker.sphinx.docstring import DEFAULT_SAMPLE_SIZE, DEFAULT_SEED, ProviderMethodDocstring, Sample
    E   ModuleNotFoundError: No module named 'faker.sphinx'
    _____________________________________________________________ ERROR collecting tests/sphinx/test_validator.py ______________________________________________________________
    ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/faker-8.7.0/tests/sphinx/test_validator.py'.
    Hint: make sure your test modules/packages have valid Python names.
    Traceback:
    /usr/lib64/python3.8/importlib/__init__.py:127: in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    tests/sphinx/test_validator.py:6: in <module>
        from faker.sphinx.validator import SampleCodeValidator
    E   ModuleNotFoundError: No module named 'faker.sphinx'
    ========================================================================= short test summary info ==========================================================================
    ERROR tests/sphinx/test_docstring.py
    ERROR tests/sphinx/test_validator.py
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    ============================================================================ 2 errors in 4.31s =============================================================================
    

    pytest is executed with --ignore tests/providers/test_ssn.py because https://github.com/joke2k/faker/issues/1454

    stale 
    opened by kloczek 21
  • Public IP blocks used with ipv4_public encompass reserved address namespaces

    Public IP blocks used with ipv4_public encompass reserved address namespaces

    The ipv4_public faker generates IP addresses from public blocks, excluding private blocks configured in IPV4_PUBLIC_NETS and IPV4_PRIVATE_NET_BLOCKS, however it often results in addresses coming from reserved spaces.

    One example is 192.0.0.145, or in general 192.0.0.0/24 addresses from reserved space, per https://en.wikipedia.org/wiki/Reserved_IP_addresses

    This clashes with many popular libraries checking whether IP is public and routable such as django-ipware.

    Steps to reproduce

    >>> startswith = False
    >>> while not startswith:
    ...   ip = fake.ipv4_public()
    ...   if ip.startswith('192.0.0'):
    ...     startswith = True
    ...     print(ip)
    ...
    192.0.0.145
    

    Expected behavior

    No address starting with 192.0.0 generated

    Actual behavior

    192.0.0.145 comes up often.

    opened by maticomp 19
  • Add support for multiple locale data generation

    Add support for multiple locale data generation

    What does this change

    Faker can now accept multiple locales while retaining the same signature to preserve backward compatibility.

    What was wrong

    Faker can only handle a single locale.

    How this fixes it

    The new Faker proxy class will internally create locale-specific generators as needed, and then proxy calls to the generators that can accommodate the call. Generator selection logic may also be specified via weights.

    Notes

    Needless to say, there will be a performance penalty, and the severity of the penalty depends on:

    • How many locales were specified
    • How many locale-specific generators can handle a certain call
    • If a custom distribution will be used

    Fixes #691, fixes #976, partial solution-ish to #453, related to #230

    opened by malefice 17
  • Not possible to seed uuid4

    Not possible to seed uuid4

    It is not possible to seed the uuid4 property.

    >>> f1 = Faker()
    >>> f1.seed(4321)
    >>> print(f1.uuid4())
    4a6d35db-b61b-49ed-a225-e16bc164f7cc
    
    >>> f2 = Faker()
    >>> f2.seed(4321)
    >>> print(f2.uuid4())
    b5f05be8-2f57-4a52-9b6f-5bcd03125278
    
    

    The solution is pretty much given in: http://stackoverflow.com/questions/41186818/how-to-generate-a-random-uuid-which-is-reproducible-with-a-seed-in-python

    opened by J535D165 16
  • 13.3.5: pytest is failing because it uses no longer maintained `random2` module

    13.3.5: pytest is failing because it uses no longer maintained `random2` module

    • Faker version: 13.3.5
    • OS: Linux x86/64

    Brief summary of the issue

    Looks like pytest is failing because test suite still is using outdated random2 module which was never updated for python 3.x).

    Steps to reproduce

    I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

    • python3 -sBm build -w --no-isolation
    • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
    • install .whl file in </install/prefix>
    • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

    Expected behavior

    pytest should not fail.

    Actual behavior

    Here is pytest output:

    + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-faker-13.3.5-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-faker-13.3.5-2.fc35.x86_64/usr/lib/python3.8/site-packages
    + /usr/bin/pytest -ra -q
    =========================================================================== test session starts ============================================================================
    platform linux -- Python 3.8.13, pytest-7.1.1, pluggy-1.0.0
    rootdir: /home/tkloczko/rpmbuild/BUILD/faker-13.3.5, configfile: setup.cfg
    plugins: Faker-13.3.5
    collected 1491 items / 1 error
    
    ================================================================================== ERRORS ==================================================================================
    _______________________________________________________________ ERROR collecting tests/providers/test_ssn.py _______________________________________________________________
    ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/faker-13.3.5/tests/providers/test_ssn.py'.
    Hint: make sure your test modules/packages have valid Python names.
    Traceback:
    /usr/lib64/python3.8/importlib/__init__.py:127: in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    tests/providers/test_ssn.py:11: in <module>
        import random2
    E   ModuleNotFoundError: No module named 'random2'
    ============================================================================= warnings summary =============================================================================
    ../../BUILDROOT/python-faker-13.3.5-2.fc35.x86_64/usr/lib/python3.8/site-packages/faker/providers/person/fr_QC/__init__.py:10
      /home/tkloczko/rpmbuild/BUILDROOT/python-faker-13.3.5-2.fc35.x86_64/usr/lib/python3.8/site-packages/faker/providers/person/fr_QC/__init__.py:10: UserWarning: fr_QC locale is deprecated. Please use fr_CA.
        warnings.warn("fr_QC locale is deprecated. Please use fr_CA.")
    
    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
    ========================================================================= short test summary info ==========================================================================
    ERROR tests/providers/test_ssn.py
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    ======================================================================= 1 warning, 1 error in 10.95s =======================================================================
    
    help wanted 
    opened by kloczek 15
  • Add a random image provider

    Add a random image provider

    Python Image Library is used under the hood to generate a background and drawing a polygon, while forwarding the color generation to the existing color provider.

    So as not to force a dependency on Pillow for all installs, this provider will not work in absence of this library.

    A polygon shape is chosen because its the easiest drawing method to interface with random coordinates, as opposed to ellipses or alike that constrain input parameters, while still providing easily distinguishable random images, as opposed to random noise bitmaps.

    bump-version:minor hacktoberfest-accepted 
    opened by n1ngu 15
  • text-unidecode is released under the Artistic license

    text-unidecode is released under the Artistic license

    text-unidecode is released under the Artistic license v1.0, which is considered non-free by the FSF (and therefore not compatible with the GPL). I believe this clause is also of concern to commercial users of faker too:

    1. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own.

    Not being able to charge a fee for the software is problematic for those of us who are contractors, for example.

    I realise there aren't really any good alternatives (unidecode is GPL licensed as pointed out in #628 , isounidecode doesn't support Python 3), so would a patch making text-unidecode an optional dependency be acceptable?

    opened by moggers87 15
  • Suggestion: generate valid data for barcode structures

    Suggestion: generate valid data for barcode structures

    • Faker version: 15.3.4
    • OS: Windows

    Suggestion: faker already includes functions to generate simple 1d barcodes (ean8 and ean13) plus a few more. In the barcode world there are many other data structures which would be useful to fake.

    I work professionally with barcodes from a customer pov. and often come across some of these:

    • GS1 structure
    • German Post (premium post)
    • UK Royal Mail datamatrix
    • Swiss QR code
    • vcard structure
    • UPU parcel code

    In principle these are just appearing as "random strings", but the data format has to be in a very specific way. It would be very useful to generate such structures and feed to a barcode generator.

    opened by myicq 0
  • Fix siret and siren generation for fr_FR locale company information

    Fix siret and siren generation for fr_FR locale company information

    Hi !

    This is a new attempt to fix the French SIRET/SIREN generation.

    The correction was first submitted in MR #1465 in 2021 but never merged

    I simply did a rebase from the master branch and I added basic tests

    opened by daamien 0
  • Add market-data identifiers provider

    Add market-data identifiers provider

    What does this change

    Adds a new provider (faker-marketdata) to generate fake market data widely used in financial services (ISIN, SEDOL, CUSIP, etc.). List of supported IDs is in the documentation.

    What was wrong

    No bugs fixed with this PR

    opened by rubenafo 0
  • Bump actions/stale from 6 to 7

    Bump actions/stale from 6 to 7

    Bumps actions/stale from 6 to 7.

    Release notes

    Sourced from actions/stale's releases.

    v7.0.0

    ⚠️ This version contains breaking changes ⚠️

    What's Changed

    Breaking Changes

    • In this release we prevent this action from managing the stale label on items included in exempt-issue-labels and exempt-pr-labels
    • We decided that this is outside of the scope of this action, and to be left up to the maintainer

    New Contributors

    Full Changelog: https://github.com/actions/stale/compare/v6...v7.0.0

    v6.0.1

    Update @​actions/core to 1.10.0 #839

    Full Changelog: https://github.com/actions/stale/compare/v6.0.0...v6.0.1

    Changelog

    Sourced from actions/stale's changelog.

    Changelog

    [7.0.0]

    :warning: Breaking change :warning:

    [6.0.1]

    Update @​actions/core to v1.10.0 (#839)

    [6.0.0]

    :warning: Breaking change :warning:

    Issues/PRs default close-issue-reason is now not_planned(#789)

    [5.1.0]

    Don't process stale issues right after they're marked stale [Add close-issue-reason option]#764#772 Various dependabot/dependency updates

    4.1.0 (2021-07-14)

    Features

    4.0.0 (2021-07-14)

    Features

    Bug Fixes

    • dry-run: forbid mutations in dry-run (#500) (f1017f3), closes #499
    • logs: coloured logs (#465) (5fbbfba)
    • operations: fail fast the current batch to respect the operations limit (#474) (5f6f311), closes #466
    • label comparison: make label comparison case insensitive #517, closes #516
    • filtering comments by actor could have strange behavior: "stale" comments are now detected based on if the message is the stale message not who made the comment(#519), fixes #441, #509, #518

    Breaking Changes

    ... (truncated)

    Commits
    • 6f05e42 draft release for v7.0.0 (#888)
    • eed91cb Update how stale handles exempt items (#874)
    • 10dc265 Merge pull request #880 from akv-platform/update-stale-repo
    • 9c1eb3f Update .md files and allign build-test.yml with the current test.yml
    • bc357bd Update .github/workflows/release-new-action-version.yml
    • 690ede5 Update .github/ISSUE_TEMPLATE/bug_report.md
    • afbcabf Merge branch 'main' into update-stale-repo
    • e364411 Update name of codeql.yml file
    • 627cef3 fix print outputs step (#859)
    • 975308f Merge pull request #876 from jongwooo/chore/use-cache-in-check-dist
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • name_female generates mixed names

    name_female generates mixed names

    • Faker version: Lastest
    • OS: NA

    Using name_female actually ends up generating mixed names, the same is true for name_male.

    Steps to reproduce

    from faker import Faker
    
    fake = Faker("en-GB")
    
    for i in range(1, 100):
        print(fake["en-GB"].name_female())
    

    Example output:

    ...
    Mr. Russell Morgan
    Mr. Vincent Frost
    Ruth Perry
    Jacob Harris-Fitzgerald
    Frances Robinson
    Guy Hayward
    Pamela Sanders-Davis
    Frederick Doyle
    Diana Hayes
    Diane Hudson
    Mr. Leonard Simpson
    Mrs. Natalie Wilson
    ...
    

    Expected behavior

    Generates only female names.

    Actual behavior

    Generates mixed names.

    This appears to be because formats_female is not defined, which then causes the function to fall back to a general format.

    https://github.com/joke2k/faker/blob/7e78eef2565c5ce78b879bf271f520e817f55d4f/faker/providers/person/init.py#L230-L236

    opened by constancepopovic 2
  • Feature/allow passing optional json encoder

    Feature/allow passing optional json encoder

    What does this change

    Allowing callers to misc.json provider pass a json encoder subclass so they can later be converted to json objects

    What was wrong

    kwargs = {"data_columns": {"item1": "date_time"}, "num_rows": 1}
    faker.json(**kwargs)
    

    would raise an error as datetime objects can be serialized into json.

    How this fixes it

    caller can pass a class which serializes any desired object into something which json compliant.

    opened by NI1993 0
Releases(v15.3.4)
Owner
Daniele Faraglia
Web-native developer, UK based Self-employed
Daniele Faraglia
Python tools for penetration testing

pyTools_PT python tools for penetration testing Please don't use these tool for illegal purposes. These tools is meant for penetration testing for leg

Gourab 1 Dec 01, 2021
Docker-based integration tests

Docker-based integration tests Description Simple pytest fixtures that help you write integration tests with Docker and docker-compose. Specify all ne

Avast 326 Dec 27, 2022
API Rest testing FastAPI + SQLAchmey + Docker

Transactions API Rest Implement and design a simple REST API Description We need to a simple API that allow us to register users' transactions and hav

TxeMac 2 Jun 30, 2022
AllPairs is an open source test combinations generator written in Python

AllPairs is an open source test combinations generator written in Python

Robson Agapito Correa 5 Mar 05, 2022
0hh1 solver for the web (selenium) and also for mobile (adb)

0hh1 - Solver Aims to solve the '0hh1 puzzle' for all the sizes (4x4, 6x6, 8x8, 10x10 12x12). for both the web version (using selenium) and on android

Adwaith Rajesh 1 Nov 05, 2021
自动化爬取并自动测试所有swagger-ui.html显示的接口

swagger-hack 在测试中偶尔会碰到swagger泄露 常见的泄露如图: 有的泄露接口特别多,每一个都手动去试根本试不过来 于是用python写了个脚本自动爬取所有接口,配置好传参发包访问 原理是首先抓取http://url/swagger-resources 获取到有哪些标准及对应的文档地

jayus 534 Dec 29, 2022
hyppo is an open-source software package for multivariate hypothesis testing.

hyppo (HYPothesis Testing in PythOn, pronounced "Hippo") is an open-source software package for multivariate hypothesis testing.

neurodata 137 Dec 18, 2022
An improbable web debugger through WebSockets

wdb - Web Debugger Description wdb is a full featured web debugger based on a client-server architecture. The wdb server which is responsible of manag

Kozea 1.6k Dec 09, 2022
hCaptcha solver and bypasser for Python Selenium. Simple website to try to solve hCaptcha.

hCaptcha solver for Python Selenium. Many thanks to engageub for his hCaptcha solver userscript. This script is solely intended for the use of educati

Maxime Dréan 59 Dec 25, 2022
Bayesian A/B testing

bayesian_testing is a small package for a quick evaluation of A/B (or A/B/C/...) tests using Bayesian approach.

Matus Baniar 35 Dec 15, 2022
A Modular Penetration Testing Framework

fsociety A Modular Penetration Testing Framework Install pip install fsociety Update pip install --upgrade fsociety Usage usage: fsociety [-h] [-i] [-

fsociety-team 802 Dec 31, 2022
Tattoo - System for automating the Gentoo arch testing process

Naming origin Well, naming things is very hard. Thankfully we have an excellent

Arthur Zamarin 4 Nov 07, 2022
Python 3 wrapper of Microsoft UIAutomation. Support UIAutomation for MFC, WindowsForm, WPF, Modern UI(Metro UI), Qt, IE, Firefox, Chrome ...

Python 3 wrapper of Microsoft UIAutomation. Support UIAutomation for MFC, WindowsForm, WPF, Modern UI(Metro UI), Qt, IE, Firefox, Chrome ...

yin kaisheng 1.6k Dec 29, 2022
How to Create a YouTube Bot that Increases Views using Python Programming Language

YouTube-Bot-in-Python-Selenium How to Create a YouTube Bot that Increases Views using Python Programming Language. The app is for educational purpose

Edna 14 Jan 03, 2023
Just for testing video streaming using pytgcalls.

tgvc-video-tests Just for testing video streaming using pytgcalls. Note: The features used in this repository is highly experimental and you might not

wrench 34 Dec 27, 2022
Show, Edit and Tell: A Framework for Editing Image Captions, CVPR 2020

Show, Edit and Tell: A Framework for Editing Image Captions | arXiv This contains the source code for Show, Edit and Tell: A Framework for Editing Ima

Fawaz Sammani 76 Nov 25, 2022
Hamcrest matchers for Python

PyHamcrest Introduction PyHamcrest is a framework for writing matcher objects, allowing you to declaratively define "match" rules. There are a number

Hamcrest 684 Dec 29, 2022
A toolbar overlay for debugging Flask applications

Flask Debug-toolbar This is a port of the excellent django-debug-toolbar for Flask applications. Installation Installing is simple with pip: $ pip ins

863 Dec 29, 2022
The Social-Engineer Toolkit (SET) repository from TrustedSec - All new versions of SET will be deployed here.

💼 The Social-Engineer Toolkit (SET) 💼 Copyright 2020 The Social-Engineer Toolkit (SET) Written by: David Kennedy (ReL1K) @HackingDave Company: Trust

trustedsec 8.4k Dec 31, 2022
To automate the generation and validation tests of COSE/CBOR Codes and it's base45/2D Code representations

To automate the generation and validation tests of COSE/CBOR Codes and it's base45/2D Code representations, a lot of data has to be collected to ensure the variance of the tests. This respository was

160 Jul 25, 2022