htk


Namehtk JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/hacktoolkit/python-htk
SummaryA set of convenience utils for Python
upload_time2023-08-21 00:26:30
maintainer
docs_urlNone
authorHacktoolkit
requires_python
licenseMIT
keywords python debugging slack requests apis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![](https://img.shields.io/pypi/pyversions/htk.svg?longCache=True)](https://pypi.org/project/htk/)
[![](https://img.shields.io/pypi/v/htk.svg?maxAge=3600)](https://pypi.org/project/htk/)

# python-htk

A set of convenience utils for Python requiring no external libs. Some of the best tricks from [`django-htk`](https://github.com/hacktoolkit/django-htk), without the bloat and Django dependency.


# Features

- Debug via Slack using `slack_debug` and `slack_debug_json`. The best of `println` debugging, without the inconvenience of visually fishing for one message out of thousands of log lines.
- Debug via writing to local file using `fdb` (`fdebug`) and `fdb_json` (`fdebug_json`). Certifiably awesome, fast, and secure.


# How To Use This Awesome?

## Installation

1. Install via PIP:
    `pip install htk`
1. (**Alternative install via clone**) Install via local clone: clone this repository into a directory named `htk`  
    SSH: `git clone git@github.com:hacktoolkit/python-htk.git htk`  
    HTTPS: `git clone https://github.com/hacktoolkit/python-htk.git`
1. Add your [Slack incoming webhook](https://slack.com/apps/A0F7XDUAZ-incoming-webhooks) URL.
    1. Create an ENV variable named `HTK_SLACK_WEBHOOK_URL` or `SLACK_WEBHOOK_URL`.
    1. For a local clone, you can also create a `local_settings.py` and add the constant `HTK_SLACK_WEBHOOK_URL` or `SLACK_WEBHOOK_URL` within.

### Tips on Location of HTK Module (for Local Installation Only)

1. You can place it outside of your app directory tree, and then symlink it inside.
1. To not be nagged by the presence of the `htk` directory whenever you do `git status`, add `htk` to your `.git/info/exclude` file (like `.gitignore`, but only in your local repository, not checked in).

## Slack Debug

1. Example usage in Python Shell
    ```
    In [1]: from htk import slack_debug

    In [2]: from htk import slack_debug_json

    In [3]: slack_debug('This is seriously awesome!')
    Out[3]: <Response [200]>

    In [4]: slack_debug('Yeah, no kidding.')
    Out[4]: <Response [200]>

    In [5]: slack_debug_json({'A':1,'B':2,'C':3,'X':['foo','bar','baz'],'Z':{'nested_key':'nested_val
       ...: ue'}}),
    Out[5]: (None,)
    ```
1. Check your Slack to verify that the message was posted. If not, perhaps your token was wrong, or the Slack integration was disabled.
    ![image](https://user-images.githubusercontent.com/422501/61013274-e65e1e00-a336-11e9-90aa-44a6fd1e217c.png)  
    (Alternative link to screenshot above: https://cl.ly/436cfb4383a2)
1. Profit!

## FDebug (`FDB` aka `fdb`, short for `fdebug`)

1. (**Recommended**) Create a BASH alias or similar: `alias fdb='touch /tmp/fdebug.log; tail -f /tmp/fdebug.log'`
   1. By default, the file path which `fdb` writes to is `/tmp/fdebug.log`. This is because `/tmp` is generally a writeable path on most systems.
   1. In a separate window used for debugging, run `fdb` to watch the logs roll in.
1. `from htk import fdb`
1. `fdb('Not all heroes wear capes')`
    1. If a different file path is desired, simply invoke `fdb` with its second optional argument: `fdb('log or debugging message', file_path='/path/to/fdebug.log')

# See Also

- C# - https://github.com/hacktoolkit/csharp-htk
- JavaScript - https://github.com/hacktoolkit/htk.js
- PHP - https://github.com/hacktoolkit/php-htk
- Python (full) - https://github.com/hacktoolkit/python-htk
- Python (lite) - https://github.com/hacktoolkit/python-htk-lite
- Ruby - https://github.com/hacktoolkit/htk-rb

# Authors and Maintainers

- [Hacktoolkit](https://github.com/hacktoolkit)
- [Jonathan Tsai](https://github.com/jontsai)

# License

MIT. See `LICENSE.md`

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hacktoolkit/python-htk",
    "name": "htk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python debugging slack requests apis",
    "author": "Hacktoolkit",
    "author_email": "hello@hacktoolkit.com",
    "download_url": "",
    "platform": null,
    "description": "[![](https://img.shields.io/pypi/pyversions/htk.svg?longCache=True)](https://pypi.org/project/htk/)\n[![](https://img.shields.io/pypi/v/htk.svg?maxAge=3600)](https://pypi.org/project/htk/)\n\n# python-htk\n\nA set of convenience utils for Python requiring no external libs. Some of the best tricks from [`django-htk`](https://github.com/hacktoolkit/django-htk), without the bloat and Django dependency.\n\n\n# Features\n\n- Debug via Slack using `slack_debug` and `slack_debug_json`. The best of `println` debugging, without the inconvenience of visually fishing for one message out of thousands of log lines.\n- Debug via writing to local file using `fdb` (`fdebug`) and `fdb_json` (`fdebug_json`). Certifiably awesome, fast, and secure.\n\n\n# How To Use This Awesome?\n\n## Installation\n\n1. Install via PIP:\n    `pip install htk`\n1. (**Alternative install via clone**) Install via local clone: clone this repository into a directory named `htk`  \n    SSH: `git clone git@github.com:hacktoolkit/python-htk.git htk`  \n    HTTPS: `git clone https://github.com/hacktoolkit/python-htk.git`\n1. Add your [Slack incoming webhook](https://slack.com/apps/A0F7XDUAZ-incoming-webhooks) URL.\n    1. Create an ENV variable named `HTK_SLACK_WEBHOOK_URL` or `SLACK_WEBHOOK_URL`.\n    1. For a local clone, you can also create a `local_settings.py` and add the constant `HTK_SLACK_WEBHOOK_URL` or `SLACK_WEBHOOK_URL` within.\n\n### Tips on Location of HTK Module (for Local Installation Only)\n\n1. You can place it outside of your app directory tree, and then symlink it inside.\n1. To not be nagged by the presence of the `htk` directory whenever you do `git status`, add `htk` to your `.git/info/exclude` file (like `.gitignore`, but only in your local repository, not checked in).\n\n## Slack Debug\n\n1. Example usage in Python Shell\n    ```\n    In [1]: from htk import slack_debug\n\n    In [2]: from htk import slack_debug_json\n\n    In [3]: slack_debug('This is seriously awesome!')\n    Out[3]: <Response [200]>\n\n    In [4]: slack_debug('Yeah, no kidding.')\n    Out[4]: <Response [200]>\n\n    In [5]: slack_debug_json({'A':1,'B':2,'C':3,'X':['foo','bar','baz'],'Z':{'nested_key':'nested_val\n       ...: ue'}}),\n    Out[5]: (None,)\n    ```\n1. Check your Slack to verify that the message was posted. If not, perhaps your token was wrong, or the Slack integration was disabled.\n    ![image](https://user-images.githubusercontent.com/422501/61013274-e65e1e00-a336-11e9-90aa-44a6fd1e217c.png)  \n    (Alternative link to screenshot above: https://cl.ly/436cfb4383a2)\n1. Profit!\n\n## FDebug (`FDB` aka `fdb`, short for `fdebug`)\n\n1. (**Recommended**) Create a BASH alias or similar: `alias fdb='touch /tmp/fdebug.log; tail -f /tmp/fdebug.log'`\n   1. By default, the file path which `fdb` writes to is `/tmp/fdebug.log`. This is because `/tmp` is generally a writeable path on most systems.\n   1. In a separate window used for debugging, run `fdb` to watch the logs roll in.\n1. `from htk import fdb`\n1. `fdb('Not all heroes wear capes')`\n    1. If a different file path is desired, simply invoke `fdb` with its second optional argument: `fdb('log or debugging message', file_path='/path/to/fdebug.log')\n\n# See Also\n\n- C# - https://github.com/hacktoolkit/csharp-htk\n- JavaScript - https://github.com/hacktoolkit/htk.js\n- PHP - https://github.com/hacktoolkit/php-htk\n- Python (full) - https://github.com/hacktoolkit/python-htk\n- Python (lite) - https://github.com/hacktoolkit/python-htk-lite\n- Ruby - https://github.com/hacktoolkit/htk-rb\n\n# Authors and Maintainers\n\n- [Hacktoolkit](https://github.com/hacktoolkit)\n- [Jonathan Tsai](https://github.com/jontsai)\n\n# License\n\nMIT. See `LICENSE.md`\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A set of convenience utils for Python",
    "version": "2.1.0",
    "project_urls": {
        "Documentation": "https://github.com/hacktoolkit/python-htk",
        "Homepage": "https://github.com/hacktoolkit/python-htk",
        "Source": "https://github.com/hacktoolkit/python-htk"
    },
    "split_keywords": [
        "python",
        "debugging",
        "slack",
        "requests",
        "apis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f1684f04e894c4d53eb6ae40180889617c5bb553fcdf2d7f6be6370aef36bded",
                "md5": "09548b71446571de202b7271a1a411b2",
                "sha256": "92b9fc43c93f5cdd4bf7f193729b62b200c1d85c30bb67ed86de0f761f71aea4"
            },
            "downloads": -1,
            "filename": "htk-2.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09548b71446571de202b7271a1a411b2",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 12568,
            "upload_time": "2023-08-21T00:26:30",
            "upload_time_iso_8601": "2023-08-21T00:26:30.852123Z",
            "url": "https://files.pythonhosted.org/packages/f1/68/4f04e894c4d53eb6ae40180889617c5bb553fcdf2d7f6be6370aef36bded/htk-2.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-21 00:26:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hacktoolkit",
    "github_project": "python-htk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "htk"
}
        
Elapsed time: 0.78310s