Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Smart Copy Utility

Project Description

This is an useful utility for automating copy from source and destination that can be customised by arguments that may vary. A good example of usage is available with this repo.


You can install it from source by cloning this repo

git clone

and running

sudo python install

You can also install the latest released version through pip

sudo pip install smartcp

or easy_install

sudo easy_install smartcp


It is officially only compatible with Python 3 and Python 2 but has some issues with accents for Python 2 (Python 3 has a better unicode approach than Python 2).

You will also need PyYAML.


You can get help by running

smartcp -h

Config file

To specify which files to copy where, you need to specify a config file. It should use the YAML syntax. It contains a base path for the source, a base path for the destination and clients. For each client, you can specify some arguments (if no argument is given, there will be one copy but there can’t be any node arg) and how to generate the source and destination from these arguments. To specify them you need to nest three types of nodes.

  • A path_format which can contain placeholders {n} and then parameters to replace them. The parameters can be one of the three nodes.
  • A mapping which contain a hash and a key which is a node.
  • An arg which is one of the arguments.

Here is an example which copies files from version/subversion/file to file-version.subversion while renaming file to b if it is a. It also copies 1/1/x to ../x-1.1.

input_base: .
output_base: .
  - name: Official
      subversion: [1, 2, 3]
      version: [1, 2, 3, 4, 5]
      file: [a, A, x, X]
      path_format: "{0}/{1}/{2}"
        - arg: subversion
        - arg: version
        - arg: file
      path_format: "{0}-{1}.{2}"
        - mapping:
            a: b
            arg: file
        - arg: version
        - arg: subversion
  - name: Simple copy
      path_format: 1/1/x
      path_format: ../x-1.1

Note the " for the path format because without it YAML won’t understand that it is just a string.

Release History

This version
History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(8.9 kB) Copy SHA256 Hash SHA256
Dumb Binary any Feb 5, 2015
(10.5 kB) Copy SHA256 Hash SHA256
Egg 2.7 Feb 5, 2015
(10.6 kB) Copy SHA256 Hash SHA256
Egg 3.4 Feb 5, 2015
(6.0 kB) Copy SHA256 Hash SHA256
Source None Feb 5, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers