Preview GitHub README.md files locally before committing them.

Overview

Grip -- GitHub Readme Instant Preview

Current version on PyPI Say Thanks!

Render local readme files before sending off to GitHub.

Grip is a command-line server application written in Python that uses the GitHub markdown API to render a local readme file. The styles and rendering come directly from GitHub, so you'll know exactly how it will appear. Changes you make to the Readme will be instantly reflected in the browser without requiring a page refresh.

Motivation

Sometimes you just want to see the exact readme result before committing and pushing to GitHub.

Especially when doing Readme-driven development.

Installation

To install grip, simply:

$ pip install grip

On OS X, you can also install with Homebrew:

$ brew install grip

Usage

To render the readme of a repository:

$ cd myrepo
$ grip
 * Running on http://localhost:6419/

Now open a browser and visit http://localhost:6419. Or run with -b and Grip will open a new browser tab for you.

You can also specify a port:

$ grip 80
 * Running on http://localhost:80/

Or an explicit file:

$ grip AUTHORS.md
 * Running on http://localhost:6419/

Alternatively, you could just run grip and visit localhost:6419/AUTHORS.md since grip supports relative URLs.

You can combine the previous examples. Or specify a hostname instead of a port. Or provide both.

$ grip AUTHORS.md 80
 * Running on http://localhost:80/
$ grip CHANGES.md 0.0.0.0
 * Running on http://0.0.0.0:6419/
$ grip . 0.0.0.0:80
 * Running on http://0.0.0.0:80/

You can even bypass the server and export to a single HTML file, with all the styles and assets inlined:

$ grip --export
Exporting to README.html

Control the output name with the second argument:

$ grip README.md --export index.html
Exporting to index.html

If you're exporting a bunch of files, you can prevent styles from being inlining to save space with --no-inline:

$ grip README.md --export --no-inline introduction.html
Exporting to introduction.html

Reading and writing from stdin and stdout is also supported, allowing you to use Grip with other programs:

$ cat README.md | grip -
 * Running on http://localhost:6419/
$ grip AUTHORS.md --export - | bcat
$ cat README.md | grip --export - | less

This allows you to quickly test how things look by entering Markdown directly in your terminal:

$ grip -
Hello **world**!
^D
 * Running on http://localhost:6419/

Note: ^D means Ctrl+D, which works on Linux and OS X. On Windows you'll have to use Ctrl+Z.

Rendering as user-content like comments and issues is also supported, with an optional repository context for linking to issues:

$ grip --user-content --context=joeyespo/grip
 * Running on http://localhost:6419/

For more details and additional options, see the help:

$ grip -h

Access

Grip strives to be as close to GitHub as possible. To accomplish this, grip uses GitHub's Markdown API so that changes to their rendering engine are reflected immediately without requiring you to upgrade grip. However, because of this you may hit the API's hourly rate limit. If this happens, grip offers a way to access the API using your credentials to unlock a much higher rate limit.

$ grip --user <your-username> --pass <your-password>

Or use a personal access token with an empty scope (note that a token is required if your GitHub account is set up with two-factor authentication):

$ grip --pass <token>

You can persist these options in your local configuration. For security purposes, it's highly recommended that you use an access token over a password. (You could also keep your password safe by configuring Grip to grab your password from a password manager.)

There's also a work-in-progress branch to provide offline rendering. Once this resembles GitHub more precisely, it'll be exposed in the CLI, and will ultimately be used as a seamless fallback engine for when the API can't be accessed.

Grip always accesses GitHub over HTTPS, so your README and credentials are protected.

Tips

Here's how others from the community are using Grip.

Want to share your own? Say hello @joeyespo or submit a pull request.

Create a local mirror of a Github Wiki

$ git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.wiki.git
$ cd YOUR_REPOSITORY.wiki
$ grip

By Joshua Gourneau.

Generate HTML documentation from a collection of linked README files

  1. Enter the directory:

    $ cd YOUR_DIR
    $ export GRIPURL=$(pwd)
  2. Include all assets by setting the CACHE_DIRECTORY config variable:

    $ echo "CACHE_DIRECTORY = '$(pwd)/assets'" >> ~/.grip/settings.py
  3. Export all your Markdown files with Grip and replace absolute asset paths with relative paths:

    $ for f in *.md; do grip --export $f --no-inline; done
    $ for f in *.html; do sed -i '' "s?$GRIPURL/??g" $f; done

You can optionally compress the set of HTML files to docs.tgz with:

$ tar -czvf docs.tgz `ls | grep [\.]html$` assets

Looking for a cross platform solution? Here's an equivalent Python script.

By Matthew R. Tanudjaja.

Configuration

