Pathy storage for fake.py
Project description
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.
Features
Cloud storages integration includes support for AWS S3, Google Cloud Storage and Azure Cloud Storage.
Prerequisites
Python 3.9+
Installation
pip install fake-py-pathy-storage
Documentation
Documentation is available on Read the Docs.
For guidelines on contributing check the Contributor guidelines.
Usage
Local cloud-alike file system storage
from fakepy 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)
AWS S3
from fakepy 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)
Google Cloud Storage
from fakepy 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)
Azure Cloud Storage
from fakepy 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)
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_pathy_storage-0.1.tar.gz
(26.4 kB
view hashes)
Built Distribution
Close
Hashes for fake_py_pathy_storage-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b365421a782cb70d4a6697c82a9c4543bb1bc1ee81c685bde84b8d0675a57836 |
|
MD5 | f68e08220312832bcceebeaa604f88fb |
|
BLAKE2b-256 | db4b01915fd702f318dd77335b07e5c1d056c0a75f3cfaca0626546eec3aaa32 |
Close
Hashes for fake_py_pathy_storage-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc52f32be80195458d897ff0302328bab3bc54f0df15bf3f58983f7c452fe577 |
|
MD5 | e6a1a0cb06efb036fdbaadd23556d292 |
|
BLAKE2b-256 | 739d3141b126933885b34146b90e96cdd675bcc6b5098a72fdd1c0781034c399 |