When an application collects a profession, a generic fake value such as Engineer can make Brazilian Portuguese test data look artificial. That matters in fixtures, demos, localization checks, and form validation: the value should look plausible without representing a real person.
faker_job_brazil is a small Apache-2.0 provider for the Python Faker package. It adds a profissao() method that returns a random job title from a list of Brazilian Portuguese occupations.
This tutorial shows the smallest working integration, how to make the result reproducible, and where the package's age changes the recommendation. The project is useful as a focused data provider, but its published version is 0.0.1.dev0 and its metadata describes it as Alpha software.
TL;DR
Install Faker and faker_job_brazil, register BrazilJobProvider on a Faker instance, then call fake.profissao().
python -m pip install Faker faker_job_brazil
from faker import Faker
from faker_job_brazil import BrazilJobProvider
fake = Faker("pt_BR")
fake.add_provider(BrazilJobProvider)
print(fake.profissao())
The provider is intentionally simple: it selects one title from the project's embedded list. It does not validate occupations, generate employment records, or connect a title to a real labor-market source.
Prerequisites
You need Python and an isolated environment such as venv. The package metadata does not declare a minimum Python version, and the repository's classifiers include Python 2.7 through Python 3.6. That is historical metadata rather than a promise that every modern or old interpreter is supported.
Create a clean environment for the example:
python -m venv .venv
# macOS or Linux
source .venv/bin/activate
# Windows PowerShell
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install Faker faker_job_brazil
The current PyPI release is 0.0.1.dev0. Pin it in an application's dependency file if you need repeatable installation, and review the package before upgrading because this is a very small, old provider.
Add the Brazilian job provider
The provider follows Faker's extension model. BrazilJobProvider inherits from Faker's BaseProvider, so it can be registered on an existing generator rather than requiring a separate API.
from faker import Faker
from faker_job_brazil import BrazilJobProvider
fake = Faker("pt_BR")
fake.add_provider(BrazilJobProvider)
for _ in range(5):
print(fake.profissao())
The locale argument is useful for the rest of your fixture data, but it does not change the provider's occupation list. profissao() comes from BrazilJobProvider, and the repository defines its data directly in src/job/__init__.py.
A run can produce values such as Engenheiro de som, Terapeuta floral, or Programador. The exact output is random, so tests should not assert one particular title unless you seed the generator or inject the value explicitly.
Make generated data reproducible
Random data is convenient for a demo and dangerous for a brittle test. Faker supports seeding its generator. Seed the instance before generating the fixture when a test needs stable output.
from faker import Faker
from faker_job_brazil import BrazilJobProvider
fake = Faker("pt_BR")
fake.add_provider(BrazilJobProvider)
fake.seed_instance(20261123)
first = fake.profissao()
second = fake.profissao()
print(first)
print(second)
This makes the sequence reproducible for the same Faker and provider behavior. It does not make the sequence a contract. A package update, a changed occupation list, or a different Faker version can change the values. For long-lived tests, assert properties such as type, non-empty content, or membership in a fixture you control instead of treating a generated title as business truth.
Verify the integration
Use a short check that exercises the same path as your application:
from faker import Faker
from faker_job_brazil import BrazilJobProvider
fake = Faker("pt_BR")
fake.add_provider(BrazilJobProvider)
values = [fake.profissao() for _ in range(100)]
assert all(isinstance(value, str) and value.strip() for value in values)
assert len(set(values)) > 1
print("generated", len(values), "non-empty job titles")
The first assertion checks the provider's basic output shape. The second is a smoke test that the sample did not repeatedly select one value. It is intentionally not a statistical quality test: the provider uses Faker's random selection, and a small sample can vary.
I also verified the minimal path in a fresh Python virtual environment with Faker 40.63.0 and the PyPI package faker_job_brazil 0.0.1.dev0. Installation completed and the provider returned a Portuguese occupation. The package's own repository is the authoritative source for its implementation and declares Apache License 2.0.
Why this works
Faker providers are small adapters. A provider exposes methods that become available on a Faker generator after registration. In this project, the adapter has two important pieces:
- A
jobslist containing Portuguese occupation names. - A
profissao()method that delegates selection toself.random_element(self.jobs).
That design keeps the integration predictable. It also makes the boundary clear: the provider supplies labels, not structured occupations. If your application needs an occupation code, sector, seniority, salary range, or a relationship between profession and other fields, create a domain-specific fixture model instead of inferring those values from the returned string.
Failure modes and limitations
The provider is not current labor-market data
The list is embedded in the repository and includes broad, historical, informal, and specialized titles. It may contain spelling choices or categories that do not fit your product. Review the generated values before using them in customer-facing examples.
Random values are not unique identities
Two generated users can have the same profession. Do not use profissao() as a username, identifier, authorization attribute, or evidence that a person has a qualification.
Do not use it for sensitive profiling
A fake occupation is suitable for synthetic test data. It should not be used to infer a real person's income, health, social class, eligibility, or suitability. Keep generated records clearly separated from production data and label seeded fixtures as synthetic.
Installation metadata is legacy-oriented
The repository's setup.py uses old packaging conventions and lists faker without a version bound. The package currently installs with a modern Faker release in the smoke test above, but that is evidence for this path, not a compatibility guarantee for every environment. Use a lock file and test the versions your application supports.
Do not assert an exact random output by accident
If a test starts failing because a generated title changed, decide whether the test needs deterministic seeding, a fixed fixture, or only a shape assertion. Generated data is a test aid, not the behavior under test.
FAQ
Does the locale argument translate the job titles?
No. Faker("pt_BR") configures Faker's other providers. BrazilJobProvider supplies its own Portuguese list.
Can I call fake.profissao() without registration?
Not with a plain Faker instance. Import BrazilJobProvider and call fake.add_provider(BrazilJobProvider) first.
Should I use this for production recommendations?
No. Use an authoritative, maintained dataset for search, classification, payroll, compliance, or career decisions. This package is a lightweight source of synthetic labels.
Can I extend the list?
Yes. You can create your own provider or maintain a project-local fixture list. Check the repository's Apache-2.0 terms and retain required notices when redistributing copied material.
Takeaway
faker_job_brazil is a compact way to add Brazilian Portuguese profession labels to Faker fixtures. Register the provider, seed it when reproducibility matters, and keep the package's Alpha status and embedded-data limitations visible in your dependency decision.
What is the most useful next field to pair with a synthetic Brazilian profession in your test fixtures: an industry, an education level, or a locale-aware address?
Disclosure: I used AI assistance to organize and edit this tutorial. The installation path, package versions, provider behavior, source references, and limitations were checked against the public repository, PyPI metadata, and a fresh local smoke test.
Top comments (0)