Django storage for fake.py
Project description
fake-py-django-storage is a Django storage integration for fake.py - a standalone, portable library designed for generating various random data types for testing.
Features
Almost seamless integration with Django (and django-storages).
Prerequisites
Python 3.9+
Installation
pip install fake-py-django-storage
Documentation
Documentation is available on Read the Docs.
For guidelines on contributing check the Contributor guidelines.
Usage
FileSystemStorage of Django
from fake import FAKER
from fakepy.django_storage.filesystem import DjangoFileSystemStorage
STORAGE = DjangoFileSystemStorage(
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
AWS S3 (using django-storages)
from fake import FAKER
from fakepy.django_storage.aws_s3 import DjangoAWSS3Storage
STORAGE = DjangoAWSS3Storage(
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
Google Cloud Storage (using django-storages)
from fake import FAKER
from fakepy.django_storage.google_cloud_storage import (
DjangoGoogleCloudStorage,
)
STORAGE = DjangoGoogleCloudStorage(
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
Azure Cloud Storage (using django-storages)
from fake import FAKER
from fakepy.django_storage.azure_cloud_storage import (
DjangoAzureCloudStorage,
)
STORAGE = DjangoAzureCloudStorage(
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
Tests
pytest
Writing documentation
Keep the following hierarchy.
=====
title
=====
header
======
sub-header
----------
sub-sub-header
~~~~~~~~~~~~~~
sub-sub-sub-header
^^^^^^^^^^^^^^^^^^
sub-sub-sub-sub-header
++++++++++++++++++++++
sub-sub-sub-sub-sub-header
**************************
License
MIT
Support
For security issues contact me at the e-mail given in the Author section.
For overall issues, go to GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fake_py_django_storage-0.1.tar.gz
(32.7 kB
view hashes)
Built Distribution
Close
Hashes for fake_py_django_storage-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecacce14ed782284439e48b22b0d727fc63434b1141692e9a94576e4747f9086 |
|
MD5 | d97ee80fdaf7fbc6208808d5a9fb2306 |
|
BLAKE2b-256 | d374737d25d5eb73f8be3a19d10194bcbd0218b113e84440f96489f90548b5f0 |
Close
Hashes for fake_py_django_storage-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1027a9dd3d5ba3b2a20af4cc58967e44d3388e412419df682f2d87ad10a72fe |
|
MD5 | 7344dddfab07cbdc394258df7fcd1b68 |
|
BLAKE2b-256 | 43d17b104b61a39f3768d9ded9357411de9485e50c756bcc8d8a6f9d105dad02 |