tekek


Nametekek JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/dolano-tours/tekek
SummaryAn Asynchronous Remote and Local Debugging Tools
upload_time2020-09-25 12:24:59
maintainer
docs_urlNone
authorErlangga Ibrahim
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align=center>
    <img alt="tekek" src="https://raw.githubusercontent.com/dolano-tours/tekek/cddf6ae123a092bed011d065d64a8d01d57d94cc/.rsc/logo_full.svg" width=250/>
</p>

<h1 align=center>Tekek</h1>
<p align=center>
<img alt="Travis (.org)" src="https://img.shields.io/travis/dolano-tours/tekek/nightly?label=nightly-build">
<img alt="Travis (.org)" src="https://img.shields.io/travis/dolano-tours/tekek/production?label=production-build">
<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/tekek">
<img alt="PyPI - License" src="https://img.shields.io/pypi/l/tekek">
<img alt="PyPI" src="https://img.shields.io/pypi/v/tekek">
<img alt="PyPI - Status" src="https://img.shields.io/pypi/status/tekek">
<img alt="PyPI - Format" src="https://img.shields.io/pypi/format/tekek">

<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/tekek">
</p>
<p align=center><b>Tekek</b> [təʔkəʔ] is easy to use, fast, server-agnostic, asynchronous, highly configurable local and remote logging tool </p>

## Features

- Semi-Direct Replacement for python built-in's logger
- Asynchronous
- <sub>Support Websocket <super><i><b>(WIP)</b></i></super></sub>
- Reliable Remote Logging
- Reliable File Logging
- Reliable Console Logging
- Highly Configurable

## Installation
Tekek is available via **PyPI** you can install it using `pip`

```shell script
python3 -m pip install tekek
```

Import `Tekek` and instantiate.

## Hello World

```python
from tekek import Tekek


logger = Tekek(name=__name__)
```

By default, tekek came with 7 levels of log record

```python
logger.log("MESSAGE")
logger.debug("MESSAGE")
logger.info("MESSAGE")
logger.warning("MESSAGE")
logger.error("MESSAGE")
logger.exception("MESSAGE")
logger.critical("MESSAGE")
```

example basic usage:

```python
def function_a():
    logger.log("function a starts !", identifier="function_a")
    try:
        ...  # Some Algorithm
        logger.info("finished doing things", "function_a")
    except Exception as e:
        logger.exception("Exception raised {}".format(e), "function_a")

    logger.debug(identifier="function_a", message="function a finished !")
    return

def function_b():
    logger.error("this error came from function b", "function_a")
```

and yes it is regular function not an `async` function. why ? Because **Tekek** is smart enough to handle it for you. don't worry it barely scratch your application performance

## Compatibility Example

### Sanic

oh yeah, if you _**Gotta Go Fast**_, you need to develop it **FAST** ! use tekek as your logging and debugging tool !

```python
from sanic import Sanic
from sanic.response import json
from tekek import Tekek

app = Sanic("sanic_example")
logger = Tekek("sanic_example", app=app)


@app.route("/", methods=["GET"])
async def root(request):
    logger.log("root accessed ! hello world!", "root")
    return json(
        {
            "status": "Hello World!"
        }
    )

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8000)
```

### Fast API

A beautiful API Framework need a beautiful tekek as well ;)

```python
from fastapi import FastAPI
from tekek import Tekek


app = FastAPI()
logger = Tekek("my_fast_api", app=app)


@app.get("/")
async def root():
    logger.log("root accessed ! hello world!", "root")
    return {"status": "Hello World!"}
```

### Your Own Script!

Of course you can use your own app! let's create `my_app` as an example

using `coroutine` function

```python
import asyncio
from tekek import Tekek


logger = Tekek("mah_own")


async def my_app(some_param: int):
    logger.log(f"My App Run Successfully! {some_param}")
    ...  # Your Beautiful app

    return True


async def main():
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)

    await asyncio.gather(
        my_app(3),
        logger.start()
    )


if __name__ == '__main__':
    asyncio.run(main())
```

using `class`

