Skip to main content

Command line webhooks, on demand

Project description

hookee - command line webhooks, on demand

Version Python Versions Coverage Build Docs GitHub License

hookee is a utility that provides command line webhooks, on demand! Dump useful request data to the console, process requests and responses, customize response data, and configure hookee and its routes further in any number of ways through custom plugins.

Installation

hookee is available on PyPI and can be installed using pip:

pip install hookee

or conda:

conda install -c conda-forge hookee

That's it! hookee is now available as a Python package and is available from the command line.

Configure authtoken

To get the most out of hookee, you'll want to obtain an authtoken from ngrok (it's free!) and install it in to hookee's config file:

hookee authtoken $NGROK_AUTHTOKEN

Basic Usage

hookee makes it easy to get webhooks on the fly right from the console. Simply start it with:

hookee start

With its default configuration, this will start a server on port 8000, open a ngrok tunnel using pyngrok, and mount a URL at /webhook. Sending any request to the /webhook endpoint will dump the request and response data to the console.

hookee can be configured in a number of ways to quickly and easily tweak request and response data. For example, here is how you can customize the response body from /webhook using the --response arg.

hookee --response "<Response>Ok</Response>" \
    --content-type application/xml

hookee can also be started without a tunnel (removing the dependency on ngrok and an Internet connection). Using the --no-tunnel flag only starts hookee's server, allowing responses to be mocked locally. This can be particularly useful when service discovery is done through a proxy service (ex. HAProxy, Envoy, etc.), meaning you can tell hookee to start on the port of an expected downstream, thus intercepting requests to that service to provide your own responses in an isolated environment, very useful for rapid local development, cluster testing, and more.

hookee --no-tunnel --response "<Response>Ok</Response>" \
    --content-type application/xml \
    --default-route /some/route \
    --port 19780

To see the ways hookee can be tweaked right from the console, view its documented args and commands like this:

hookee --help

Documentation

For more advanced usage, including how hookee's default configuration can be changed, extended through plugins, API integrations, and more, see its official documentation is available at Read the Docs.

Contributing

If you would like to get involved, be sure to review the Contribution Guide.

Want to contribute financially? If you've found hookee useful, sponsorship would also be greatly appreciated!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hookee-2.4.0.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hookee-2.4.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file hookee-2.4.0.tar.gz.

File metadata

  • Download URL: hookee-2.4.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for hookee-2.4.0.tar.gz
Algorithm Hash digest
SHA256 d1faa79fdb42a0fdce6b91afd28ee4bb9b7874e8c04b206b35144d75a9b9cab0
MD5 a6b76291939ababf601285705bde9eff
BLAKE2b-256 05285d02efe0a989394a5c8fd9156acc818ca5ac2406234e37c8bbec56af2f5c

See more details on using hashes here.

File details

Details for the file hookee-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: hookee-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for hookee-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0dfbc561b7c5538f519a290b22633f7e2ee67ff633a12f6ea8f06b1803e25cab
MD5 f9c468729d845fd3bf69067fb55ea088
BLAKE2b-256 945c92aa66abfaf41ed17b4a8a59e7059ec429c6b0425a93daaa35279f1a00c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page