Shell helper utilities for python
Project description
gripe | |
Opinionated extensions for the `grip` utility. The grip utility provides rendering/serving local markdown files written in github-flavored markdown. Gripe extends it, allowing for serving more types of local files, as well as intelligent management for multiple `grip` daemons. |
Overview
The gripe
library provides extensions for grip.
The grip utility provides rendering/serving local markdown files written in github-flavored markdown.
Gripe extends it, allowing for serving more types of local files, as well as intelligent management for multiple grip
daemons without thinking about server-port collisions.
Features
Support for Multiple Projects
Working with multiple projects simultaneously is supported. This works by managing multiple daemons with a per-project port. See CLI Usage for more information.
Installation
See pypi for available releases.
$ pip install gripe
Usage (CLI)
The gripe library publishes a small CLI tool.
Listing Servers
# or `gripe ls` or `python -mgripe ls`
$ gripe list
{"local": [], "foreign": []}
Starting and Stopping Servers
# or `python -mgripe start`
$ gripe start
INFO gripe Trying to serve files
DEBUG gripe Starting gripe for this project..
DEBUG gripe Used ports: []
INFO gripe starting server with command:
INFO gripe 'flask --app gripe:app run --port 6149 >> .tmp.gripe.log 2>&1 &'
# startup example for a 2nd server over the same project: server start is NO-OP
$ gripe start
INFO gripe Trying to serve files
INFO gripe 1 copies of gripe are already started
INFO gripe gripe @ pid `10059` is already serving this project
INFO gripe Skipping startup.
# startup example for 2nd server over 2nd project: new port allocated automatically
$ gripe start
INFO gripe trying to serve files
INFO gripe 1 copies of gripe are already started
INFO gripe No gripes are serving this project.
DEBUG gripe Starting gripe for this project..
DEBUG gripe Used ports: [6149]
DEBUG gripe server port @ 6149, using next available @ 6150
INFO gripe starting server with command:
INFO gripe 'flask --app gripe:app run --port 6150 >> .tmp.gripe.log 2>&1 &'
$ gripe stop
INFO gripe gripe @ {'pid': 10059, 'cwd':'...', 'port': 6149} started here
INFO gripe killing it..
Usage (API)
Listing Servers
>>> import gripe
>>> gripe.list()
{"local": [], "foreign": []}
Starting and Stopping Servers
>>> import gripe
>>> servers = gripe.start(); print(servers)
{ "local": [
{ "pid": 93867,
"cwd": "...",
"port": 6149 }
],
"foreign": []
}
>>> gripe.stop(grips=servers['local'])
{
"killed":
[ { "pid": 93867,
"cwd": "...",
"port": 6149 } ]
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gripe-2024.2.24.1.31.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for gripe-2024.2.24.1.31-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7be1483720ff4eef7fb0c734218c0f693c1d1f5eac4e313cfbb55dc6bd09c82 |
|
MD5 | 5d03e4a9b13a98618c9c5f7f01d5f0e6 |
|
BLAKE2b-256 | e49d9660ce5295e77b768310ed8e459010ce101a75c85ef1bda063bb9cfad964 |