Write and edit random files in a given directory
Project description
Monkeywork
Description
Are you in need of a Monkey typing on their keyboard and saving files into a random directory? Look no further…
This program was designed to stress test a file synchronization solution by simulating a user who reads, writes, and edits files within a specific directory. You can specify a working directory where the program will conduct the following operations at a set interval:
- Create text and binary files with random content.
- Create random subdirectories.
- Open and edit files.
- Rename files and directories.
- Delete random files.
- Delete random subdirectories. All operations are being written into a log file.
The idea behind this program is to run it on both ends of a file sharing or syncing solution. By doing so, you can test whether your solution is capable of handling regular and potentially conflicting user activities.
!!! CAUTION !!!
The program can and will destroy files in the selected work directory. Be sure to select a dedicated work directory and review the code before executing it on your system!
Run in console
You can run the monkeywork.py
directly from from the console with:
python monkeywork.py "<Path to your workdir>" [OPTIONS]
example:
python monkeywork.py "L:\monkeywork-test\"
Options are:
-f | force selected direcotry and delete all contents in set directory
Installation
Use it as a package
pip install monkeywork
Usage
Example with custom interval setting:
from monkeywork import Monkey
mky = Monkey(workdir="F:/mky-test", interval_min_s=.1, interval_max_s=1)
mky.run()
orther avaiable setting:
variable | Description |
---|---|
workdir:str | must be set to a valid path |
interval_min_s:float | shortest interval |
interval_max_s:float | longest interval |
max_file_size_mb:int | maximum file size in MB |
max_file_amount:int | maximumg file count |
target_file_amount:int | program targets this amount of files |
path_length_limit:int | program should not exceed set path length |
logging_to_file_enabled:bool | enable loggin to file |
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
Hashes for monkeywork-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e09c3c6060d1ab07cf48742ba41917cc3766e9037cee6bb5d1b01786778698a7 |
|
MD5 | c9d42e786a7943d744790e4e26946a58 |
|
BLAKE2b-256 | d16fa2a5ea3996fa37fea80f629c449ff9c8498b20fc8b0ddda274f285c279aa |