Skip to main content

A simple extension for argparse to allow readable/writeable dir types

Project description

This is a very simple action for argparse that allows you to specify a readable or a writeable directory as an argparse action. I found it on StackOverflow years ago and used it since then, unfortunately I cannot find the original source now.

I guess it would be best to have this added directly into argparse anyway.

Usage

Just import and use as an action:

import argparse
import argparsedirs

argparser = argparse.ArgumentParser()

argparser.add_argument('indir', type=argparsedirs.ReadableDirType)
argparser.add_argument('outdir', type=argparsedirs.WriteableDirType)

args = argparser.parse_args()

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

argparsedirs-0.2.1.tar.gz (1.5 kB view details)

Uploaded Source

Built Distribution

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

argparsedirs-0.2.1-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file argparsedirs-0.2.1.tar.gz.

File metadata

  • Download URL: argparsedirs-0.2.1.tar.gz
  • Upload date:
  • Size: 1.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.2 Linux/6.1.0-41-amd64

File hashes

Hashes for argparsedirs-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3db491a9a6735c25cb46aab161551b1f910a1747e2768b469a92189ed65a5ea9
MD5 1f5232987ad8c1981836a60b7ea62061
BLAKE2b-256 6a1c1d37d36110e15a2fbc2d5b67d943d94aa6507c2a608cc990ec620eaff2a3

See more details on using hashes here.

File details

Details for the file argparsedirs-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: argparsedirs-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.2 Linux/6.1.0-41-amd64

File hashes

Hashes for argparsedirs-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9a243110a8af10e297deb5a3602d8860909563ab240de0753f4a1275965163c
MD5 86e9e523a351a4e40e0522580f511abf
BLAKE2b-256 c35cf13a1c0e338143824bc24964dfccf0622047ef21e20cb35e1a0fdd620155

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