A utility for generating test files in various formats
Project description
FileMint
A Python utility for generating test files in various formats. FileMint makes it easy to create test datasets for development, testing, and demonstrations.
Features
- Generate structured CSV files with consistent columns
- Generate unstructured text files with random content
- Generate binary files of specified sizes
- Generate intentionally malformed CSV files for testing error handling
- Command-line interface for easy file generation
Installation
pip install filemint
Usage
Command Line
Generate test files using the command-line interface:
# Generate default set of test files (10 of each type)
filemint
# Specify output directory
filemint --output-dir my_test_files
# Specify number of each file type
filemint --csv 5 --txt 10 --bin 3 --invalid 2
Python API
from filemint.generators import generate_test_files
# Generate test files with default settings
files = generate_test_files(output_dir="test_files")
# Customize the number of each file type
files = generate_test_files(
output_dir="test_files",
num_csv=5,
num_txt=10,
num_binary=3,
num_invalid=2
)
# Generate individual files
from filemint.generators import generate_csv, generate_txt, generate_binary, generate_invalid_csv
# Generate a CSV file with 20 rows
csv_file = generate_csv("output_dir", "data.csv", num_rows=20)
# Generate a text file with 50 lines
text_file = generate_txt("output_dir", "notes.txt", num_lines=50)
# Generate a 1MB binary file
binary_file = generate_binary("output_dir", "data.bin", size_in_kb=1024)
# Generate an invalid CSV file with 15 rows
invalid_file = generate_invalid_csv("output_dir", "bad_data.csv", num_rows=15)
Development
Setup
- Clone the repository
- Create and activate a virtual environment
- Install development dependencies
git clone https://github.com/yourusername/filemint.git
cd filemint
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
Testing
Run tests using pytest:
pytest
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file filemint-0.1.0.tar.gz.
File metadata
- Download URL: filemint-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
242fcedc24870ffdb751ee4c25705e87cdf8e894de9a167034e87f25946db1fc
|
|
| MD5 |
fd5e573b0f7abe900010a9bba368aae5
|
|
| BLAKE2b-256 |
49f4b79e492fe5460395eb1795400ead2afcac3cbcdaa8dc381f0552eaa52995
|
File details
Details for the file filemint-0.1.0-py3-none-any.whl.
File metadata
- Download URL: filemint-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bb8f2c1fde6bc8754f94ea9b0f09ac483cdda9fa5414a7b362beb496d50d2e4
|
|
| MD5 |
92accc99216d4008e03c4f3cba774912
|
|
| BLAKE2b-256 |
71bee675f2491ed7c7fb2bb699d831962a1f89170bc4f3066d4641b1a4930ba5
|