service-response


Nameservice-response JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/Armen-Jean-Andreasian/ServiceResponse
SummaryA library for managing git repositories in a directory.
upload_time2025-01-15 01:07:25
maintainerNone
docs_urlNone
authorArmen-Jean Andreasian
requires_python>=3.6
licenseCustom License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Service Response

It's a specialized, convenient and extremely lightweight response sample to use for inter-app communication.
Inspired by `Ruby on Rails`.

---
# Install

As package:

```bash
pip install service-response
```

As module via (git clone):

```shell
git clone https://github.com/Armen-Jean-Andreasian/ServiceResponse # or SSH
```

---

# Usage and features

```python
from service_response import ServiceResponse

a = ServiceResponse(status=False, error="Some Error")
b = ServiceResponse(status=True, data={1: 2, 3: "content"})

for i in a, b:
    if i:  # checking status
        print(i.data)  # getting data
    else:
        print(i.error)  # getting error msg
```

Params:

- status: `bool` | The status of transaction
- data: `Any` (Optional) | The payload to return
- error: `str` (Optional) | The error content

Features:

- `__bool__` : you can use `if ServiceResponse()` which will return `bool` depending on the `status`

---
# License

Read the [LICENSE](LICENSE) file.

---
_Everything ingenious is simple_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Armen-Jean-Andreasian/ServiceResponse",
    "name": "service-response",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Armen-Jean Andreasian",
    "author_email": "armen_andreasian@proton.me",
    "download_url": "https://files.pythonhosted.org/packages/53/81/d7e7dc34be2eeb838990aaf86b04496b927132a430bd04d3047eab108c48/service_response-0.1.2.tar.gz",
    "platform": null,
    "description": "# Service Response\n\nIt's a specialized, convenient and extremely lightweight response sample to use for inter-app communication.\nInspired by `Ruby on Rails`.\n\n---\n# Install\n\nAs package:\n\n```bash\npip install service-response\n```\n\nAs module via (git clone):\n\n```shell\ngit clone https://github.com/Armen-Jean-Andreasian/ServiceResponse # or SSH\n```\n\n---\n\n# Usage and features\n\n```python\nfrom service_response import ServiceResponse\n\na = ServiceResponse(status=False, error=\"Some Error\")\nb = ServiceResponse(status=True, data={1: 2, 3: \"content\"})\n\nfor i in a, b:\n    if i:  # checking status\n        print(i.data)  # getting data\n    else:\n        print(i.error)  # getting error msg\n```\n\nParams:\n\n- status: `bool` | The status of transaction\n- data: `Any` (Optional) | The payload to return\n- error: `str` (Optional) | The error content\n\nFeatures:\n\n- `__bool__` : you can use `if ServiceResponse()` which will return `bool` depending on the `status`\n\n---\n# License\n\nRead the [LICENSE](LICENSE) file.\n\n---\n_Everything ingenious is simple_\n",
    "bugtrack_url": null,
    "license": "Custom License",
    "summary": "A library for managing git repositories in a directory.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/Armen-Jean-Andreasian/ServiceResponse"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa4b8448c1aae905ad46e3af1d0ea56c11f803ae0109f126833acb29fd69d947",
                "md5": "a6d461475b4ba7a39d28c22f86286651",
                "sha256": "f1dc70a99cb079b2bfaa6be3a826f27617fc122c062997b06a265018601da5a2"
            },
            "downloads": -1,
            "filename": "service_response-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a6d461475b4ba7a39d28c22f86286651",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 3316,
            "upload_time": "2025-01-15T01:07:24",
            "upload_time_iso_8601": "2025-01-15T01:07:24.044630Z",
            "url": "https://files.pythonhosted.org/packages/aa/4b/8448c1aae905ad46e3af1d0ea56c11f803ae0109f126833acb29fd69d947/service_response-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5381d7e7dc34be2eeb838990aaf86b04496b927132a430bd04d3047eab108c48",
                "md5": "ce14ce7e9bc66e29e83a829428c87a41",
                "sha256": "c9833014176c00b2e61afef1efbe40ab7c8579c3b19a47d141e65c7ce7dfd05e"
            },
            "downloads": -1,
            "filename": "service_response-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ce14ce7e9bc66e29e83a829428c87a41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3073,
            "upload_time": "2025-01-15T01:07:25",
            "upload_time_iso_8601": "2025-01-15T01:07:25.346629Z",
            "url": "https://files.pythonhosted.org/packages/53/81/d7e7dc34be2eeb838990aaf86b04496b927132a430bd04d3047eab108c48/service_response-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-15 01:07:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Armen-Jean-Andreasian",
    "github_project": "ServiceResponse",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "service-response"
}
        
Elapsed time: 1.06893s