```python
import asyncio
from tekek import Tekek


logger = Tekek("mah_own")


class MyApp:
    def __init__(self):
        self.some_vars = 3

    async def app(self):
        logger.log(f"App Ran! {self.some_vars}")
        ...  # Your beautiful app

    async def start(self):
        asyncio.ensure_future(self.app())


my_app = MyApp()


async def main():
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)

    await asyncio.gather(
        my_app.start(),
        logger.start()
    )


if __name__ == '__main__':
    asyncio.run(main())
```

## Da Real Deal!

Go Ahead and Read : <a href="">Usage Documentations</a>


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dolano-tours/tekek",
    "name": "tekek",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Erlangga Ibrahim",
    "author_email": "erlanggaibr2@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/69/3d/729be283b065ab40a9c16b45e4ac5af29bc1b98bf93db663d7cf52a234fd/tekek-0.1.6.tar.gz",
    "platform": "",
    "description": "<p align=center>\n    <img alt=\"tekek\" src=\"https://raw.githubusercontent.com/dolano-tours/tekek/cddf6ae123a092bed011d065d64a8d01d57d94cc/.rsc/logo_full.svg\" width=250/>\n</p>\n\n<h1 align=center>Tekek</h1>\n<p align=center>\n<img alt=\"Travis (.org)\" src=\"https://img.shields.io/travis/dolano-tours/tekek/nightly?label=nightly-build\">\n<img alt=\"Travis (.org)\" src=\"https://img.shields.io/travis/dolano-tours/tekek/production?label=production-build\">\n<img alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/tekek\">\n<img alt=\"PyPI - License\" src=\"https://img.shields.io/pypi/l/tekek\">\n<img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/tekek\">\n<img alt=\"PyPI - Status\" src=\"https://img.shields.io/pypi/status/tekek\">\n<img alt=\"PyPI - Format\" src=\"https://img.shields.io/pypi/format/tekek\">\n\n<img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/tekek\">\n</p>\n<p align=center><b>Tekek</b> [t\u0259\u0294k\u0259\u0294] is easy to use, fast, server-agnostic, asynchronous, highly configurable local and remote logging tool </p>\n\n## Features\n\n- Semi-Direct Replacement for python built-in's logger\n- Asynchronous\n- <sub>Support Websocket <super><i><b>(WIP)</b></i></super></sub>\n- Reliable Remote Logging\n- Reliable File Logging\n- Reliable Console Logging\n- Highly Configurable\n\n## Installation\nTekek is available via **PyPI** you can install it using `pip`\n\n```shell script\npython3 -m pip install tekek\n```\n\nImport `Tekek` and instantiate.\n\n## Hello World\n\n```python\nfrom tekek import Tekek\n\n\nlogger = Tekek(name=__name__)\n```\n\nBy default, tekek came with 7 levels of log record\n\n```python\nlogger.log(\"MESSAGE\")\nlogger.debug(\"MESSAGE\")\nlogger.info(\"MESSAGE\")\nlogger.warning(\"MESSAGE\")\nlogger.error(\"MESSAGE\")\nlogger.exception(\"MESSAGE\")\nlogger.critical(\"MESSAGE\")\n```\n\nexample basic usage:\n\n```python\ndef function_a():\n    logger.log(\"function a starts !\", identifier=\"function_a\")\n    try:\n        ...  # Some Algorithm\n        logger.info(\"finished doing things\", \"function_a\")\n    except Exception as e:\n        logger.exception(\"Exception raised {}\".format(e), \"function_a\")\n\n    logger.debug(identifier=\"function_a\", message=\"function a finished !\")\n    return\n\ndef function_b():\n    logger.error(\"this error came from function b\", \"function_a\")\n```\n\nand yes it is regular function not an `async` function. why ? Because **Tekek** is smart enough to handle it for you. don't worry it barely scratch your application performance\n\n## Compatibility Example\n\n### Sanic\n\noh yeah, if you _**Gotta Go Fast**_, you need to develop it **FAST** ! use tekek as your logging and debugging tool !\n\n```python\nfrom sanic import Sanic\nfrom sanic.response import json\nfrom tekek import Tekek\n\napp = Sanic(\"sanic_example\")\nlogger = Tekek(\"sanic_example\", app=app)\n\n\n@app.route(\"/\", methods=[\"GET\"])\nasync def root(request):\n    logger.log(\"root accessed ! hello world!\", \"root\")\n    return json(\n        {\n            \"status\": \"Hello World!\"\n        }\n    )\n\nif __name__ == \"__main__\":\n    app.run(host=\"0.0.0.0\", port=8000)\n```\n\n### Fast API\n\nA beautiful API Framework need a beautiful tekek as well ;)\n\n```python\nfrom fastapi import FastAPI\nfrom tekek import Tekek\n\n\napp = FastAPI()\nlogger = Tekek(\"my_fast_api\", app=app)\n\n\n@app.get(\"/\")\nasync def root():\n    logger.log(\"root accessed ! hello world!\", \"root\")\n    return {\"status\": \"Hello World!\"}\n```\n\n### Your Own Script!\n\nOf course you can use your own app! let's create `my_app` as an example\n\nusing `coroutine` function\n\n```python\nimport asyncio\nfrom tekek import Tekek\n\n\nlogger = Tekek(\"mah_own\")\n\n\nasync def my_app(some_param: int):\n    logger.log(f\"My App Run Successfully! {some_param}\")\n    ...  # Your Beautiful app\n\n    return True\n\n\nasync def main():\n    loop = asyncio.new_event_loop()\n    asyncio.set_event_loop(loop)\n\n    await asyncio.gather(\n        my_app(3),\n        logger.start()\n    )\n\n\nif __name__ == '__main__':\n    asyncio.run(main())\n```\n\nusing `class`\n\n```python\nimport asyncio\nfrom tekek import Tekek\n\n\nlogger = Tekek(\"mah_own\")\n\n\nclass MyApp:\n    def __init__(self):\n        self.some_vars = 3\n\n    async def app(self):\n        logger.log(f\"App Ran! {self.some_vars}\")\n        ...  # Your beautiful app\n\n    async def start(self):\n        asyncio.ensure_future(self.app())\n\n\nmy_app = MyApp()\n\n\nasync def main():\n    loop = asyncio.new_event_loop()\n    asyncio.set_event_loop(loop)\n\n    await asyncio.gather(\n        my_app.start(),\n        logger.start()\n    )\n\n\nif __name__ == '__main__':\n    asyncio.run(main())\n```\n\n## Da Real Deal!\n\nGo Ahead and Read : <a href=\"\">Usage Documentations</a>\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An Asynchronous Remote and Local Debugging Tools",
    "version": "0.1.6",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "7181712bf6d8a5379429fc2df2f84b04",
                "sha256": "d619f7c341efda149a0da72f433f880a10c25f654468669112896bfa3e51c279"
            },
            "downloads": -1,
            "filename": "tekek-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7181712bf6d8a5379429fc2df2f84b04",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 20431,
            "upload_time": "2020-09-25T12:24:57",
            "upload_time_iso_8601": "2020-09-25T12:24:57.856522Z",
            "url": "https://files.pythonhosted.org/packages/08/56/22e244231dc7a133842b98416f978c1a3d713db28900d72528d358ef888c/tekek-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "e62e822f3a3beb08d8a6e6223d8f920b",
                "sha256": "37b1d066693a42c817be7309c155d3a3e31edef1094d9ae94b6820b02ee24c74"
            },
            "downloads": -1,
            "filename": "tekek-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "e62e822f3a3beb08d8a6e6223d8f920b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9493,
            "upload_time": "2020-09-25T12:24:59",
            "upload_time_iso_8601": "2020-09-25T12:24:59.389369Z",
            "url": "https://files.pythonhosted.org/packages/69/3d/729be283b065ab40a9c16b45e4ac5af29bc1b98bf93db663d7cf52a234fd/tekek-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-09-25 12:24:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "dolano-tours",
    "error": "Could not fetch GitHub repository",
    "lcname": "tekek"
}
        
Elapsed time: 0.14890s