simplestatusserver


Namesimplestatusserver JSON
Version 1.0.0.0 PyPI version JSON
download
home_pageNone
SummaryA single file python module that simplifies creating and running a simple `Flask` server that reports a json formated dict. Intended to be used with simple apps that run in container style environments, allowing for a basic http server to report the status of the app.
upload_time2024-05-26 17:04:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3
licenseNone
keywords http https server simple status monitor monitoring quick single file flask
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Git Auto Backup

This module is intended to be imported into any script requiring a simple HTTP status reporting page.
This optionally supports threading as well, defining the ```run_threaded``` and ```make_thread``` methods.

[![CodeQL](https://github.com/MarkusHammer/SimpleStatusServer/actions/workflows/codeql.yml/badge.svg)](https://github.com/MarkusHammer/SimpleStatusServer/actions/workflows/codeql.yml)

## Setup

This module can be installed using:

``pip install simplestatusserver``

## Module Interface

This module only contains a single (fully documented) class: ```SimpleStatusServer```.
This cass can be instantiated to generate and when desired, run, a simple HTTP server.
This server will report the data contained within that instance's ```status``` attribute as json.
The instance itself may also be used as a dictionary, passing along all the data contained withing its ```status```
If the ```threading``` module is imported (which can be checked using the module's ```STATUS_SERVER_THREADING_POSSIBLE``` constant), threading related running methods are also defined for this class.
Refer to the docstrings for each method for more information.
This module contains type hints.

### Example

```python:
from simplestatusserver import SimpleStatusServer, STATUS_SERVER_THREADING_POSSIBLE as THREADING_POSSIBLE
#Note: this example presumes that the threading module is available!
assert THREADING_POSSIBLE, "The threading module must be available for this example to work!"

#some code here...

server = SimpleStatusServer(init_status = {"hello": "world"})
server["world"] == "hello" #returns True
server["status"] = "starting..."
#now run the http server
server.run_threaded(debug = True)

#perhaps a startup routine here?

server["status"] = "running"
del server["world"] #lets remove this key...

try:
  #the main part of a script here...
  pass
except Exception as e:
  server["error"] = str(e)
  server["error code"] = 1

#finish off things here...

print("all done!")

```

## Licence

This is licensed under the Mozilla Public License 2.0 (MPL 2.0) Licence. See the ``Licence`` file in this repository for more information.

## Credits

This project uses the 'Flask' python module.

While not required, feel free to credit "*Markus Hammer*" (or just "*Markus*") if you find this code or script useful for whatever you may be doing with it.

**Thanks!**

# Security Policy

While the python source code will be actively maintained, any binary files (if at all provided) are in no way supported.
These are provided as a courtesy and are not intended to be the main usage of this software.
Please keep this in mind when choosing how you wish to use this software.

## Supported Versions

| Version     | Supported |
| ----------- | --------- |
| 1.0.0.0 >= | ✅        |
| 1.0.0.0 <  | ❌        |

## Reporting a Vulnerability

Please report any issues to the email 107761433+MarkusHammer(THEN THE @ SYMBOL HERE)users.noreply.github.com

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "simplestatusserver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "http, https, server, simple, status, monitor, monitoring, quick, single file, flask",
    "author": null,
    "author_email": "Markus Hammer <107761433+MarkusHammer@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/f3/7c/565829d63158ff37763fd6a9ebc8ee5358b358064f8dd662242f46823129/simplestatusserver-1.0.0.0.tar.gz",
    "platform": null,
    "description": "# Git Auto Backup\r\n\r\nThis module is intended to be imported into any script requiring a simple HTTP status reporting page.\r\nThis optionally supports threading as well, defining the ```run_threaded``` and ```make_thread``` methods.\r\n\r\n[![CodeQL](https://github.com/MarkusHammer/SimpleStatusServer/actions/workflows/codeql.yml/badge.svg)](https://github.com/MarkusHammer/SimpleStatusServer/actions/workflows/codeql.yml)\r\n\r\n## Setup\r\n\r\nThis module can be installed using:\r\n\r\n``pip install simplestatusserver``\r\n\r\n## Module Interface\r\n\r\nThis module only contains a single (fully documented) class: ```SimpleStatusServer```.\r\nThis cass can be instantiated to generate and when desired, run, a simple HTTP server.\r\nThis server will report the data contained within that instance's ```status``` attribute as json.\r\nThe instance itself may also be used as a dictionary, passing along all the data contained withing its ```status```\r\nIf the ```threading``` module is imported (which can be checked using the module's ```STATUS_SERVER_THREADING_POSSIBLE``` constant), threading related running methods are also defined for this class.\r\nRefer to the docstrings for each method for more information.\r\nThis module contains type hints.\r\n\r\n### Example\r\n\r\n```python:\r\nfrom simplestatusserver import SimpleStatusServer, STATUS_SERVER_THREADING_POSSIBLE as THREADING_POSSIBLE\r\n#Note: this example presumes that the threading module is available!\r\nassert THREADING_POSSIBLE, \"The threading module must be available for this example to work!\"\r\n\r\n#some code here...\r\n\r\nserver = SimpleStatusServer(init_status = {\"hello\": \"world\"})\r\nserver[\"world\"] == \"hello\" #returns True\r\nserver[\"status\"] = \"starting...\"\r\n#now run the http server\r\nserver.run_threaded(debug = True)\r\n\r\n#perhaps a startup routine here?\r\n\r\nserver[\"status\"] = \"running\"\r\ndel server[\"world\"] #lets remove this key...\r\n\r\ntry:\r\n  #the main part of a script here...\r\n  pass\r\nexcept Exception as e:\r\n  server[\"error\"] = str(e)\r\n  server[\"error code\"] = 1\r\n\r\n#finish off things here...\r\n\r\nprint(\"all done!\")\r\n\r\n```\r\n\r\n## Licence\r\n\r\nThis is licensed under the Mozilla Public License 2.0 (MPL 2.0) Licence. See the ``Licence`` file in this repository for more information.\r\n\r\n## Credits\r\n\r\nThis project uses the 'Flask' python module.\r\n\r\nWhile not required, feel free to credit \"*Markus Hammer*\" (or just \"*Markus*\") if you find this code or script useful for whatever you may be doing with it.\r\n\r\n**Thanks!**\r\n\r\n# Security Policy\r\n\r\nWhile the python source code will be actively maintained, any binary files (if at all provided) are in no way supported.\r\nThese are provided as a courtesy and are not intended to be the main usage of this software.\r\nPlease keep this in mind when choosing how you wish to use this software.\r\n\r\n## Supported Versions\r\n\r\n| Version     | Supported |\r\n| ----------- | --------- |\r\n| 1.0.0.0\u00a0>= | \u2705        |\r\n| 1.0.0.0\u00a0<  | \u274c        |\r\n\r\n## Reporting a Vulnerability\r\n\r\nPlease report any issues to the email 107761433+MarkusHammer(THEN THE @ SYMBOL HERE)users.noreply.github.com\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A single file python module that simplifies creating and running a simple `Flask` server that reports a json formated dict. Intended to be used with simple apps that run in container style environments, allowing for a basic http server to report the status of the app.",
    "version": "1.0.0.0",
    "project_urls": {
        "Git": "https://github.com/MarkusHammer/SimpleStatusServer.git",
        "Github": "https://github.com/MarkusHammer/SimpleStatusServer",
        "Homepage": "https://github.com/MarkusHammer/SimpleStatusServer",
        "Issues": "https://github.com/MarkusHammer/SimpleStatusServer/issues",
        "Pull Requests": "https://github.com/MarkusHammer/SimpleStatusServer/pulls"
    },
    "split_keywords": [
        "http",
        " https",
        " server",
        " simple",
        " status",
        " monitor",
        " monitoring",
        " quick",
        " single file",
        " flask"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8476f80418e0a70b3f061d92df155bd95bd3082e1e0124b15b42453e7d4208e8",
                "md5": "3df0f4e6c7d13ebf6927615b2b248390",
                "sha256": "307d9c9f98de341c3f5f0af73ae58017745a13f15de06871f9654178518a1e87"
            },
            "downloads": -1,
            "filename": "simplestatusserver-1.0.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3df0f4e6c7d13ebf6927615b2b248390",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 10500,
            "upload_time": "2024-05-26T17:04:44",
            "upload_time_iso_8601": "2024-05-26T17:04:44.937205Z",
            "url": "https://files.pythonhosted.org/packages/84/76/f80418e0a70b3f061d92df155bd95bd3082e1e0124b15b42453e7d4208e8/simplestatusserver-1.0.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f37c565829d63158ff37763fd6a9ebc8ee5358b358064f8dd662242f46823129",
                "md5": "90ecdf3aa88d48745463133b68161363",
                "sha256": "6bc2a829187891ef7e208ea62ae4a2abddbb1e0c9575c08d6edd98e345bc817e"
            },
            "downloads": -1,
            "filename": "simplestatusserver-1.0.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "90ecdf3aa88d48745463133b68161363",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 10636,
            "upload_time": "2024-05-26T17:04:46",
            "upload_time_iso_8601": "2024-05-26T17:04:46.706062Z",
            "url": "https://files.pythonhosted.org/packages/f3/7c/565829d63158ff37763fd6a9ebc8ee5358b358064f8dd662242f46823129/simplestatusserver-1.0.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-26 17:04:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MarkusHammer",
    "github_project": "SimpleStatusServer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "simplestatusserver"
}
        
Elapsed time: 0.24175s