Skip to content

Commit

Permalink
More on docs
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Nov 27, 2023
1 parent e3b4732 commit 7bd6b6a
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 2 deletions.
135 changes: 134 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ various types of random data for testing and other purposes. The package
provides a simplified, dependency-free alternative for generating random
words, sentences, paragraphs, file names, URLs, person names, as well as
bytes content for ``PDF``-, ``DOCX``- and various image formats (such as
``PNG``, ``SVG``, ``BMP`` and ``GIF``).
``PNG``, ``SVG``, ``BMP`` and ``GIF``). It also can create files directly
on your filesystem.

Requirements
============
Expand Down Expand Up @@ -434,6 +435,138 @@ Arguments:
default set to ``1``, but if ``texts`` is given, the value of ``nb_pages``
is adjusted accordingly.

----

**pdf_file**

Generates a ``PDF`` file.

.. code-block:: python
FAKER.pdf_file()
Arguments:

.. note::

Accepts all arguments of ``pdf`` + the following:

- ``storage`` (type: ``BaseStorage``, default value: ``None``) is an optional
argument.
- ``basename`` (type: ``str``, default value: ``None``) is an optional
argument.
- ``prefix`` (type: ``str``, default value: ``None``) is an optional argument.

----

**png_file**

Generates a ``PNG`` file.

.. code-block:: python
FAKER.png_file()
Arguments:

.. note::

Accepts all arguments of ``png`` + the following:

- ``storage`` (type: ``BaseStorage``, default value: ``None``) is an optional
argument.
- ``basename`` (type: ``str``, default value: ``None``) is an optional
argument.
- ``prefix`` (type: ``str``, default value: ``None``) is an optional argument.

----

**svg_file**

Generates an ``SVG`` file.

.. code-block:: python
FAKER.svg_file()
Arguments:

.. note::

Accepts all arguments of ``svg`` + the following:

- ``storage`` (type: ``BaseStorage``, default value: ``None``) is an optional
argument.
- ``basename`` (type: ``str``, default value: ``None``) is an optional
argument.
- ``prefix`` (type: ``str``, default value: ``None``) is an optional argument.

----

**bmp_file**

Generates a ``BMP`` file.

.. code-block:: python
FAKER.bmp_file()
Arguments:

.. note::

Accepts all arguments of ``bmp`` + the following:

- ``storage`` (type: ``BaseStorage``, default value: ``None``) is an optional
argument.
- ``basename`` (type: ``str``, default value: ``None``) is an optional
argument.
- ``prefix`` (type: ``str``, default value: ``None``) is an optional argument.

----

**gif_file**

Generates a ``GIF`` file.

.. code-block:: python
FAKER.gif_file()
Arguments:

.. note::

Accepts all arguments of ``gif`` + the following:

- ``storage`` (type: ``BaseStorage``, default value: ``None``) is an optional
argument.
- ``basename`` (type: ``str``, default value: ``None``) is an optional
argument.
- ``prefix`` (type: ``str``, default value: ``None``) is an optional argument.

----

**txt_file**

Generates a ``TXT`` file.

.. code-block:: python
FAKER.txt_file()
Arguments:

.. note::

Accepts all arguments of ``text`` + the following:

- ``storage`` (type: ``BaseStorage``, default value: ``None``) is an optional
argument.
- ``basename`` (type: ``str``, default value: ``None``) is an optional
argument.
- ``prefix`` (type: ``str``, default value: ``None``) is an optional argument.

Tests
=====

Expand Down
1 change: 0 additions & 1 deletion fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,6 @@ def docx(
def pdf_file(
self,
nb_pages: int = 1,
texts: Optional[List[str]] = None,
generator: Union[
Type[TextPdfGenerator], Type[GraphicPdfGenerator]
] = GraphicPdfGenerator,
Expand Down

0 comments on commit 7bd6b6a

Please sign in to comment.