Skip to main content

Faker Literature Provider

faker-literature is an additional Faker provider for generating literature-related test data. The first release supports fr_FR and en_US, with well-known French and English-language authors and works.

Installation

pip install faker-literature

Usage

from faker import Faker
from faker_literature import LiteratureProvider

fake = Faker("fr_FR")
fake.add_provider(LiteratureProvider)

print(fake.writer())
print(fake.title())
print(fake.genre())
print(fake.publication_year())
print(fake.pages())
print(fake.publisher())
print(fake.book())

book() returns one coherent dictionary containing writer, title, genre, year, pages, and publisher. author() is an alias for writer(), and literary_work() is an alias for book().

Supported locales are fr_FR and en_US. Using another locale raises ValueError so unsupported data is not silently mixed into a dataset.

Development

python -m venv .venv
source .venv/bin/activate
pip install -e ".[test]"
pytest
python -m build

Publishing on PyPI

After checking the generated distributions with twine check dist/*, upload them with:

twine upload dist/*

Metadata

Release files for faker-literature 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faker-literature 0.1.0
File Size Uploaded Provenance Actions
faker_literature-0.1.0.tar.gz 33.6 kB Without provenance Details for faker_literature-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for faker-literature 0.1.0
File Interpreter ABI Platform Actions
faker_literature-0.1.0-py3-none-any.whl Python 3 none any Details for faker_literature-0.1.0-py3-none-any.whl

Total release size: 65.8 kB

Release files / faker_literature-0.1.0.tar.gz

Download URL faker_literature-0.1.0.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b2fc6a1287800b9c1443c084ee7fcde5d42e61c6f5c02f56e45dbf9bd97c1f82
BLAKE2b-256 checksum
How to use checksums
70658935d73bb1cce04b3dd26425da76a20bb7494f2540c8a7c8f9358cd7fa57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / faker_literature-0.1.0-py3-none-any.whl

Download URL faker_literature-0.1.0-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bd6969336d35f8f7f3f0222b341a9e380748f5e9f08c6b644ce05919d97bd7d
BLAKE2b-256 checksum
How to use checksums
19f72b1cffcfe8c0a58e6dc3fa09d3cbb96bafb8f42a7c0c7be246add485cf00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for faker-literature 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page