Skip to main content

A CLI-tool for creating a complete copy of a directory and all it's subdirectories but with all files empty.

Project description

Emptycopy logo

Emptycopy

Emptycopy is a Python CLI-tool that copies the contents of a folder and it's subfolder but leaves the files empty. It's useful for generating folder hierarchies for code tests or for examining how a command will affect a folder without actually changing the files.

For example, the following folder structure:

$ tree -h my_folder/
[4.0K]  my_folder/
├── [ 21K]  file1.txt
├── [ 59K]  file2.jpg
└── [4.0K]  subfolder
    └── [510K]  file3.mp4

1 directory, 3 files

Becomes

$ tree -h empty_my_folder/
[4.0K]  empty_my_folder/
├── [   0]  file1.txt
├── [   0]  file2.jpg
└── [4.0K]  subfolder
    └── [   0]  file3.mp4

1 directory, 3 files

Installation

pipx (Recommended)

Emptycopy can be installed using pipx, which is a tool to install Python CLI tools in isolated environments. This is the recommended way to install Emptycopy as it will not interfere with other Python packages on your system.

pipx install emptycopy

pip

Emptycopy can also be installed using pip, which is the Python package installer. This is not recommended as it will install Emptycopy globally on your system and may interfere with other Python packages.

pip install emptycopy

Usage

Once installed, Emptycopy can be run from the command line. The basic usage is as follows:

emptycopy <source> <destination>

Where <source> is the path to the folder you want to copy and <destination> is the path to the new folder where the contents will be copied. If you omit the <destination> argument, Emptycopy will create a new folder with the same name and path as the source folder with an empty_ prefix.

Depth limit

You can limit the depth of the folder hierarchy that Emptycopy will copy by using the --depth or -d flag. For example, to copy only the top-level files and folders, you can run:

emptycopy --depth 1 <source> <destination>

Developers

If you want to contribute to Emptycopy, you can clone the repository and install the development dependencies using poetry. Remember to use the --with=dev flag to install the development dependencies.

git clone
cd emptycopy
poetry install --with=dev   # Installs dev dependencies.
poetry run emptycopy --help # Run the tool!

License

Emptycopy is licensed under the GPL-3.0-or-later License. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emptycopy-0.1.3.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

emptycopy-0.1.3-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file emptycopy-0.1.3.tar.gz.

File metadata

  • Download URL: emptycopy-0.1.3.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for emptycopy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 aba34002e0709364af907e1b0ae07e73c0f90cae1f668bde3bccaeb74a12aa25
MD5 8c825e26e7141a50f82e8d3d2fb5fb8a
BLAKE2b-256 046adec465bc669c385084b741d4fb56a4ddb31cdd2179e28871e555f32fd347

See more details on using hashes here.

File details

Details for the file emptycopy-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: emptycopy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for emptycopy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61e5ae6adb0fbdb753db0f4b2517bcceca6b8d4326e39dbfa8434dda1c5f2507
MD5 5e4e5a186ad3d1cc4f00bb948f0db961
BLAKE2b-256 ad09ba699614cc86194cfeb0ee13f30280e6554d26f1c1e7927d5efb84e50d08

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page