fake-py-pathy-storage is a Pathy storage integration for fake.py - a standalone, portable library designed for generating various random data types for testing.
- Cloud storages integration includes support for AWS S3, Google Cloud Storage and Azure Cloud Storage.
Python 3.9+
pip install fake-py-pathy-storage
- Documentation is available on Read the Docs.
- For guidelines on contributing check the Contributor guidelines.
from fake import FAKER
from fakepy.pathy_storage.cloud import PathyFileSystemStorage
STORAGE = PathyFileSystemStorage(
bucket_name="bucket_name",
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
from fake import FAKER
from fakepy.pathy_storage.aws_s3 import AWSS3Storage
STORAGE = AWSS3Storage(
bucket_name="bucket_name",
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
# Credentials are optional too. If your AWS credentials are properly
# set in the ~/.aws/credentials, you don't need to send them
# explicitly.
credentials={
"key_id": "YOUR KEY ID",
"key_secret": "YOUR KEY SECRET"
},
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
from fake import FAKER
from fakepy.pathy_storage.google_cloud_storage import GoogleCloudStorage
STORAGE = GoogleCloudStorage(
bucket_name="bucket_name",
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
from fake import FAKER
from fakepy.pathy_storage.azure_cloud_storage import AzureCloudStorage
STORAGE = AzureCloudStorage(
bucket_name="bucket_name",
root_path="tmp", # Optional
rel_path="sub-tmp", # Optional
)
pdf_file = FAKER.pdf_file(storage=STORAGE)
STORAGE.exists(pdf_file)
pytest
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
**************************
MIT
For security issues contact me at the e-mail given in the Author section.
For overall issues, go to GitHub.
Artur Barseghyan <[email protected]>