Skip to content

Commit 0dba568

Browse files
jqueguinerclaude
andcommitted
docs(readme): add auto-updating CI / coverage / PyPI / license badges
Coverage is now uploaded to Codecov from the CI (measured: 95%), so the badge refreshes on every push instead of going stale. Also fixes the remaining 'from faker import' snippets: the import name is faker2, which means faker2 and upstream Faker CAN coexist in the same environment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 287f031 commit 0dba568

2 files changed

Lines changed: 34 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,16 @@ jobs:
218218
env:
219219
COVERALLS_PARALLEL: true
220220
COVERALLS_FLAG_NAME: run-ubuntu-${{ matrix.python }}
221+
- name: Coverage report (xml)
222+
run: |
223+
python -m pip install coverage
224+
python -m coverage xml || true
225+
- name: Upload coverage to Codecov
226+
uses: codecov/codecov-action@v5
227+
with:
228+
files: ./coverage.xml
229+
flags: ubuntu-${{ matrix.python }}
230+
fail_ci_if_error: false
221231
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
222232
COVERALLS_SERVICE_NAME: github
223233

README.rst

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
faker2
22
======
33

4+
|ci| |coverage| |pypi| |pyversions| |license|
5+
46
**faker2** is a fork of `joke2k/Faker <https://github.com/joke2k/faker>`_ — the
57
reference Python library for generating fake data — extended for one specific job:
68
**pseudonymizing personally identifiable information (PII) in speech and text
79
datasets, 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

99101
Usage
100102
-----
101103

102104
Identical to upstream — see the `Faker documentation <https://faker.readthedocs.io>`_.
103105
The 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
112114
storing 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

126128
MIT, 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

Comments
 (0)