This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Enable git-like did-you-mean feature in click.

It’s as simple as this:

import click
from click_didyoumean import DYMGroup

@click.group(cls=DYMGroup)
def cli():
    ...

Usage

Install this extension with pip:

pip install click-didyoumean

Use specific did-you-mean group class for your cli:

import click
from click_didyoumean import DYMGroup

@click.group(cls=DYMGroup)
def cli():
    pass

@cli.command()
def foo():
    pass

@cli.command()
def bar():
    pass

@cli.command()
def barrr():
    pass

if __name__ == "__main__":
    cli()

Or you it in a CommandCollection:

import click
from click_didyoumean import DYMCommandCollection

@click.group()
def cli1():
    pass

@cli1.command()
def foo():
    pass

@cli1.command()
def bar():
    pass

@click.group()
def cli2():
    pass

@cli2.command()
def barrr():
    pass

cli = DYMCommandCollection(sources=[cli1, cli2])

if __name__ == "__main__":
    cli()

Change configuration

There are two configuration for the DYMGroup and DYMCommandCollection:

Parameter Type Default Description
max_suggestions int 3 Maximal number of did-you-mean suggestions
cutoff float 0.5 Possibilities that don’t score at least that similar to word are ignored.

Examples

@cli.group(cls=DYMGroup, max_suggestions=2, cutoff=0.7)
def cli():
    pass

... or ...

cli = DYMCommandCollection(sources=[cli1, cli2], max_suggestions=2, cutoff=0.7)
Release History

Release History

0.0.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
click-didyoumean-0.0.3.tar.gz (2.6 kB) Copy SHA256 Checksum SHA256 Source Mar 13, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting