Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up #14

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,7 @@ class FileSystemStorage(BaseStorage):

.. code-block:: python

from fake import Faker, FileSystemStorage

FAKER = Faker()
from fake import FAKER, FileSystemStorage

storage = FileSystemStorage()
docx_file = storage.generate_filename(prefix="zzz_", extension="docx")
Expand All @@ -346,9 +344,7 @@ class FileSystemStorage(BaseStorage):

.. code-block:: python

from fake import Faker, FileSystemStorage

FAKER = Faker()
from fake import FAKER, FileSystemStorage

storage = FileSystemStorage()
docx_file = FAKER.docx_file(storage=storage)
Expand Down Expand Up @@ -450,9 +446,7 @@ class TextPdfGenerator:
.. code-block:: python

from pathlib import Path
from fake import Faker, TextPdfGenerator

FAKER = Faker()
from fake import FAKER, TextPdfGenerator

Path("/tmp/text_example.pdf").write_bytes(
FAKER.pdf(nb_pages=100, generator=TextPdfGenerator)
Expand Down Expand Up @@ -562,9 +556,7 @@ class GraphicPdfGenerator:
.. code-block:: python

from pathlib import Path
from fake import Faker, GraphicPdfGenerator

FAKER = Faker()
from fake import FAKER, GraphicPdfGenerator

Path("/tmp/graphic_example.pdf").write_bytes(
FAKER.pdf(nb_pages=100, generator=GraphicPdfGenerator)
Expand Down Expand Up @@ -770,9 +762,8 @@ class DocxGenerator:
.. code-block:: python

from pathlib import Path
from fake import Faker
from fake import FAKER

FAKER = Faker()
Path("/tmp/example.docx").write_bytes(FAKER.docx(nb_pages=100))
"""

Expand Down Expand Up @@ -838,9 +829,7 @@ class Faker:

.. code-block:: python

from fake import Faker

FAKER = Faker()
from fake import FAKER

print(FAKER.first_name()) # Random first name
print(FAKER.last_name()) # Random last name
Expand All @@ -866,9 +855,7 @@ class Faker:
.. code-block:: python

from pathlib import Path
from fake import Faker, TextPdfGenerator, GraphicPdfGenerator

FAKER = Faker()
from fake import FAKER, TextPdfGenerator, GraphicPdfGenerator

Path("/tmp/graphic_pdf.pdf").write_bytes(
FAKER.pdf(nb_pages=100, generator=GraphicPdfGenerator)
Expand All @@ -885,9 +872,7 @@ class Faker:
.. code-block:: python

from pathlib import Path
from fake import Faker

FAKER = Faker()
from fake import FAKER

Path("/tmp/image.png").write_bytes(FAKER.png())

Expand Down