Skip to main content

Copy traversables as directories.

Project description

copytrav

Copying Python Traversals

Modern Python packaging has support for data files to be included with the package alongside source files. There are many times when you might want to have copies of these files on disk, often when being used with external or third-party programs, and this is the role copytrav fills. You may, of course, use importlib.resources.as_file(traversable), but there are still other times when a context manager isn't good enough.

Users

Installation

pip install copytrav

Usage

Copying a Directory

from copytrav import copy

copy("mymodule.data", "path/to_directory", "output_path")

Copying a File

from copytrav import copy

copy("mymodule.data", "path/to_file", "output_path")

Copy the Whole Module

from copytrav import copy

copy("mymodule.data", dst="output_path")

Copy the Whole Module into a TempDir

from copytrav import copy

tempdir = copy("mymodule.data")

Building the Documentation

clone the repository

pip install -e .[dev]

cd docs && make html

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

copytrav-0.0.5.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

copytrav-0.0.5-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file copytrav-0.0.5.tar.gz.

File metadata

  • Download URL: copytrav-0.0.5.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for copytrav-0.0.5.tar.gz
Algorithm Hash digest
SHA256 211b905132fe338ce1cb33c9866c7904f0a20f7eb71421f9e3a7f95dc3a35516
MD5 1d1c81f2dd4ee35f207e5f5654033a2b
BLAKE2b-256 8f7f8b86fe55c8945df2792835980ddc1ca169a5b5c8d9c790846df0f30dc403

See more details on using hashes here.

File details

Details for the file copytrav-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: copytrav-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for copytrav-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a866221d47aed7d0f6cff3664379ca1018952e57508beb4fe537749bd3505234
MD5 7894e73e75f85aba471d3d9575535be1
BLAKE2b-256 b4b58b2266bd923b835c88cc747bf7d60c4e3203ff2d0d1410094e8a2c91d642

See more details on using hashes here.

Supported by

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