Skip to main content

Helper layer for apis development with Python and Flask

Project description

Zurck'z

ZPy Flask MSC, Layer for build microservices


ZPy Flask MSC

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:

  • pycryptodome
  • Flask
  • marshmallow
  • cx-Oracle

Requirements

  • Python 3.6+
  • Boto 3+
  • Oracle Client

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-flask-msc-0.0.1.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

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

zpy_flask_msc-0.0.1-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file zpy-flask-msc-0.0.1.tar.gz.

File metadata

  • Download URL: zpy-flask-msc-0.0.1.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.5

File hashes

Hashes for zpy-flask-msc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7f15a64c003a2d5d12f453dde3af9bff3980c4af51cffae41722f903a2df26e8
MD5 a4d5c6964234a14701acc7ee2ae71147
BLAKE2b-256 081d285c00140c028373d52878e752087e1c68e20898fd232fd23aa748368f6a

See more details on using hashes here.

File details

Details for the file zpy_flask_msc-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: zpy_flask_msc-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.5

File hashes

Hashes for zpy_flask_msc-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 95ca81295c2e6588bd2c3689e03fb9cab17c43d328c11b18c5bf90cb2fecdc24
MD5 93e3a5333e595e96e60a6ea473eaccff
BLAKE2b-256 f29b7ca77c3d4537752b56bedbc00559713e09ae6c0879e72168b956719342b6

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