Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
The generate-dummyf Python package is a versatile tool for generating dummy files in different formats such as JSON, Excel, DOCX, TXT, and CSV. This package simplifies the process of creating sample data files for testing, development, and other purposes.
Generate dummy data files in Json, Xlsx, Docx, Txt, and Csv formats. Easily specify the file size, the structure (columns and their data type) of files, path for saving your output file. Generate a file with random data for a wide range of use cases.
NOTE: file_size is a mandatory argument for each generate_* function whose value should be in bytes and the size of the output file may not be exactly equal to the user's file_size input
You can install the package using pip:
pip install generate-dummyf
Here's a quick guide on how to use the generate-dummyf package to generate dummy files:
from generate_dummyf import *
json_data = generate_json(file_size=50000)
json_data = generate_json(file_size=50000, column_description={"Contact" : "int", "Name" : "str", "Status": "boolean", "Created_Time": "datetime", "Amount": "float"})
json_data = generate_json(file_size=50000, save_file_path="/home/user-pc/Documents/")
excel_data = generate_excel(file_size=50000)
excel_data = generate_excel(file_size=50000, column_description={"Contact" : "int", "Name" : "str", "Status": "boolean", "Created_Time": "datetime", "Amount": "float"})
excel_data = generate_excel(file_size=50000, save_file_path="/home/user-pc/Documents/")
csv_data = generate_csv(file_size=5000)
csv_data = generate_csv(file_size=5000, column_description={"Contact" : "int", "Name" : "str", "Status": "boolean", "Created_Time": "datetime", "Amount": "float"})
csv_data = generate_csv(file_size=50000, save_file_path="/home/user-pc/Documents/")
docx_data = generate_word(file_size=50000)
docx_data = generate_word(file_size=50000, font_size = 30, save_file_path="/home/user-pc/Documents/")
text_data = generate_txt(file_size=5000)
txt_data = generate_txt(file_size=50000, save_file_path="/home/user-pc/Documents/")
By default, the generated files will be saved in the downloads directory; however, you can manually specify the path using the save_file_path argument
python -m unittest tests/test_csv.py
python -m unittest tests/test_excel.py
python -m unittest tests/test_json.py
python -m unittest tests/test_txt.py
python -m unittest tests/test_word.py
Contributions to generate-dummyf are welcome! If you'd like to contribute to this project, please follow our contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions, issues, or feature requests, please feel free to open an issue.
FAQs
Generate different types (json, csv, excel, word, txt) of dummy files
We found that generate-dummyf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.