npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-python-cmd

v0.1.0

Published

Generator for a Python app with a command-line interface using cmd

Downloads

1

Readme

Python cmd App Generator

NPM version Build Status Test Coverage Dependency Status Dev Dependency Status

Yeoman generator for a Python app with a command-line interface using cmd

Installation

  1. Install Node.js.
  2. Run npm install -g yo to install Yeoman using npm.
  3. Run npm install -g generator-python-cmd to install generator-python-cmd.

Usage

This readme covers the generator. See the README.md in your generated project for information on using the project's code.

Generating a Project

  1. Create a new directory for your project, and enter it.
  2. From the new project directory, run yo python-cmd to generate your new project.
  3. Answer the questions at the prompts to customize your project.
  4. Run pip install -r requirements-dev.txt to install the project's initial development tools, such as Sphinx (see the next section).

Setting up Documentation

Your new project will be set up to use the automatic documentation generator Sphinx. If you stick with this option, you'll do the initial setup with Sphinx's own script.

  1. If you haven't already, install Sphinx using the pip command from the previous section.
  2. Follow the Sphinx tutorial, except for the installation.
  3. If you run the sphinx-quickstart script from your project's root directory, set the "Root path for the documentation" to docs.
  4. I recommend saying y to at least the following extensions (these and other extensions described here):
    • autodoc - Lets you avoid maintaining duplicate documentation between your code and the Sphinx documents. Also lets you format your docstrings nicely.
    • doctest - Tests all the code examples in your documentation, if you put them in doctest blocks.
    • coverage - Checks whether your documentation covers your project's whole public API.
    • viewcode - Links the documentation of each object to a highlighted version of the object's source code so users can easily examine its implementation.

Features

The generator creates

  • an app.py script for running your application
  • an in-app command-line prompt using the cmd library
  • a setup.py script for optionally installing your application's package as a library
  • a directory (renamed to your package name) to contain your application's package files
  • a config directory to house the app's configuration files
  • a tests directory for unit tests using nose2
  • a docs directory to contain your documentation, ready to be set up by Sphinx
  • a readme file to hold basic information on installing, using, and contributing to the project
  • an MIT license file
  • a Git ignore file

The generator puts all of that into the following folder structure:

.
|____config
|____docs
|____<package>
| |______init__.py
| |____cli.py
| |____config.py
| |____controller.py
|____tests
| |____context.py
| |____test.py
|____app.py
|____.gitignore
|____LICENSE.md
|____README.md
|____setup.py

Generators

Available generators:

App

Sets up a new Python cmd app, generating all the boilerplate you need to get started.

yo python-cmd

Options

There are currently no command-line options for the generator.

The prompts ask for the following information:

projectName

Default: [Name of project folder in title case and with non-word characters replaced by spaces]

The project name. Used in the documentation files and setup.py.

packageName

Default: [Name of project folder with non-word characters removed]

The package name. Used in app.py, test files, and setup.py.

projectDesc

Default: UNDEFINED

The project description. Used in the documentation files and setup.py.

author

Default: UNDEFINED

The author's name. Used in the documentation files and setup.py.

authorEmail

Default: UNDEFINED

The author's email address. Used in the documentation files and setup.py.

Roadmap

To the generator:

  • Add configuration saving.
  • Add command-line options.
  • Add EditorConfig configuration for synchronizing coding style.

To the app templates:

  • Enable app commands from the command line.
  • Add user configuration.
  • Add EditorConfig configuration for synchronizing coding style.
  • Add pylama configuration for code linting.
  • Switch to pytest for testing.
  • Add Wheel configuration for packaging.
  • Add conda configuration for package and environment management.
  • Add pyup configuration for dependency management.
  • Add Codecov configuration for code coverage reporting.
  • Add Tox configuration for managing test environments.
  • Add Travis CI configuration for automatic testing and deployment.

Contributing

See contributing.md to learn how to contribute to this project. Contributions include bug reports, feature requests, code, and documentation.

Changelog

See the Releases page for this project on GitHub.

Author

License

MIT © Andy Culbertson

For details see the LICENSE file.