Skip to main content

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:

pip install service-response

As module via (git clone):

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

Usage and features

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 file.


Everything ingenious is simple

Metadata

Release files for service-response 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for service-response 0.1.2
File Size Uploaded Provenance Actions
service_response-0.1.2.tar.gz 3.1 kB Without provenance Details for service_response-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for service-response 0.1.2
File Interpreter ABI Platform Actions
service_response-0.1.2-py3-none-any.whl Python 3 none any Details for service_response-0.1.2-py3-none-any.whl

Total release size: 6.4 kB

Release files / service_response-0.1.2.tar.gz

Download URL service_response-0.1.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c9833014176c00b2e61afef1efbe40ab7c8579c3b19a47d141e65c7ce7dfd05e
BLAKE2b-256 checksum
How to use checksums
5381d7e7dc34be2eeb838990aaf86b04496b927132a430bd04d3047eab108c48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / service_response-0.1.2-py3-none-any.whl

Download URL service_response-0.1.2-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1dc70a99cb079b2bfaa6be3a826f27617fc122c062997b06a265018601da5a2
BLAKE2b-256 checksum
How to use checksums
aa4b8448c1aae905ad46e3af1d0ea56c11f803ae0109f126833acb29fd69d947
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Security for service-response 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page