cibopath

Search Cookiecutters on GitHub.


Keywords
cookiecutter, web, scraping, asyncio, command-line
License
BSD-3-Clause
Install
pip install cibopath==0.1.0

Documentation

Cibopath

PyPI Package PyPI Python Versions PyPI Package License See Build Status on Travis CI

Search Cookiecutter templates on GitHub with Python 3.5.

A Cibopath can take a bite from anything and get a psychic sensation of what has happened to that object. The only thing it does not work on is beets.

—Wikipedia: Chew Comic Book Series

Usage

Usage: cibopath [OPTIONS] COMMAND [ARGS]...

  Cibopath - Search Cookiecutters on GitHub.

Options:
  -v, --verbose           Print debug information
  -c, --config-file PATH  Config file to hold settings
  -V, --version           Show the version and exit.
  --help                  Show this message and exit.

Commands:
  config
  info
  search
  update

User Config

First you need to create a GitHub access token for Cibopath, so it can authenticate with the GitHub API v3. GitHub's rate limiting won't allow more than 60 unauthenticated requests per hour. So yeah, you definitely want to have a token set up as there are more than 60 featured Cookiecutter templates.

The Cibopath access token does NOT require any scopes. Please stick to the defaults when creating the token (Read-only access to public repositories).

Now use the CLI to store your credentials in your home directory (default ~/.cibopathrc).

$ cibopath config github.username <your-username>
$ cibopath config github.token <your-access-token>

Feel free to view the contents of the config file via:

$ cibopath -v config --list

Fetch Template Information

With GitHub authentication in place, you now want to fetch information about available Cookiecutter templates. Cibopath dumps the data as a JSON file to disk. You can specify the target location either via user config or CLI.

Save the dump-file location to settings:

$ cibopath config templates.file ~/.cibopath/templates.json
$ cibopath -v update

Or specify it on the CLI:

$ cibopath -v update --dump-file ~/.cibopath/templates.json

Please note that, albeit not required, the -v or --verbose flags are very useful if you want to see what Cibopath is doing under the hood.

Search Keywords in Templates

Once you've gathered information about Cookiecutter templates, you can use Cibopath to search for keywords in the templates' README files.

Let's say you would like to know which ones support django and docker.

$ cibopath search django docker

If you didn't save the templates.file earlier, you need to explicitly pass it to the CLI:

$ cibopath search django docker --load-file ~/.cibopath/templates.json

Cibopath will show you a list of matching templates in alphabetical order along with their corresponding GitHub repository URL. If you feel like one of these templates meets your requirements for a new project, go ahead and pass the URL to Cookiecutter to get started.

cookiecutter-django................. https://github.com/pydanny/cookiecutter-django
django-docker-bootstrap............. https://github.com/legios89/django-docker-bootstrap

Display Template Information

Cibopath also provides you with additional information about a given template:

$ cibopath info cookiecutter-pytest-plugin

Info includes Name, Author, Repository as well as the Context, which will be used by Cookiecutter to generate the project.

Name: cookiecutter-pytest-plugin
Author: pytest-dev
Repository: https://github.com/pytest-dev/cookiecutter-pytest-plugin
Context: {
    "docs_tool": [
        "mkdocs",
        "sphinx",
        "none"
    ],
    "email": "raphael@hackebrot.de",
    "full_name": "Raphael Pierzina",
    "github_username": "hackebrot",
    "license": [
        "MIT",
        "BSD-3",
        "GNU GPL v3.0",
        "Apache Software License 2.0"
    ],
    "module_name": "{{ cookiecutter.plugin_name|lower|replace('-', '_') }}",
    "plugin_name": "foobar",
    "pytest_version": "2.8.1",
    "short_description": "A simple plugin to use with Pytest",
    "version": "0.1.0",
    "year": "2015"
}

License

Distributed under the terms of the BSD 3-Clause License, Cibopath is free and open source software

OSI certified

Code of Conduct

Everyone interacting in the Cibopath project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PyPA Code of Conduct.

John Layman Approves :)

https://raw.github.com/hackebrot/cibopath/master/cibopath_twitter.png