Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
48 views

I have a tool that uses Click to define its CLI interface. It uses groups to achieve a subcommand hierarchy. So, if it is mytool, we have commands like mytool edit, mytool show, mytool execute script1....
Noob Doob's user avatar
  • 1,967
0 votes
0 answers
90 views

i am currently trying to get a compiled python project which is using click 8.0.4 running with shell_completion. My project contains multiple downstream scripts, which should support the ...
bigMre's user avatar
  • 39
0 votes
0 answers
79 views

I have the following ~minimal code: from typing import Annotated import typer def main( username: Annotated[ str, typer.Option("--username", "-u", help="...
Dror's user avatar
  • 13.2k
1 vote
1 answer
68 views

I have a script which use click.group to provide sub commands. Each of the sub command might pass or fail. How do I propagate the exit code from the sub commands back to main? import click import sys ...
Hai Vu's user avatar
  • 41.4k
1 vote
1 answer
117 views

When click.secho("helo", fg="yellow") writes to a pipe, the colors are stripped by default. If there a way to force click to emit the color codes even when stdout is a pipe? ...
zapta's user avatar
  • 125
0 votes
2 answers
178 views

I am using python click options that are shared by multiple commands, as described at https://stackoverflow.com/a/77732441. Is there a simple way to customize the help= text of the list option in the ...
zapta's user avatar
  • 125
1 vote
1 answer
146 views

In Click, Context.with_resource's documentation states it can be used to: [r]egister a resource as if it were used in a with statement. The resource will be cleaned up when the context is popped. ...
Adam's user avatar
  • 506
2 votes
1 answer
382 views

I want Typer to display my commands in the order I have initialized them and it displays those commands in alphabetic order. I have tried different approaches including this one: https://github.com/...
Swantewit's user avatar
  • 1,086
0 votes
1 answer
322 views

I am using click for the very first time to create a cli program using Python 3.12.2. I created a simple click command that takes an option (the '-f' / '--file' option) as a filepath with type click....
user23706137's user avatar
1 vote
0 answers
90 views

Intro It is a strange thing that in pallets click module options can parse a command option in the '--option=value' format, where value is a string, and that is equivalent to '--option value' where ...
croakouttatune's user avatar
1 vote
2 answers
498 views

I am working on a project. Below are the files from which the problem resides. cli.py import click from apscheduler.schedulers.background import BackgroundScheduler scheduler = BackgroundScheduler(...
Ratnapal Shende's user avatar
-1 votes
1 answer
456 views

I have a simple python script that I want to run inside of a docker container. It prints a one-line message "Hello {name}". The python script uses the click CLI interface to define the ...
Razzle's user avatar
  • 21
1 vote
0 answers
105 views

I'd like to create a CLI for my application that's flexible and extensible. Click seems like the right solution but I'm new to it and have not seen an example that fits what I'm looking for. The ...
Youssef Bagoulla's user avatar
0 votes
0 answers
269 views

I have a cli tool written in Python using Click: cli/main.py import click from datetime import * from .utils import fn @click.group(invoke_without_command=True, context_settings = { '...
Richard Payne's user avatar
3 votes
1 answer
299 views

I am trying to create a wrapper decorator for the click decorator @click.options('--foo', required=True): import click def foo_option(func): orig_decorator = click.option('--foo', required=True)(...
Håkon Hægland's user avatar
0 votes
0 answers
200 views

I have a piece of code which I wish to always run at the end of a command execution, regardless of whether the command succeeded or raised an exception. I thought callbacks may be used for this, but ...
J.D. Palomino's user avatar
0 votes
0 answers
65 views

@cli.command() @click.option("--list", 'list_steps', default=False, is_flag=True) @click.argument("elem") @click.pass_obj def step(cmd, elem, list_steps): print(elem) print(...
ealeon's user avatar
  • 12.5k
1 vote
1 answer
444 views

I'm using click to build a CLI tool. I need my code to open a file in a specified directory (this is what is passed as a command line argument) and parse the json inside that file. What is the best ...
wlog's user avatar
  • 25
1 vote
0 answers
33 views

I have a Python module that uses the Click library for command-line interfaces. Assume the module defines a foo function that takes a file path as an argument and calls the bar function with the ...
thatch's user avatar
  • 11
3 votes
1 answer
2k views

I sometimes have the issue that the click package fails to return a Path when using the click.Path argument, and instead I get a bytes object. Here is a typical code sample which will sometimes cause ...
Yohann Pitrey's user avatar
0 votes
1 answer
104 views

I am using click library in order to call function from one folder and read file and after that to write file. import sys import numpy as np import pandas as pd import click def count_unique_port(df:...
kalin.klinkov's user avatar
0 votes
1 answer
198 views

I'm using Python and Click to create a simple command line app that takes in a number and adds it to a default number. This is what I have so far: import click from tqdm import tqdm init = 5 for i in ...
celerygemini's user avatar
1 vote
1 answer
211 views

I would like to integrate a python CLI written using click into a python CLI application built using another framework. Rewriting the calling application is not an option. As part of the integration, ...
alfalfasprout's user avatar
1 vote
1 answer
722 views

I have a click application which is running just fine currently. We want to introduce a new command called api which will dynamically reach into our python sdk and extract sdk methods that can be ...
thomas's user avatar
  • 2,642
1 vote
0 answers
846 views

I have a script trainmodel.py coming from an existing codebase (based on Hugginface ArgumentParsers) with almost 100 different arguments that is based on argparse. The script comes as a main() ...
linello's user avatar
  • 8,721

1
2 3 4 5
12