Giter Site home page Giter Site logo

cookiecutter-standalone's Introduction

cookiecutter-standalone

Cookiecutter template designed for self-contained command-line tools.

Requires Cookiecutter 1.1 or later.

Usage

Install Cookiecutter, then run:

cookiecutter https://github.com/benwebber/cookiecutter-standalone.git

Features

Flexible entry points

Cover all the bases with setuptools and runpy:

  • Install and run from your setuptools install path:

    $ pip install tool
    $ tool
    
  • Install and run as a module:

    $ python -m tool
    
  • Run from the source directory:

    $ python tool/
    
  • Run from a self-contained zip archive:

    $ ./tool
    

Flexible packaging

Supports:

  • source distribution
  • wheel
  • self-contained executable archive
  • RPM containing isolated virtual environment

Asset management

Optionally bundle assets with your application.

If enabled, the cookiecutter will create an assets package and assets.asset() context manager. Install your assets to the sub-package:

example
├── __init__.py
├── __main__.py
├── assets
│   ├── __init__.py
│   └── example.txt
└── cli.py

Then access them like so:

from .assets import asset

with asset('example.txt') as f:
    print(f.read())

Thanks to the magic of pkg_resources, this even works inside standalone archives.

Note that this technique adds setuptools as an install dependency. You probably want to pin setuptools to a specific version.

License

MIT

cookiecutter-standalone's People

Contributors

benwebber avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.