Skip to main content

Helper layer for apis development with Python and Flask

Project description

Zurck'z

ZPy Cloud Utils, Layer for build microservices


ZPy Flask Core

Zurck'z Py Flask Micro Services Core

This package contains some helpers features for build python microservices using Flask framework

ZPy use the following packages:

  • boto3
  • ibm-sdk
  • gcloud

Requirements

  • Python 3.6+

Installation

Use the package manager pip to install py flask micro service core .

pip install boto3
pip install zpy

Features

Contains some helper features with specific integrations.

  • Api
    • Api Builder
    • Response Builder
    • Models
    • Hooks
    • Middlewares
    • Exceptions
    • Repositories
      • Only oracle repository implementation for functions calling.
  • Cloud Implementations
    • AWS Services
      • S3
      • SSM
      • Firehose
      • SQS
  • Custom
    • Plugings
  • Database
    • Only Oracle implementation
      • Functions executor
  • Logger
    • Stream
  • Utils
    • Collections
    • Cipher
    • Functions
    • gzip

Basic Usage

Define restful resource

from zpy.api.resource import ZResource, HTTP_METHODS


class UserResource(ZResource):

  def __init__(self, **kwargs) -> None:
    super().__init__()
    # Receive any dependency by keywords arguments

  def get(self):
    l, i = super().new_operation()
    try:
      return self.success({"user": {"name": "Zurckz"}}, logger=l)
    except Exception as e:
      return self.handle_exceptions(e, l, i)

Setup api

# Define api
@api(base='/v1', config=config)
def create_api():
  # Set all supported resource for this web service.
  return
  [
    ZResource('/', UserResource)
  ]

Local Dev Deploy

from api import create_api

app = create_api()

# 🚨 Only use it in local tests 💻
if __name__ == "__main__":
  app.run(host="localhost", debug=True)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Authors

Noé Cruz

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

zpy-cloud-utils-1.1.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

zpy_cloud_utils-1.1.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file zpy-cloud-utils-1.1.2.tar.gz.

File metadata

  • Download URL: zpy-cloud-utils-1.1.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5

File hashes

Hashes for zpy-cloud-utils-1.1.2.tar.gz
Algorithm Hash digest
SHA256 94b23ee90de7d12c19ba249f1f967db7d571e9fc13de322ddb137f01b1073c8d
MD5 018e8db6a2259e5e5ec527bb44df6267
BLAKE2b-256 3d24ef3aa5f7ddddb65e6f7fbecb33d8f7bce0ad1968affa971f954a053f4825

See more details on using hashes here.

File details

Details for the file zpy_cloud_utils-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: zpy_cloud_utils-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5

File hashes

Hashes for zpy_cloud_utils-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ca0a456f606244f7311ffcf32e1fc61467f518337e56e2b3072332957e851515
MD5 6981878b1c9c24cb976cc384306b0eda
BLAKE2b-256 ada6393edda4d3822ba90b05a459e1587e3dd6bdf3bac926fca3122d1e886faf

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