def copy_skeleton(
        name, src, dest, renames=None, description=None, ignore=False,
        exclude_dirs=None, exclude_files=None):
    """Copy skeleton"""
    fmt = DevFormatter(name, dest, description=description)
    if os.path.exists(dest):
        if ignore is False:
            print("project already exists.")
            return 1
    else:
        os.makedirs(dest)
    renames = renames or []
    exclude_dirs = exclude_dirs or []
    exclude_files = exclude_files or []
    for root, dirs, files in os.walk(src, topdown=True):
        dirs[:] = [d for d in dirs if d not in exclude_dirs]
        files[:] = [
            f for f in files if f not in exclude_files
            and not f.endswith('pyo') and not f.endswith('pyc')]
        for dname in [join(dest, d) for d in dirs if d]:
            for rsrc, rdest in renames:
                dname = dname.replace(rsrc, rdest)
            try:
                os.makedirs(dname)
            except Exception:
                pass
        for fname in files:
            sfile = join(root, fname)
            dfile = join(dest, relpath(sfile, src))
            for rsrc, rdest in renames:
                dfile = dfile.replace(rsrc, rdest)
            if os.path.exists(dfile):
                continue
            name = basename(splitext(dfile)[0])
            wholetitle = "{} :core:`{}.{}`".format(
                name.title(), basename(dirname(dfile)), name)
            wholetitlemark = "=" * len(wholetitle)
            fmt.info.update(dict(
                title=name.title(),
                titlemark="=" * len(name.title()),
                wholetitle=wholetitle,
                wholetitlemark=wholetitlemark,
                parentname=basename(dirname(dfile)),
            ))
            script = open(sfile, 'r').read()
            try:
                code = fmt.format(script, **fmt.info)
                open(dfile, 'w').write(code)
            except ValueError:
                pass
Copy skeleton