To customize Grip, create ~/.grip/settings.py, then add one or more of the following variables:

  • HOST: The host to use when not provided as a CLI argument, localhost by default
  • PORT: The port to use when not provided as a CLI argument, 6419 by default
  • DEBUG: Whether to use Flask's debugger when an error happens, False by default
  • DEBUG_GRIP: Prints extended information when an error happens, False by default
  • API_URL: Base URL for the github API, for example that of a Github Enterprise instance. https://api.github.com by default
  • CACHE_DIRECTORY: The directory, relative to ~/.grip, to place cached assets (this gets run through the following filter: CACHE_DIRECTORY.format(version=__version__)), 'cache-{version}' by default
  • AUTOREFRESH: Whether to automatically refresh the Readme content when the file changes, True by default
  • QUIET: Do not print extended information, False by default
  • STYLE_URLS: Additional URLs that will be added to the rendered page, [] by default
  • USERNAME: The username to use when not provided as a CLI argument, None by default
  • PASSWORD: The password or personal access token to use when not provided as a CLI argument (Please don't save your passwords here. Instead, use an access token or drop in this code grab your password from a password manager), None by default

Note that this is a Python file. If you see 'X' is not defined errors, you may have overlooked some quotes. For example:

USERNAME = 'your-username'
PASSWORD = 'your-personal-access-token'

Environment variables

  • GRIPHOME: Specify an alternative settings.py location, ~/.grip by default
  • GRIPURL: The URL of the Grip server, /__/grip by default

Advanced

This file is a normal Python script, so you can add more advanced configuration.

For example, to read a setting from the environment and provide a default value when it's not set:

PORT = os.environ.get('GRIP_PORT', 8080)

API

You can access the API directly with Python, using it in your own projects:

from grip import serve

serve(port=8080)
 * Running on http://localhost:8080/

Run main directly:

from grip import main

main(argv=['-b', '8080'])
 * Running on http://localhost:8080/

Or access the underlying Flask application for even more flexibility:

from grip import create_app

grip_app = create_app(user_content=True)
# Use in your own app

Documentation

serve

Runs a local server and renders the Readme file located at path when visited in the browser.

serve(path=None, host=None, port=None, user_content=False, context=None, username=None, password=None, render_offline=False, render_wide=False, render_inline=False, api_url=None, title=None, autorefresh=True, browser=False, grip_class=None)
  • path: The filename to render, or the directory containing your Readme file, defaulting to the current working directory
  • host: The host to listen on, defaulting to the HOST configuration variable
  • port: The port to listen on, defaulting to the PORT configuration variable
  • user_content: Whether to render a document as user-content like user comments or issues
  • context: The project context to use when user_content is true, which takes the form of username/project
  • username: The user to authenticate with GitHub to extend the API limit
  • password: The password to authenticate with GitHub to extend the API limit
  • render_offline: Whether to render locally using Python-Markdown (Note: this is a work in progress)
  • render_wide: Whether to render a wide page, False by default (this has no effect when used with user_content)
  • render_inline: Whether to inline the styles within the HTML file
  • api_url: A different base URL for the github API, for example that of a Github Enterprise instance. The default is the public API https://api.github.com.
  • title: The page title, derived from path by default
  • autorefresh: Automatically update the rendered content when the Readme file changes, True by default
  • browser: Open a tab in the browser after the server starts., False by default
  • grip_class: Use a custom Grip class

export

Writes the specified Readme file to an HTML file with styles and assets inlined.

export(path=None, user_content=False, context=None, username=None, password=None, render_offline=False, render_wide=False, render_inline=True, out_filename=None, api_url=None, title=None, quiet=None, grip_class=None)
  • path: The filename to render, or the directory containing your Readme file, defaulting to the current working directory
  • user_content: Whether to render a document as user-content like user comments or issues
  • context: The project context to use when user_content is true, which takes the form of username/project
  • username: The user to authenticate with GitHub to extend the API limit
  • password: The password to authenticate with GitHub to extend the API limit
  • render_offline: Whether to render locally using Python-Markdown (Note: this is a work in progress)
  • render_wide: Whether to render a wide page, False by default (this has no effect when used with user_content)
  • render_inline: Whether to inline the styles within the HTML file (Note: unlike the other API functions, this defaults to True)
  • out_filename: The filename to write to, <in_filename>.html by default
  • api_url: A different base URL for the github API, for example that of a Github Enterprise instance. The default is the public API https://api.github.com.
  • title: The page title, derived from path by default
  • quiet: Do not print to the terminal
  • grip_class: Use a custom Grip class

create_app

Creates a Flask application you can use to render and serve the Readme files. This is the same app used by serve and export and initializes the cache, using the cached styles when available.

create_app(path=None, user_content=False, context=None, username=None, password=None, render_offline=False, render_wide=False, render_inline=False, api_url=None, title=None, text=None, grip_class=None)
  • path: The filename to render, or the directory containing your Readme file, defaulting to the current working directory
  • user_content: Whether to render a document as user-content like user comments or issues
  • context: The project context to use when user_content is true, which takes the form of username/project
  • username: The user to authenticate with GitHub to extend the API limit
  • password: The password to authenticate with GitHub to extend the API limit
  • render_offline: Whether to render locally using Python-Markdown (Note: this is a work in progress)
  • render_wide: Whether to render a wide page, False by default (this has no effect when used with user_content)
  • render_inline: Whether to inline the styles within the HTML file
  • api_url: A different base URL for the github API, for example that of a Github Enterprise instance. The default is the public API https://api.github.com.
  • title: The page title, derived from path by default
  • text: A string or stream of Markdown text to render instead of being loaded from path (Note: path can be used to set the page title)
  • grip_class: Use a custom Grip class

render_app

Renders the application created by create_app and returns the HTML that would normally appear when visiting that route.

render_app(app, route='/')
  • app: The Flask application to render
  • route: The route to render, '/' by default

render_content

Renders the specified markdown text without caching.

render_content(text, user_content=False, context=None, username=None, password=None, render_offline=False, api_url=None, title=None)
  • text: The Markdown text to render
  • user_content: Whether to render a document as user-content like user comments or issues
  • context: The project context to use when user_content is true, which takes the form of username/project
  • username: The user to authenticate with GitHub to extend the API limit
  • password: The password to authenticate with GitHub to extend the API limit
  • render_offline: Whether to render locally using Python-Markdown (Note: this is a work in progress)
  • api_url: A different base URL for the github API, for example that of a Github Enterprise instance. This is required when not using the offline renderer.
  • title: The page title, derived from path by default

render_page

Renders the markdown from the specified path or text, without caching, and returns an HTML page that resembles the GitHub Readme view.

render_page(path=None, user_content=False, context=None, username=None, password=None, render_offline=False, render_wide=False, render_inline=False, api_url=None, title=None, text=None, quiet=None, grip_class=None)
  • path: The path to use for the page title, rendering 'README.md' if None
  • user_content: Whether to render a document as user-content like user comments or issues
  • context: The project context to use when user_content is true, which takes the form of username/project
  • username: The user to authenticate with GitHub to extend the API limit
  • password: The password to authenticate with GitHub to extend the API limit
  • render_offline: Whether to render offline using Python-Markdown (Note: this is a work in progress)
  • render_wide: Whether to render a wide page, False by default (this has no effect when used with user_content)
  • render_inline: Whether to inline the styles within the HTML file
  • api_url: A different base URL for the github API, for example that of a Github Enterprise instance. The default is the public API https://api.github.com.
  • title: The page title, derived from path by default
  • text: A string or stream of Markdown text to render instead of being loaded from path (Note: path can be used to set the page title)
  • quiet: Do not print to the terminal
  • grip_class: Use a custom Grip class

clear_cache

Clears the cached styles and assets.

clear_cache(grip_class=None)

main

Runs Grip with the specified arguments.

main(argv=None, force_utf8=True)
  • argv: The arguments to run with, sys.argv[1:] by default
  • force_utf8: Sets the default encoding to utf-8 in the current Python instance. This has no effect on Python 3 since Unicode is handled by default

Classes

class Grip(Flask)

A Flask application that can serve a file or directory containing a README.

Grip(source=None, auth=None, renderer=None, assets=None, render_wide=None, render_inline=None, title=None, autorefresh=None, quiet=None, grip_url=None, static_url_path=None, instance_path=None, **kwargs)
default_renderer

Returns the default renderer using the current config. This is only used if renderer is set to None in the constructor.

Grip.default_renderer()
default_asset_manager

Returns the default asset manager using the current config. This is only used if asset_manager is set to None in the constructor.

Grip.default_asset_manager()
add_content_types

Adds the application/x-font-woff and application/octet-stream content types if they are missing. Override to add additional content types on initialization.

Grip.add_content_types()
clear_cache

Clears the downloaded assets.

Grip.clear_cache()
render

Renders the application and returns the HTML unicode that would normally appear when visiting in the browser.

Grip.render(route=None)
  • route: The route to render, / by default
run

Starts a server to render the README. This calls Flask.run internally.

Grip.run(host=None, port=None, debug=None, use_reloader=None, open_browser=False)
  • host: The hostname to listen on. Set this to '0.0.0.0' to have the server available externally as well, 'localhost' by default
  • port: The port of the webserver. Defaults to 6419
  • debug: If given, enable or disable debug mode. See Flask.debug.
  • use_reloader: Should the server automatically restart the python process if modules were changed? False by default unless the DEBUG_GRIP setting is specified.
  • open_browser: Opens the browser to the address when the server starts

class AlreadyRunningError(RuntimeError)

Raised when Grip.run is called while the server is already running.

AlreadyRunningError()

class ReadmeNotFoundError(NotFoundError or IOError)

Raised when the specified Readme could not be found.

ReadmeNotFoundError(path=None, message=None)

class ReadmeAssetManager(object)

Manages the style and font assets rendered with Readme pages. This is an abstract base class.

ReadmeAssetManager(cache_path, style_urls=None)

class GitHubAssetManager(ReadmeAssetManager)

Manages the style and font assets rendered with Readme pages. Set cache_path to None to disable caching.

class ReadmeReader(object)

Reads Readme content from a URL subpath. This is an abstract base class.

ReadmeReader()

class DirectoryReader(ReadmeReader)

Reads Readme files from URL subpaths.

DirectoryReader(path=None, silent=False)

class TextReader(ReadmeReader)

Reads Readme content from the provided unicode string.

TextReader(text, display_filename=None)

class StdinReader(TextReader)

Reads Readme text from STDIN.

StdinReader(display_filename=None)

class ReadmeRenderer(object)

Renders the Readme. This is an abstract base class.

ReadmeRenderer(user_content=None, context=None)

class GitHubRenderer(ReadmeRenderer)

Renders the specified Readme using the GitHub Markdown API.

GitHubRenderer(user_content=None, context=None, api_url=None, raw=None)

class OfflineRenderer(ReadmeRenderer)

Renders the specified Readme locally using pure Python. Note: This is currently an incomplete feature.

OfflineRenderer(user_content=None, context=None)

Constants

SUPPORTED_TITLES

The common Markdown file titles on GitHub.

SUPPORTED_TITLES = ['README', 'Home']
  • filename: The UTF-8 file to read.

SUPPORTED_EXTENSIONS

The supported extensions, as defined by GitHub.

SUPPORTED_EXTENSIONS = ['.md', '.markdown']

DEFAULT_FILENAMES

This constant contains the names Grip looks for when no file is provided.

DEFAULT_FILENAMES = [title + ext
                     for title in SUPPORTED_TITLES
                     for ext in SUPPORTED_EXTENSIONS]

DEFAULT_FILENAME

This constant contains the default Readme filename, namely:

DEFAULT_FILENAME = DEFAULT_FILENAMES[0]  # README.md

DEFAULT_GRIPHOME

This constant points to the default value if the GRIPHOME environment variable is not specified.

DEFAULT_GRIPHOME = '~/.grip'

DEFAULT_GRIPURL

The default URL of the Grip server and all its assets:

DEFAULT_GRIPURL = '/__/grip'

DEFAULT_API_URL

The default app_url value:

DEFAULT_API_URL = 'https://api.github.com'

Testing

Install the package and test requirements:

$ pip install -e .[tests]

Run tests with pytest:

$ pytest

Or to re-run tests as you make changes, use pytest-watch:

$ ptw

External assumption tests

If you're experiencing a problem with Grip, it's likely that an assumption made about the GitHub API has been broken. To verify this, run:

$ pytest -m assumption

Since the external assumptions rely on an internet connection, you may want to skip them when developing locally. Tighten the cycle even further by stopping on the first failure with -x:

$ pytest -xm "not assumption"

Or with pytest-watch:

$ ptw -- -xm "not assumption"

Contributing

  1. Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found
  2. Fork the repository and make your changes
  3. Open a new pull request

If your PR has been waiting a while, feel free to ping me on Twitter.

Use this software often? Say Thanks! 😃

Comments
  • Troubleshoot newbie

    Troubleshoot newbie

    I used pip install grip, and it reports that I have the package installed.

    However, the command "grip" is not in my path and nowhere to be found.

    (NB: I do not usually use pip, this is my first time, so my issue might be something that would not affect more expirienced users.)

    question 
    opened by jimcrayne 23
  • Auto-reload

    Auto-reload

    So happy I found this tool - have been using Marked, but it doesn't give an accurate representation of GFM. Thanks!

    Anyway, as I was working on my README with the browser next to me, was thinking it would be awesome to have it watch the file for changes, then auto-refresh the browser. Would you accept a PR if I worked on this?

    enhancement 
    opened by afeld 23
  • Add autorefresh

    Add autorefresh

    I added autorefresh support.

    This is somewhat like what's in joeyespo/grip#19 (I must admit, I didn't see that until after I'd written the code), but I think it might be a better implementation.

    This implementation uses an event stream, in-place content replacement, and is triggered by the file changing. This means:

    • We only have HTTP traffic and thus a hit to github when the file actually changes.
    • The update happens after about a second (can tweak the polling time in server.py, but I found 1s was adequate).
    • If you're scrolled a long way down the document, it won't scroll back up to the top or to the last anchor you were at (as happens with a reload).
    opened by markbt 19
  • Not seeing any styles?

    Not seeing any styles?

    Using grip 4.4.0 and a personal access token: grip --pass=<token> file.md, I'm not seeing any styles in my any of my browsers. I do see octicons.css as loaded, but the content basically looks like raw html. Am I missing something?

    opened by eriknelson 18
  • Open browser instantly after grip is running

    Open browser instantly after grip is running

    Open a new thread to run webbrowser.open('http://localhost:5000') after the HTTP server is running, to automate the redundant process of switch to browser -> open a tab -> insert/paste url -> type enter.

    If this suggestion is accepted, I would be very glad to send a pull request :D

    enhancement 
    opened by reorx 16
  • Anchor Tags not properly being rendered.

    Anchor Tags not properly being rendered.

    #### <a name="setup_PHPStorm"></a> #### 7. Setup PHPStorm

    becomes

    `

    `

    <h4> <a id="user-content-7-setup-phpstorm" class="anchor" href="#7-setup-phpstorm" aria-hidden="true"><span class="octicon octicon-link"></span></a>7. Setup PHPStorm</h4>

    thereby disallowing clickable menus at the top to jump to #setup_PHPStorm.

    not-a-bug 
    opened by dreamingbinary 14
  • Using SVGs

    Using SVGs

    Would it be possible to support SVG rendering?

    ![SVG doesn't work](image.svg)
    

    or <svg><path...

    Also it would be nice if there was an option to leave other file types alone and just let the browser render them as it would, without trying to parse them.

    Thanks!

    bug 
    opened by akaleeroy 13
  • Offline rendering

    Offline rendering

    This is intended to address #4.

    I've added support for offline rendering using misaka and Pygments, enabled by the --render-offline flag. (I didn't use Flask-Misaka; it didn't seem to be adding much).

    Some notes / requests for comments:

    • The --gfm and --context flags are silently ignored for offline rendering. What should be done here? Could try and implement that functionality locally, or maybe just emit a warning?
    • My main interest is making it work without a network connection (as opposed to e.g. improving response time), so I also made it so that retrieved styles are cached and served locally. This makes the first request a bit slower.
    • There's nothing that clears the cache; I wasn't sure what the right thing to do was here.
    enhancement 
    opened by isbadawi 13
  • PASSWORD field in config

    PASSWORD field in config

    The .grip/settings.py file is a boon. However, users might feel encouraged to hard-code their GitHub password in plain text.

    This is obviously a very bad idea – passwords have no place in configuration files at all (especially since it’s a big trend to share configuration files, e.g. on GitHub)

    It’s of course not grip’s task to solve this for the user but it might be worth mentioning in the documentation, and maybe even link to workarounds.

    Git has credential management to avoid storing the password in .gitconfig. However, I don’t know whether the GitHub API supports this, and at any rate, a simple alternative is to interface with the system’s password manager to retrieve the password. On OS X (the system I’m currently using), this can be done as follows:

    def find_password():
        import subprocess
        import re
        cmd = ['security', 'find-internet-password', '-gs', 'github.com']
        pwinfo = subprocess.Popen(cmd, stdout = subprocess.PIPE,
                stderr = subprocess.PIPE)
        pwline = pwinfo.stderr.read().strip()
        return re.sub('password: "(.*)"', '\\1', pwline)
    
    
    PASSWORD = find_password()
    

    Maybe this is of use.

    docs design 
    opened by klmr 12
  • Support chinese or others non-ascii language

    Support chinese or others non-ascii language

    add

    import sys
    reload(sys)
    sys.setdefaultencoding('utf-8')
    

    before https://github.com/joeyespo/grip/blob/master/grip/server.py#L11

    to support chinese file name

    bug 
    opened by laomo 11
  • SSL warnings when using export flag

    SSL warnings when using export flag

    This warning prints when using the --export flag:

    $ grip --export /Users/aaron/seven\ layer\ dip.md                                                                    
    
    Exporting to /Users/aaron/seven layer dip.html
    /Library/Python/2.7/site-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
      InsecurePlatformWarning
    /Library/Python/2.7/site-packages/requests/packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
      InsecureRequestWarning)
    
    bug 
    opened by getaaron 9
  • There is no longer any need for the hack, as GitHub now supports [LaTeX equations in Markdown](https://github.blog/changelog/2022-05-19-render-mathematical-expressions-in-markdown/) natively using MathJax.  It would be great, however, if grip could display such equations correctly in its preview.

    There is no longer any need for the hack, as GitHub now supports [LaTeX equations in Markdown](https://github.blog/changelog/2022-05-19-render-mathematical-expressions-in-markdown/) natively using MathJax. It would be great, however, if grip could display such equations correctly in its preview.

        There is no longer any need for the hack, as GitHub now supports [LaTeX equations in Markdown](https://github.blog/changelog/2022-05-19-render-mathematical-expressions-in-markdown/) natively using MathJax.  It would be great, however, if grip could display such equations correctly in its preview.
    

    Originally posted by @garrison in https://github.com/joeyespo/grip/issues/362#issuecomment-1139180165

    opened by MorganBergen 0
  • Add Math support

    Add Math support

    Add support for rendering mathematical expressions as requested in #362 with MathJax. You can activate it with the --render-math option.

    In the screenshot below the examples from https://github.blog/2022-05-19-math-support-in-markdown/ and https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions were tested: screenshot

    The MathJax script is loaded from a CDN from the url defined in the grip/constants.py file. If you want, I can also add a command line option for changing the url.

    opened by Antonio-R1 1
  • table of contents: link to sections

    table of contents: link to sections

    Many thanks for this program. Is it possible to be redirected to the section when you click on the "section title" in the table of contents?

    MWE:

    The following summary.md , and run as: $ grip -b summary.md

    # Table of Contents
    
    1. [Input files](#inputs)
    2. [Output files](#outputs)
    
    <a name="inputs"></a>
    ## 1. Input files
    blah 1 , blah 2...
    
    <a name="outputs"></a>
    ## 1. Ouptput files
    blah 3, blah 4...
    
    opened by DavidCdeB 0
  • Project dependencies may have API risk issues

    Project dependencies may have API risk issues

    Hi, In grip, inappropriate dependency versioning constraints can cause risks.

    Below are the dependencies and version constraints that the project is using

    docopt>=0.4.0
    Flask>=0.10.1
    Markdown>=2.5.1
    path-and-address>=2.0.1
    Pygments>=1.6
    requests>=2.4.1
    Werkzeug>=0.7
    

    The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

    After further analysis, in this project, The version constraint of dependency Flask can be changed to >=0.10,<=0.12.5.

    The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

    The invocation of the current project includes all the following methods.

    The calling methods from the Flask
    json.dumps
    json.loads
    
    The calling methods from the all methods
    self.StdinReaderMock.super.__init__
    self.Grip.super.__init__
    ValueError
    re.findall
    self.GitHubAssetManager.super.__init__
    mimetype.startswith
    response.data.decode
    self.OfflineRenderer.super.__init__
    self.reader.last_updated
    renderer.render
    self.StdinReader.super.read
    app.run
    open
    sys.stdin.read
    self.errorhandler
    doctest.testmod
    GitHubRenderer.AUTH.zero.GripMock.render
    hasattr
    self.read_stdin
    url.rsplit.rsplit
    docopt
    request.args.get
    StdinReader
    USER_CONTEXT.GitHubRenderer.AUTH.simple.GripMock.render
    os.path.exists
    render_page
    self.reader.read
    TypeError
    STYLE_ASSET_URLS_SUB_FORMAT.format
    patch
    s.connect_ex
    grip_class
    m.group
    cls.__dict__.copy
    self.add_url_rule
    filename.io.open.write
    text.encode
    os.path.normpath
    url.split
    gen
    data.decode
    self.before_request
    write
    join
    cache_directory.format
    metaclass
    sock.bind
    GitHubRenderer
    ReadmeNotFoundError
    self.config.from_object
    self.reader.filename_for
    base64.b64encode
    Thread
    markdown.util.etree.Element
    export
    urls.extend
    os.environ.get
    StdinReader.grip_class.clear_cache
    self.Grip.super.run
    os.path.getmtime
    requests.auth.HTTPBasicAuth
    asset64_bytes.decode
    USER_CONTEXT.GitHubRenderer.AUTH.zero.GripMock.render
    self.reader.mimetype_for
    shutdown_event.is_set
    cancel_event.is_set
    requests.post
    self._strip_url_params
    __doc__.split
    self.mimetype_for
    path.DirectoryReader.filename_for
    GitHubAssetManagerMock
    self._inline_styles
    Grip
    self.style_urls.extend
    self.default_renderer
    self._authenticate
    re.sub
    os.path.isdir
    self._download
    format_exc
    AUTH.zero.GripMock.render
    add_metaclass
    requests.Request
    self.GitHubRenderer.super.__init__
    self._redirect_to_subpath
    self._read_text
    is_server_running
    self._get_cached_style_urls
    GitHubAssetManager
    browser_thread.start
    INCOMPLETE_TASK_RE.sub
    getpass
    super
    AlreadyRunningError
    posixpath.basename
    urlparse
    self.reader.is_binary
    posixpath.join
    UrlizeExtension
    os.listdir
    self._resolve_readme
    send_from_directory
    GripMock
    regenerate_app
    os.makedirs
    self._to_data_url
    HEADER_PATCH_RE.sub
    read.splitlines
    GitHubRenderer.AUTH.gfm_test.GripMock.render
    json.dumps
    output_filename
    self.DirectoryReader.super.__init__
    payload.get
    str
    regenerate
    isinstance
    self._read_binary
    asset_url_path.rstrip
    self.TextReader.super.__init__
    s.close
    url.startswith
    UrlizePattern
    mimetypes.guess_type
    self._output_for
    read
    logging.getLogger
    input_filename
    COMPLETE_TASK_RE.sub
    os.path.dirname
    self._get_style_urls
    self.is_binary
    url.rsplit
    DirectoryReader
    subpath.lstrip
    USER_CONTEXT.GitHubRenderer.AUTH.gfm_test.GripMock.render
    styles.append
    socket.socket
    setup
    log.setLevel
    sock.getsockname
    bool
    self._cache_contents
    self.ReadmeRenderer.super.__init__
    input_file
    grip_class.quiet.text.title.api_url.render_inline.render_wide.render_offline.password.username.context.user_content.path.create_app.render
    AUTH.gfm_test.GripMock.render
    safe_join
    self.GitHubAssetManagerMock.super.cache_filename
    self.add_callback
    mimetypes.add_type
    print
    url_for
    start_browser_when_ready
    sys.path.insert
    GitHubRenderer.render
    render_template
    regenerate_renderer
    self.default_asset_manager
    start_browser
    asset_url_path.endswith
    el.set
    self.renderer.render
    redirect
    os.path.splitext
    self.assets.cache_filename
    type
    resolve
    self.cache_filename
    TextReader
    regenerate_raw
    threading.Lock
    grip_url.rstrip
    self.auth.requests.auth.HTTPBasicAuth
    self.assets.styles.extend
    self.ReadmeAssetManager.super.__init__
    clear_cache
    regenerate_exporter
    asset_urls.append
    self.add_content_types
    threading.Event
    USER_CONTEXT.GitHubRenderer.render
    sys.setdefaultencoding
    wait_for_server
    repr
    contents.encode
    format
    abort
    self.readme_for
    self.assets.clear
    orig_vars.pop
    self._decode_body
    AUTH.simple.GripMock.render
    os.path.abspath
    markdown.markdown
    re.compile
    self.reader.normalize_subpath
    self._find_file
    self._shutdown_event.set
    webbrowser.open
    self.assets.retrieve_styles
    kwargs.pop
    output_file
    self.ReadmeReader.super.__init__
    GitHubRenderer.AUTH.simple.GripMock.render
    urljoin
    self.GitHubAssetManagerMock.super.__init__
    r.raw.read
    self.ReadmeNotFoundError.super.__init__
    Response
    create_app
    os.path.expanduser
    self.GitHubRequestsMock.super.__init__
    time.sleep
    main
    style.endswith
    self._get_styles
    posixpath.normpath
    os.path.join
    reload
    self.StdinReader.super.__init__
    json.loads
    request.body.decode
    browser_thread.join
    STYLE_ASSET_URLS_INLINE_FORMAT.format
    r.raise_for_status
    orig_vars.get
    shutil.rmtree
    find_packages
    split_address
    c.get
    OfflineRenderer
    os.path.relpath
    NotFound
    r.mimetype_params.get
    requests.get
    serve
    text.decode
    self.test_client
    f.read
    sock.close
    match.group
    markdown.util.AtomicString
    f.write
    io.open
    werkzeug.utils.safe_join
    list
    data.json.dumps.encode
    self.config.from_pyfile
    

    @swsnider Could please help me check this issue? May I pull a request to fix it? Thank you very much.

    opened by PyDeps 0
  • Apt package fails with error on Ubuntu 22.04

    Apt package fails with error on Ubuntu 22.04

    To reproduce

    1. sudo apt install grip

    What should happen

    Grip should install.

    What actually happens

    The following error:

    The following packages have unmet dependencies:
     python3-tz : Depends: tzdata but it is not installable
    E: Unable to correct problems, you have held broken packages.
    
    opened by aral 0
Owner
Joe Esposito
Senior Software Engineer, Consultant, and open source contributor.
Joe Esposito
😸Awsome markdown readme for your profile or your portfolio

GitHub Profile Readme Description That's a simple and minimalist README.md for your profile Usage You can download or copy to your repository and make

null 0 Jul 24, 2022
Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files

Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files. Mdformat is a Unix-style command-line tool as well as a Python library.

Executable Books 180 Jan 6, 2023
A automated python script that creates mark-down files to read for the aes keys and other useful information.

Archive A automated python script that creates mark-down files to read for the aes keys and other useful information. Table of Contents Benbot Automat

Tector 13 Dec 14, 2022
A command line tool that can convert Day One data into markdown files.

Introduction Features Before Start Export data from Day One Check Integrity Special Cases for Photo Extension Name Audio Extension Name Usage Known Is

gyro永不抽风 26 Dec 31, 2022
Ahmed Hossam 12 Oct 17, 2022
One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.

AwesomeVersion One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind

Joakim Sørensen 39 Dec 31, 2022
Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com

ATTENTION: master branch is experimental, please read below Askbot - a Django Q&A forum platform This is Askbot project - open source Q&A system, like

ASKBOT 1.5k Dec 28, 2022
Generate a cool README/About me page for your Github Profile

Github Profile README/ About Me Generator ?? This webapp lets you build a cool README for your profile. A few inputs + ~15 mins = Your Github Profile

Rahul Banerjee 179 Jan 7, 2023
This Github Action automatically creates a GIF from a given web page to display on your project README

This Github Action automatically creates a GIF from a given web page to display on your project README

Pablo Lecolinet 28 Dec 15, 2022
Extend the commitizen tools to create conventional commits and README that link to Jira and GitHub.

cz-github-jira-conventional cz-github-jira-conventional is a plugin for the commitizen tools, a toolset that helps you to create conventional commit m

null 12 Dec 13, 2022
ghfetch is ai customizable CLI GitHub personal README generator.

ghfetch is ai customizable CLI GitHub personal README generator. Inspired by famous fetch such as screenfetch, neofetch and ufetch, the purpose of this tool is to introduce yourself as if you were a machine.

Alessio Celentano 3 Sep 10, 2021
A GitHub Action that automatically reports your Advent of Code progress in a table in your README

Advent README Stars This action adds and maintains a stars report in your README based on your Advent of Code progress. Example Table 2021 Results Day

Kevin Duff 36 Dec 30, 2022
Support for Competitive Coding badges to add in Github readme or portfolio websites.

Support for Competitive Coding badges to add in Github readme or portfolio websites.

Akshat Aggarwal 2 Feb 14, 2022
This script fully automates of downloading tiktok videos, editing them,compiling them and finally uploading them to youtube.

This script fully automates of downloading tiktok videos, editing them,compiling them and finally uploading them to youtube. If you wanted to create a tiktok video compiilation youtubbe channel this script is here to help you :D

Supriyo Sarkar 32 Dec 16, 2022
Collects all accepted (partial and full scored) codes submitted within the given timeframe and saves them locally for plagiarism check.

Collects all accepted (partial and full scored) codes submitted within the given timeframe of any contest.

ARITRA BELEL 2 Dec 28, 2021
Magisk module to enable hidden features on Android 12 Developer Preview 1.

Android 12 Extensions This is a Magisk module that enables hidden features on Android 12 Developer Preview 1. Features Scrolling screenshots Wallpaper

Danny Lin 384 Jan 6, 2023
A tool helps build a talk preview image by combining the given background image and talk event description

talk-preview-img-builder A tool helps build a talk preview image by combining the given background image and talk event description Installation and U

PyCon Taiwan 4 Aug 20, 2022
A Blender python script for getting asset browser custom preview images for objects and collections.

asset_snapshot A Blender python script for getting asset browser custom preview images for objects and collections. Installation: Click the code butto

Johnny Matthews 44 Nov 29, 2022
This discord bot preview user 42intra login picture.

42intra_Pic BOT This discord bot preview user 42intra login picture. created by: @YOPI#8626 Using: Python 3.9 (64-bit) (You don't need 3.9 but some fu

Zakaria Yacoubi 7 Mar 22, 2022
This is the fuzzer I made to fuzz Preview on macOS and iOS like 8years back when I just started fuzzing things.

Fuzzing PDFs like its 1990s This is the fuzzer I made to fuzz Preview on macOS and iOS like 8years back when I just started fuzzing things. Some discl

Chaithu 14 Sep 30, 2022