11faker2
22======
33
4+ |ci | |coverage | |pypi | |pyversions | |license |
5+
46**faker2 ** is a fork of `joke2k/Faker <https://github.com/joke2k/faker >`_ — the
57reference Python library for generating fake data — extended for one specific job:
68**pseudonymizing personally identifiable information (PII) in speech and text
79datasets, in every language a speech model transcribes. **
810
9- It is a ** drop-in replacement **: the import name stays ``faker ``, so existing code
10- keeps working unchanged ::
11+ Install it alongside upstream Faker if you want — the import name is ``faker2 ``, so
12+ both can coexist ::
1113
1214 pip install faker2
1315
@@ -93,16 +95,16 @@ Relationship with upstream
9395 unchanged; new locales follow the project's exact provider conventions.
9496- Locale contributions made here are intended to be **offered back upstream ** where
9597 they fit the project's scope.
96- - ``faker2 `` and `` Faker `` both provide the `` faker `` import name and therefore
97- ** cannot be installed side by side ** in the same environment.
98+ - ``faker2 `` uses its own import name (`` faker2 ``), so it ** can be installed side by
99+ side ** with upstream `` Faker `` in the same environment.
98100
99101Usage
100102-----
101103
102104Identical to upstream — see the `Faker documentation <https://faker.readthedocs.io >`_.
103105The only difference is the set of available locales::
104106
105- from faker import Faker
107+ from faker2 import Faker
106108
107109 Faker("yue_HK").name() # 陳嘉敏
108110 Faker("sr_RS").name() # Милена Чолић
@@ -112,7 +114,7 @@ Pseudonymization tip — seed per source item so the mapping is reproducible wit
112114storing any real→fake table::
113115
114116 import hashlib
115- from faker import Faker
117+ from faker2 import Faker
116118
117119 def surrogate(original: str, text: str, locale: str) -> str:
118120 seed = int(hashlib.sha1(f"{text}\0{original}".encode()).hexdigest()[:12], 16)
@@ -124,3 +126,19 @@ License
124126-------
125127
126128MIT, unchanged from upstream. See ``LICENSE.txt ``.
129+
130+ .. |ci | image :: https://github.com/jqueguiner/faker2/actions/workflows/ci.yml/badge.svg?branch=master
131+ :target: https://github.com/jqueguiner/faker2/actions/workflows/ci.yml
132+ :alt: CI
133+ .. |coverage | image :: https://codecov.io/gh/jqueguiner/faker2/branch/master/graph/badge.svg
134+ :target: https://codecov.io/gh/jqueguiner/faker2
135+ :alt: Coverage
136+ .. |pypi | image :: https://img.shields.io/pypi/v/faker2.svg
137+ :target: https://pypi.org/project/faker2/
138+ :alt: PyPI version
139+ .. |pyversions | image :: https://img.shields.io/pypi/pyversions/faker2.svg
140+ :target: https://pypi.org/project/faker2/
141+ :alt: Supported Python versions
142+ .. |license | image :: https://img.shields.io/badge/license-MIT-blue.svg
143+ :target: https://github.com/jqueguiner/faker2/blob/master/LICENSE.txt
144+ :alt: License: MIT
0 commit comments