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 MIT 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.1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

emptycopy-0.1.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: emptycopy-0.1.1.tar.gz
  • Upload date:
  • Size: 14.9 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.1.tar.gz
Algorithm Hash digest
SHA256 6a1b7c04632fb2bdc717b5e5ca389ca868ccff5b2915809860385658f9cb33ba
MD5 2af0476798b8ce4e73e7c7b2d1f1f278
BLAKE2b-256 c2150bc1f15e6904c7c16cfa5ea741e05845e0b48c50df28d7758cc2e69f065a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: emptycopy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8afe513aab6957ed88478e3939f7053a02c5858faad9cc4a295d40a1b11671ea
MD5 2477ff1ce5be12ded7c7b410906e93b4
BLAKE2b-256 5610a456c83b7e6a59c091ca7ed33de68142b7dc4948468740ab87a88e1eed4b

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