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

Storages #2

Merged
merged 8 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ are used for versioning (schema follows below):
0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.

0.1.3
-----
2023-11-28

- Added ``pdf_file``, ``docx_file``, ``png_file``, ``svg_file``, ``bmp_file``,
``gif_file`` support.
- Added storages.

0.1.2
-----
2023-11-26
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Update version ONLY here
VERSION := 0.1.2
VERSION := 0.1.3
SHELL := /bin/bash
# Makefile for project
VENV := ~/.virtualenvs/fake.py/bin/activate
Expand Down
137 changes: 135 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ Overview
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``).
bytes content for ``PDF``-, ``DOCX``- and various image formats (such as
``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
Loading