Skip to main content

argparse2typer

Use case

  • Do you ever need to work on an open source project and find that they use argparse? Nothing's wrong with argparse but you have already been falling in love with typer CLI (you all will someday)?
  • Fear no more, just use argparse2typer and all the argparse code would be parsed into typer CLI with as little changes as possible.

Installation

  • With pip:
pip install argparse2typer

Usage

  1. Locate the line args = parser.parse_args() in the original script
  2. Import the function from argparse2typer import argparse2typer
  3. Run the function before parse_args:
argparse2typer(parser=parser, output_path=Path(<path>)) # <- new line
args = parser.parse_args()
  1. New file @

Metadata

Release files for argparse2typer 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argparse2typer 0.0.2
File Size Uploaded
argparse2typer-0.0.2.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for argparse2typer 0.0.2
File Interpreter ABI Platform
argparse2typer-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 32.8 kB

Release files / argparse2typer-0.0.2.tar.gz

Download URL argparse2typer-0.0.2.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
42b25ee2b833037b4ce549cff48491f24f5e92eb04af00aef3505b790b8db6d1
BLAKE2b-256 checksum
How to use checksums
84e6e5859cb5d8a422191161c3650f6877be58909f0eb33b2568d24b604d3c46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / argparse2typer-0.0.2-py3-none-any.whl

Download URL argparse2typer-0.0.2-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee1d760ef3979560109347f43e81e3c15cb592f36c3c0446a329a846e36f58bb
BLAKE2b-256 checksum
How to use checksums
dbb6e7e7844884c0d4b0952fc6f9d32ea68337f7b6d92dab1668611ec10260d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page