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.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

copytrav-0.0.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: copytrav-0.0.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for copytrav-0.0.3.tar.gz
Algorithm Hash digest
SHA256 15386f3bc1be5e2b5feb7f0a5e1569d402d6059a470bc3481fbdde18c3bba17e
MD5 038182b2532c07587ad0c4d3e34e2a55
BLAKE2b-256 36adfc7edd68bdbae5f65f985d8b4ee6f64a5b081e19b4114259dfb6b476410d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: copytrav-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for copytrav-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e1e93cf98b0029158434552d8a9cb68372d3248116c681ea0de1762def164a5e
MD5 c4d1876c55da0083350140d0f78618f1
BLAKE2b-256 429a823c4bd482b64a2857a3123e1c8aa6edd0a4dec15a62340c13e7c76e5bfe

See more details on using hashes here.

Supported by

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