Skip to main content

A library for managing git repositories in a directory.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

service_response-0.1.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

service_response-0.1.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file service_response-0.1.2.tar.gz.

File metadata

  • Download URL: service_response-0.1.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for service_response-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c9833014176c00b2e61afef1efbe40ab7c8579c3b19a47d141e65c7ce7dfd05e
MD5 ce14ce7e9bc66e29e83a829428c87a41
BLAKE2b-256 5381d7e7dc34be2eeb838990aaf86b04496b927132a430bd04d3047eab108c48

See more details on using hashes here.

File details

Details for the file service_response-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for service_response-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f1dc70a99cb079b2bfaa6be3a826f27617fc122c062997b06a265018601da5a2
MD5 a6d461475b4ba7a39d28c22f86286651
BLAKE2b-256 aa4b8448c1aae905ad46e3af1d0ea56c11f803ae0109f126833acb29fd69d947

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page