-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from barseghyanartur/dev
dev -> main
- Loading branch information
Showing
10 changed files
with
92 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from faker import Faker | ||
from faker_file.providers.augment_file_from_dir import ( | ||
AugmentFileFromDirProvider, | ||
) | ||
from faker_file.providers.augment_file_from_dir.augmenters import ( | ||
textaugment_augmenter, | ||
) | ||
from faker_file.providers.docx_file import DocxFileProvider | ||
from faker_file.providers.eml_file import EmlFileProvider | ||
from faker_file.providers.odt_file import OdtFileProvider | ||
from faker_file.providers.txt_file import TxtFileProvider | ||
|
||
FAKER = Faker() | ||
FAKER.add_provider(DocxFileProvider) | ||
FAKER.add_provider(TxtFileProvider) | ||
FAKER.add_provider(EmlFileProvider) | ||
FAKER.add_provider(OdtFileProvider) | ||
FAKER.add_provider(AugmentFileFromDirProvider) | ||
|
||
# Create files to test `augment_file_from_dir` with | ||
FAKER.docx_file() | ||
FAKER.eml_file() | ||
FAKER.odt_file() | ||
FAKER.txt_file() | ||
|
||
# We assume that directory "/tmp/tmp/" exists and contains | ||
# files of `DOCX`, `EML`, `EPUB`, `ODT`, `PDF`, `RTF` or `TXT` | ||
# formats. Valid values for `action` are: "random_deletion", | ||
# "random_insertion", "random_swap" and "synonym_replacement" (default). | ||
augmented_file = FAKER.augment_file_from_dir( | ||
source_dir_path="/tmp/tmp/", | ||
text_augmenter_cls=textaugment_augmenter.EDATextaugmentAugmenter, | ||
text_augmenter_kwargs={ | ||
"action": "synonym_replacement", | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
__title__ = "faker_file" | ||
__version__ = "0.17.10" | ||
__version__ = "0.17.11" | ||
__author__ = "Artur Barseghyan <[email protected]>" | ||
__copyright__ = "2022-2023 Artur Barseghyan" | ||
__license__ = "MIT" |