Goblet is an easy-to-use framework that enables developers to quickly spin up fully featured REST APIs with python on GCP

Overview

GOBLET

PyPI PyPI - Python Version Tests codecov

Goblet is a framework for writing serverless rest apis in python in google cloud. It allows you to quickly create and deploy python apis backed by cloudfunctions.

It provides:

  • A command line tool for creating, deploying, and managing your api
  • A decorator based API for integrating with GCP API Gateway, Storage, Cloudfunctions, PubSub, Scheduler, and other GCP services.
  • Local environment for your api endpoints
  • Dynamically generated openapispec
  • Support for multiple stages

You can create Rest APIs:

from goblet import Goblet, jsonify

app = Goblet(function_name="goblet_example")

@app.route('/home')
def home():
    return {"hello": "world"}

@app.route('/home/{id}', methods=["POST"])
def post_example(id: int) -> List[int]:
    return jsonify([id])

Once you've written your code, you just run goblet deploy and Goblet takes care of deploying your app.

$ goblet deploy -l us-central1
...
https://api.uc.gateway.dev

$ curl https://api.uc.gateway.dev/home
{"hello": "world"}

Installation

To install goblet, open an interactive shell and run:

pip install goblet-gcp

Make sure to have the correct services enabled in your gcp project depending on what you want to deploy

api-gateway, cloudfunctions, storage, pubsub, scheduler

You will also need to install gcloud cli for authentication

QuickStart

In this tutorial, you'll use the goblet command line utility to create and deploy a basic REST API. This quickstart uses Python 3.7. You can find the latest versions of python on the Python download page.

To install Goblet, we'll first create and activate a virtual environment in python3.7:

$ python3 --version
Python 3.7.3
$ python3 -m venv venv37
$ . venv37/bin/activate

Next we'll install Goblet using pip:

python3 -m pip install goblet-gcp

You can verify you have goblet installed by running:

$ goblet --help
Usage: goblet [OPTIONS] COMMAND [ARGS]...
...

Credentials

Before you can deploy an application, be sure you have credentials configured. You should run gcloud auth application-default login and sign in to the desired project.

When setting the defaut location note that api-gateway is only available in asia-east1, europe-west1, us-east-1 and us-central1.

Creating Your Project

create your project directory, which should include an main.py and a requirements.txt. Make sure requirements.txt includes goblet-gcp

$ ls -la
drwxr-xr-x   .goblet
-rw-r--r--   main.py
-rw-r--r--   requirements.txt

You can ignore the .goblet directory for now, the two main files we'll focus on is app.py and requirements.txt.

Let's take a look at the main.py file:

from goblet import Goblet

app = Goblet(function_name="goblet_example")

@app.route('/home')
def home():
    return {"hello": "world"}

This app will deploy an api with endpoint /home.

Running Locally

Running your functions locally for testing and debugging is easy to do with goblet. First set a local param in the goblet class

from goblet import Goblet

app = Goblet(function_name="goblet_example", local='test')

Then run goblet local test and replace test with whatever variable you decide to use. Now you can hit your functions endpoint at localhost:8080 with your routes.

Deploying

Let's deploy this app. Make sure you're in the app directory and run goblet deploy making sure to specify the desired location:

$ goblet deploy -l us-central1
INFO:goblet.deployer:zipping function......
INFO:goblet.deployer:uploading function zip to gs......
INFO:goblet.deployer:function code uploaded
INFO:goblet.deployer:creating cloudfunction......
INFO:goblet.deployer:deploying api......
INFO:goblet.deployer:api successfully deployed...
INFO:goblet.deployer:api endpoint is goblet-example-yol8sbt.uc.gateway.dev

You now have an API up and running using API Gateway and cloudfunctions:

$ curl https://goblet-example-yol8sbt.uc.gateway.dev/home
{"hello": "world"}

Try making a change to the returned dictionary from the home() function. You can then redeploy your changes by running golet deploy.

Next Steps

You've now created your first app using goblet. You can make modifications to your main.py file and rerun goblet deploy to redeploy your changes.

At this point, there are several next steps you can take.

Docs - Goblet Documentation

If you're done experimenting with Goblet and you'd like to cleanup, you can use the goblet destroy command making sure to specify the desired location, and Goblet will delete all the resources it created when running the goblet deploy command.

$ goblet destroy -l us-central1
INFO:goblet.deployer:destroying api gateway......
INFO:goblet.deployer:api configs destroying....
INFO:goblet.deployer:apis successfully destroyed......
INFO:goblet.deployer:deleting google cloudfunction......
INFO:goblet.deployer:deleting storage bucket......

Docs

Goblet Documentation

Blog Posts

Building Python Serverless Applications on GCP

Tutorial: Publishing GitHub Findings to Security Command Center

Examples

Goblet Examples

Issues

Please file any issues, bugs or feature requests as an issue on our GitHub page.

Github Action

Goblet Github Action

Roadmap

Integration Tests
Api Gateway Auth
Configuration Options (function names, ...)
Use checksum for updates
☐ Generate Openapi clients
User generated dataclasses for openapi spec
Scheduler trigger
Pub Sub trigger
Cloud Storage trigger
Firestore trigger
Firebase trigger
Cloud Tasks trigger
Cloud Endpoints trigger

Want to Contribute

If you would like to contribute to the library (e.g. by improving the documentation, solving a bug or adding a cool new feature) submit a pull request.

Want to Support

Buy Me A Coffee


Based on chalice

Issues
  • Add optional argument to keep last version of archive + delete archive in Cloud Storage when deleting the function

    Add optional argument to keep last version of archive + delete archive in Cloud Storage when deleting the function

    Hello,

    I noticed that the bucket used to store Cloud Function archives contains all the versions of all cloud functions deployed in the project. The number of objets is quite big after a couple of dev/try/test deployments.

    Feature request :

    • add an optional argument to goblet deploy to delete the previous version of the archive in Cloud Storage
    • add an optional argument to goblet destroy to delete the archive of the function in Cloud Storage

    Thanks !

    proposal 
    opened by amirbtb 8
  • Create multiple cloud scheduler to call the same function

    Create multiple cloud scheduler to call the same function

    Hello,

    I am working on a simple use case : I have a cloud function that accepts a 'URl' parameter, calls that URl (which is a public API endpoint) and saves the data in a JSON file stored in Cloud Storage. I want to be able to set multiple cloud scheduler to call different endpoints on different schedules, but I only need 1 function.

    Question : My guess is that @app.schedule('5 * * * *') creates both a Cloud Scheduler and a Cloud Function. Is there a possibility to only create a (or multiple) Cloud Scheduler and define parameters to use in the call to the Cloud Function ?

    enhancement question 
    opened by amirbtb 7
  • [Secret Manager] Secret Manager Integration

    [Secret Manager] Secret Manager Integration

    A built in integration with Secret Manager to inject secrets into cloudfunctions. Currently the options are to supply env variable, or to write the secret manager logic yourself.

    example config.json

    "secrets": {
      "GH_TOKEN": projects/{project_id}/secrets/GH_TOKEN/versions/2",
      "OTHER_TOKEN"
    }
    

    with default being projects/{project_id}/secrets/{secret_name}/versions/latest

    then in your code you would use config.secrets to access

    from goblet.config import Config
    
    config = Config()
    @app.route("/reveal")
    def reveal_secret():
        return config.secrets.GH_TOKEN
    
    proposal 
    opened by anovis 7
  • [Cloudrun backend] Missing None. Make sure you are in the correct directoty and this file exists

    [Cloudrun backend] Missing None. Make sure you are in the correct directoty and this file exists

    Hi, first of all, thanks for your work ! I use Goblet for cloud functions and it's very simple. But when I try to use cloud run as a backend, I have the error : "Missing None. Make sure you are in the correct directoty and this file exists" while I have a main.py and a dockerfile in the directory.

    Any idea of what can be the issue ? Thanks in advance, Regards

    bug documentation 
    opened by mikaelcoumet 6
  • Allow other files in zip along with *.py files

    Allow other files in zip along with *.py files

    Config parameters are usually stored in .ini or .txt files. Can we allow .ini and .txt files atleast?

    https://github.com/anovis/goblet/blob/61a8ce2e4e1ff8d3967d79437573843f5c88c389/goblet/deploy.py#L157

    enhancement 
    opened by ivmarkp 6
  • `TypeError: main_handler() takes 1 positional argument but 2 were given` with `@app.topic('mytopic')`

    `TypeError: main_handler() takes 1 positional argument but 2 were given` with `@app.topic('mytopic')`

    Hello,

    I created a topic in PubSub called mytopic and I tried to create a function triggered by a message in this topic. The deployment is successful but after I publish a message, I get a TypeError: dbt_handler() takes 1 positional argument but 2 were given. Here is the code of my function and the error traceback :

    Function code

    from goblet import Goblet
    
    app = Goblet(function_name="goblet-pubsub")
    
    
    @app.topic('mytopic')
    def main_handler(data):
        app.log.info(data)
        return 
    

    Error traceback

    2021-11-11T15:20:13.051Z goblet-pubsub-topic-mytopic6gbe9k87mz0j 
    Exception on / [POST] Traceback (most recent call last): 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_app response
        = self.full_dispatch_request() 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1518, in full_dispatch_request 
        rv = self.handle_user_exception(e) 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1516, in full_dispatch_request 
        rv = self.dispatch_request() 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_request 
        return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/functions_framework/__init__.py", line 171, in view_func 
        function(data, context) TypeError: main_handler() takes 1 positional argument but 2 were given
    
    Exception on / [POST] Traceback (most recent call last): 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_app response 
        = self.full_dispatch_request() 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1518, in full_dispatch_request 
        rv = self.handle_user_exception(e) 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1516, in full_dispatch_request 
        rv = self.dispatch_request() 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_request 
        return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) 
    File "/layers/google.python.pip/pip/lib/python3.7/site-packages/functions_framework/__init__.py", line 171, in view_func 
        function(data, context) 
    
    TypeError: main_handler() takes 1 positional argument but 2 were given
    

    What am I supposed to provided to main_handler ?

    Thank you !

    opened by amirbtb 5
  • Remove a scheduler without destroying the cloud function and other schedulers

    Remove a scheduler without destroying the cloud function and other schedulers

    Hello, I have a function decorated with multiples @app.schedule(), thanks to #92. Now I need to remove one of the schedulers without destroying the function and the other schedulers. I tried to remove it and redeploy, it removes the unwanted schedule but redeploys the remaining ones, creating duplicates. Is there a way to solve this issue without destroying all the resources ? Thanks !

    proposal 
    opened by amirbtb 4
  • Use environment variables in `config.json`

    Use environment variables in `config.json`

    Hello

    I start to have a lot of environment variables hard-coded in the config.json ; some are more sensitive than the others 🔒 . Would it be possible to allow the use of environment variable, and interpolate on run time, like the GIT_TOKEN and EXAMPLE_ENV_VAR here :

    {
        "cloudfunction": {
            "runtime":"python37",
            "environmentVariables": {
                "KEY":"$EXAMPLE_ENV_VAR"
            },
            "buildEnvironmentVariables": {
                "GIT_TOKEN":"$GIT_TOKEN"
            },
            "availableMemoryMb": 256,
            "timeout": "30s"
        }
    }
    

    This could be particularly useful for local development, CI/CD and a light solution while waiting for the powerful [Secret Manager] Secret Manager Integration #58.

    question stale 
    opened by amirbtb 4
  • Create multiple cloud functions with 1 goblet project

    Create multiple cloud functions with 1 goblet project

    Hello,

    Is it possible to define multiple cloud functions in the .goblet/config.json ? I plan to create multiple cloud functions using goblet and I don't want to maintain them in separate folders/projects. Thank you in advance.

    question stale 
    opened by amirbtb 4
  • Error when deploying a Cloud Function to a GCP project when Eventarc API isn't enabled

    Error when deploying a Cloud Function to a GCP project when Eventarc API isn't enabled

    Description

    Hello,

    I try to deploy a Cloud Function with a @app.schedule() to a GCP project where the Eventarc API is not enabled (because I don't need to use it). I get this error :

    googleapiclient.errors.HttpError: <HttpError 403 when requesting https://eventarc.googleapis.com/v1/projects/my-awesome-project/locations/europe-north1/triggers?alt=json returned "Eventarc API has not been used in project 538837563781 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/eventarc.googleapis.com/overview?project=538837563781 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems an and retry.". 
    Details: "[{'@type': 'type.googleapis.com/google.rpc.Help', 'links': [{'description': 'Google developers console API activation', 'url': 'https://console.developers.google.com/apis/api/eventarc.googleapis.com/overview?project=538837563781'}]}, {'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'SERVICE_DISABLED', 'domain': 'googleapis.com', 'metadata': {'service': 'eventarc.googleapis.com', 'consumer': 'projects/538837563781'}}]">
    

    Is there still a way to deploy a Cloud Function using goblet without having to enable the Eventarc API ? Thank you !

    Environments details

    • goblet version : 0.7.0
    • Python version : 3.7
    • Docker environment : yes
    bug 
    opened by amirbtb 3
  • Function to render html

    Function to render html

    Hello,

    I would like to render a static HTML file and/or a Jinja Template as a response to a Cloud Function using the @app.route('/') decorator. Is there an easy way to do it ?

    Thanks !

    question stale 
    opened by amirbtb 3
  • [Pubsub] Pass through extra configuration options

    [Pubsub] Pass through extra configuration options

    Allow pass through configurations to pubsub subscriptions.

    @app.topic("TOPIC_ID", config={"enableExactlyOnceDelivery": true})
    def topic_configs(data):
    

    https://cloud.google.com/pubsub/docs/exactly-once-delivery#rest

    enhancement 
    opened by anovis 0
  • [Cloudrun] Allow port and command to be overiden

    [Cloudrun] Allow port and command to be overiden

    Set's default port to 8080 and default command to "functions-framework,--target=goblet_entrypoint". Both can be overriden in config.json (closes #179 )

        {
            "cloudrun":{
                "command": "override command",
                "port": 5000
            }
        }
    
    opened by anovis 0
  • [Cloudrun] ability to override command

    [Cloudrun] ability to override command

    currently cloudrun deployment sets the command with

                "gcloud",
                "run",
                "deploy",
                self.name,
                "--project",
                get_default_project(),
                "--region",
                get_default_location(),
                "--source",
                get_dir(),
                "--command",
                "functions-framework,--target=goblet_entrypoint",
                "--port",
                "8080",
            ]
            
            ```
            
            where the command should be able to be overwritten, or not set at all 
    bug 
    opened by anovis 0
  • [Workflows]

    [Workflows]

    Ability to generate gcp workflow yaml files from code

    @worfklow('name', step=1,...)
    @route('xxxx')
    def route_workflow_step):
    ...
    
    @worfklow('name', step=1,...)
    @route('/xxxx/{input}', method=get)
    def route_workflow_step(inpit):
    ...
    
    

    sample yaml

    - randomgen_function:
        call: http.get
        args:
            url: https://REGION-PROJECT_ID.cloudfunctions.net/randomgen
        result: randomgen_result
    - multiply_function:
        call: http.post
        args:
            url: https://REGION-PROJECT_ID.cloudfunctions.net/multiply
            body:
                input: ${randomgen_result.body.random}
        result: multiply_result
    - log_function:
        call: http.get
        args:
            url: https://api.mathjs.org/v4/
            query:
                expr: ${"log(" + string(multiply_result.body.multiplied) + ")"}
        result: log_result
    - floor_function:
        call: http.post
        args:
            url: CLOUD_RUN_SERVICE_URL
            auth:
                type: OIDC
            body:
                input: ${log_result.body}
        result: floor_result
    - return_result:
        return: ${floor_result}
      
    

    https://cloud.google.com/workflows/docs/run/tutorial-cloud-run

    proposal 
    opened by anovis 1
  • [Cloudrun] Jobs

    [Cloudrun] Jobs

    Support for cloudrun jobs, which is in beta now

    @app.job('NAME', taskNum=1, schedule="*****")
    def x():
    
    @app.job('NAME', taskNum=2)
    def y():
    
    @app.job('NAME')
    def non_schedule():
    
    @app.job('NAME', execute=True)
    def trigger_now():
    

    https://cloud.google.com/run/docs/create-jobs https://cloud.google.com/run/docs/reference/rest/v1/namespaces.jobs

    proposal 
    opened by anovis 2
  • [Terraform] Output gcp resources as terraform

    [Terraform] Output gcp resources as terraform

    Allow Goblet to create terraform package of all GCP resources goblet will deploy.

    goblet package --pkg-format terraform

    similar to chalice terraform support

    proposal 
    opened by anovis 0
Releases(0.7.4)
  • 0.7.4(Jun 9, 2022)

    What's Changed

    • Add gcloud config for cloudrun deployments by @anovis in https://github.com/goblet/goblet/pull/175

    Full Changelog: https://github.com/goblet/goblet/compare/0.7.3...0.7.4

    Source code(tar.gz)
    Source code(zip)
  • 0.7.3(May 31, 2022)

    What's Changed

    • [Openapi] Custom type support by @anovis in https://github.com/goblet/goblet/pull/168
    • Skipping tests folder when deploying function by @piusnig in https://github.com/goblet/goblet/pull/169
    • Bugfix - cloudrun + apigateway missing client by @anovis in https://github.com/goblet/goblet/pull/171
    • Pubsub subscription attributes by @anovis in https://github.com/goblet/goblet/pull/172

    New Contributors

    • @piusnig made their first contribution in https://github.com/goblet/goblet/pull/169

    Full Changelog: https://github.com/goblet/goblet/compare/0.7.2.2...0.7.3

    Source code(tar.gz)
    Source code(zip)
  • 0.7.2.2(May 18, 2022)

    What's Changed

    • Bugfix json error 2 by @anovis in https://github.com/anovis/goblet/pull/167

    Full Changelog: https://github.com/anovis/goblet/compare/0.7.2.1...0.7.2.2

    Source code(tar.gz)
    Source code(zip)
  • 0.7.2.1(May 11, 2022)

    What's Changed

    • Bugfix-json headers, gateway update by @anovis in https://github.com/anovis/goblet/pull/165

    Full Changelog: https://github.com/anovis/goblet/compare/0.7.2...0.7.2.1

    Source code(tar.gz)
    Source code(zip)
  • 0.7.2(May 2, 2022)

    What's Changed

    • Update Requirements, Tests for python 3.10 by @anovis in https://github.com/anovis/goblet/pull/161
    • Bugfix: Add is_json check by @anovis in https://github.com/anovis/goblet/pull/162

    Full Changelog: https://github.com/anovis/goblet/compare/0.7.1...0.7.2

    Source code(tar.gz)
    Source code(zip)
  • 0.7.1(Apr 18, 2022)

    What's Changed

    • [Routes] cloudrun and apigateway route_type option by @anovis in https://github.com/anovis/goblet/pull/153
    • [Sync] Fix resource permission issue by @anovis in https://github.com/anovis/goblet/pull/157
    • [Docs] Test scheduler locally by @anovis in https://github.com/anovis/goblet/pull/158

    Full Changelog: https://github.com/anovis/goblet/compare/0.7.0...0.7.1

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Apr 1, 2022)

    What's Changed

    • Refactor Clients by @anovis in https://github.com/anovis/goblet/pull/139
    • [Documentation] Secrets Manager Integration by @anovis in https://github.com/anovis/goblet/pull/141
    • Cross project subscription by @anovis in https://github.com/anovis/goblet/pull/142
    • Fix docs related to #143 by @anovis in https://github.com/anovis/goblet/pull/144
    • [Pubsub] Fix subscription update and destroy by @anovis in https://github.com/anovis/goblet/pull/146
    • [Pubsub] Cross subscription correctly triggers by @anovis in https://github.com/anovis/goblet/pull/148
    • [EventArc] New resource by @anovis in https://github.com/anovis/goblet/pull/149

    Full Changelog: https://github.com/anovis/goblet/compare/0.6.3...0.7.0

    Source code(tar.gz)
    Source code(zip)
  • 0.6.3(Feb 22, 2022)

    What's Changed

    • [Goblet] Request Context by @anovis in https://github.com/anovis/goblet/pull/130
    • Add Before and After Middleware handlers by @anovis in https://github.com/anovis/goblet/pull/134

    Full Changelog: https://github.com/anovis/goblet/compare/0.6.1...0.6.3

    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Jan 23, 2022)

    What's Changed

    • add query support for goblet openspec generation by @davidyum in https://github.com/anovis/goblet/pull/126
    • [CLI] Goblet sync by @anovis in https://github.com/anovis/goblet/pull/127

    New Contributors

    • @davidyum made their first contribution in https://github.com/anovis/goblet/pull/126

    Full Changelog: https://github.com/anovis/goblet/compare/0.6.0...0.6.1

    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Jan 12, 2022)

    What's Changed

    • [.github] Add stale.yml config by @anovis in https://github.com/anovis/goblet/pull/106
    • Documentation for service account auth by @anovis in https://github.com/anovis/goblet/pull/114
    • Multi Cloudfunction Support by @anovis in https://github.com/anovis/goblet/pull/116
    • Cloudrun backend by @anovis in https://github.com/anovis/goblet/pull/122
    • Black formatter by @anovis in https://github.com/anovis/goblet/pull/123

    Full Changelog: https://github.com/anovis/goblet/compare/0.5.2...0.6.0

    Source code(tar.gz)
    Source code(zip)
  • 0.5.2(Nov 18, 2021)

    • Add flag --all to destroy cli command to delete all artifacts in cloud storage related to the cloudfunction. goblet destroy --all (closes #98 )
    • Custom storage cloudfunction name
    • Add test and venv directories to be excluded in zip_directory function (closes #104 )
    • Set local default to "local", so default command will be goblet local. (closes #80 )
    Source code(tar.gz)
    Source code(zip)
  • 0.5.1(Nov 12, 2021)

    • add scheduler support for retryConfig , attemptDeadline, name (closes #93 )
    • set entrypoint to goblet_entrypoint instead of app because of #88 (closes #95)
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Nov 2, 2021)

    • multiple schedulers for one entry function (#91)
    @app.schedule('5 * * * *')
    @app.schedule('2 * * * *')
    def scheduled_function()
       app.current_request
       return
    
    • pass through custom scheduler params such as body, headers, httpMethod
    @app.schedule('5 * * * *', httpMethod='POST', headers={'X-Custom': 'header'}, body='BASE64 ENCODED STRING')
    @app.schedule('5 * * * *', httpMethod='GET', headers={'X-Custom': 'header2'}, body='BASE64 ENCODED STRING 2')
    def scheduled_function()
       app.current_request
       return
    
    • adds helper to set entrypoint. add_entrypoint (#88 )
    from goblet import Goblet, jsonify, Response, add_entrypoint
    
    app = Goblet(function_name="goblet-test-issue", local="test")
    add_entrypoint(app)
    
    @app.http()
    def main(request):
        app.log.info("triggered")
        return jsonify(request.json)
    
    Source code(tar.gz)
    Source code(zip)
  • 0.4.10.1(Sep 29, 2021)

  • 0.4.10(Sep 28, 2021)

    • Adding ability to add security definition at the method level
    @app.route('/method_security', security=[{"your_custom_auth_id": []}])
    def method_security():
        return
    
      • config-from-json-string
    goblet deploy --project PROJECT -l LOCATION --config-from-json-string '{"cloudfunction": {"serviceAccount": "[email protected]"}}'
    
    • Local logger fix
    • Bugfix for a GCP breaking change with generateUploadUr
    Source code(tar.gz)
    Source code(zip)
  • 0.4.9(Jul 19, 2021)

    • Ability to configure apiSpec using config.json, which included gatewayServiceAccount (closes #71)
        {
            "apiConfig": {
                "gatewayServiceAccount": "projects/-/serviceAccounts/[email protected]",
                "labels": {
                    "label1" : "value1"
                }
            }
        }  
    
    • Add security section to openApispec based on securityDefinitions or security field in config.json (closes #72 )

    • Cors can be set on the route level or on the Goblet application level. Setting cors=True uses the default cors setting. (closes #60 )

    app=goblet("example",cors=True)
    

    or

        @app.route('/custom_backend', cors=True)
        def home():
            return "cors headers"
    

    results in these headers

        headers : {
            "Access-Control-Allow-Headers" : ['Content-Type', 'Authorization'],
            "Access-Control-Allow-Origin": "*"
        }
    

    Use the CORSConfig class to set customized cors headers from the goblet.resources.routes class.

        from goblet.resources.routes import CORSConfig
        @app.route('/custom_cors', cors=CORSConfig(allow_origin='localhost'))
        def custom_cors():
            return jsonify('localhost is allowed')
    
    Source code(tar.gz)
    Source code(zip)
  • 0.4.8(Jun 4, 2021)

  • 0.4.7(May 20, 2021)

    • Improve get_event_type so don't need to add headers for local testing (closes #49 )
    • Skips deployment if no changes detected (closes #27 )
    • Docstrings
    Source code(tar.gz)
    Source code(zip)
  • 0.4.6(May 12, 2021)

    • iam bindings
    {
        "bindings": [
            {
                "role": "roles/cloudfunctions.invoker",
                "members": [
                "allUsers"
                ]
            }
        ]
    }
    
    • goblet init command
    • minor doc fixes
    Source code(tar.gz)
    Source code(zip)
  • 0.4.5(May 6, 2021)

  • 0.4.3(Apr 14, 2021)

  • 0.4.2(Apr 14, 2021)

  • 0.4.1(Mar 31, 2021)

  • 0.4.0(Mar 8, 2021)

    • PubSub support (#21 )
    @app.topic('test')
    def topic(data):
        app.log.info(data)
        return 
    
    • python 3.8 testing
    • can set default project using gcloud
    • reorganized documentation
    • a few minor bug fixes
    Source code(tar.gz)
    Source code(zip)
  • 0.3.3(Feb 27, 2021)

    • allow for multiple stages (#20 )
    goblet deploy -s dev
    goblet stage list
    goblet stage create dev
    
    • upgraded endpoints from apigateway v1beta to v1 (#22 )
    • gconfig handles env variables
    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Feb 20, 2021)

    • custom schema types using marshmallow
    • use type hints for openapi params
    • support for splitting routes into multiple files
    • improved logging for scheduler deployment (#18 )
    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Feb 12, 2021)

  • 0.3.0(Feb 9, 2021)

  • 0.2.6(Jan 5, 2021)

  • 0.2.5(Dec 30, 2020)

Fully featured framework for fast, easy and documented API development with Flask

Flask RestPlus IMPORTANT NOTICE: This project has been forked to Flask-RESTX and will be maintained by by the python-restx organization. Flask-RESTPlu

Axel H. 2.5k Feb 17, 2021
The no-nonsense, minimalist REST and app backend framework for Python developers, with a focus on reliability, correctness, and performance at scale.

The Falcon Web Framework Falcon is a reliable, high-performance Python web framework for building large-scale app backends and microservices. It encou

Falconry 8.8k Jun 25, 2022
Embrace the APIs of the future. Hug aims to make developing APIs as simple as possible, but no simpler.

Read Latest Documentation - Browse GitHub Code Repository hug aims to make developing Python driven APIs as simple as possible, but no simpler. As a r

Hug API Framework 6.6k Jun 30, 2022
Pyrin is an application framework built on top of Flask micro-framework to make life easier for developers who want to develop an enterprise application using Flask

Pyrin A rich, fast, performant and easy to use application framework to build apps using Flask on top of it. Pyrin is an application framework built o

Mohamad Nobakht 10 Jan 25, 2022
Containers And REST APIs Workshop

Containers & REST APIs Workshop Containers vs Virtual Machines Ferramentas Podman: https://podman.io/ Docker: https://www.docker.com/ IBM CLI: https:/

Vanderlei Munhoz 8 Dec 16, 2021
Flask Sugar is a web framework for building APIs with Flask, Pydantic and Python 3.6+ type hints.

Flask Sugar is a web framework for building APIs with Flask, Pydantic and Python 3.6+ type hints. check parameters and generate API documents automatically. Flask Sugar是一个基于flask,pyddantic,类型注解的API框架, 可以检查参数并自动生成API文档

null 163 Jun 16, 2022
Chisel is a light-weight Python WSGI application framework built for creating well-documented, schema-validated JSON web APIs

chisel Chisel is a light-weight Python WSGI application framework built for creating well-documented, schema-validated JSON web APIs. Here are its fea

Craig Hobbs 2 Dec 2, 2021
An easy-to-use high-performance asynchronous web framework.

An easy-to-use high-performance asynchronous web framework.

Aber 259 May 16, 2022
An easy-to-use high-performance asynchronous web framework.

中文 | English 一个易用的高性能异步 web 框架。 Index.py 文档 Index.py 实现了 ASGI3 接口,并使用 Radix Tree 进行路由查找。是最快的 Python web 框架之一。一切特性都服务于快速开发高性能的 Web 服务。 大量正确的类型注释 灵活且高效的

Index.py 259 May 16, 2022
Endpoints is a lightweight REST api framework written in python and used in multiple production systems that handle millions of requests daily.

Endpoints Quickest API builder in the West! Endpoints is a lightweight REST api framework written in python and used in multiple production systems th

Jay Marcyes 30 Mar 5, 2022
REST API framework designed for human beings

Eve Eve is an open source Python REST API framework designed for human beings. It allows to effortlessly build and deploy highly customizable, fully f

eve 6.5k Jun 24, 2022
REST API framework designed for human beings

Eve Eve is an open source Python REST API framework designed for human beings. It allows to effortlessly build and deploy highly customizable, fully f

eve 6.3k Feb 17, 2021
Django Ninja - Fast Django REST Framework

Django Ninja is a web framework for building APIs with Django and Python 3.6+ type hints.

Vitaliy Kucheryaviy 3.1k Jul 1, 2022
An alternative serializer implementation for REST framework written in cython built for speed.

drf-turbo An alternative serializer implementation for REST framework written in cython built for speed. Free software: MIT license Documentation: htt

Mng 73 Jun 13, 2022
A Python package to easily create APIs in Python.

API_Easy An Python Package for easily create APIs in Python pip install easy-api-builder Requiremnets: <= python 3.6 Required modules --> Flask Docume

Envyre-Coding 2 Jan 4, 2022
Web APIs for Django. 🎸

Django REST framework Awesome web-browsable Web APIs. Full documentation for the project is available at https://www.django-rest-framework.org/. Fundi

Encode 23.7k Jul 4, 2022
NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.

NO LONGER MAINTAINED This repository is no longer maintained due to lack of time. You might check out the fork https://github.com/mrevutskyi/flask-res

null 1k Jun 15, 2022
NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.

NO LONGER MAINTAINED This repository is no longer maintained due to lack of time. You might check out the fork https://github.com/mrevutskyi/flask-res

null 1k Jan 15, 2021
Web3.py plugin for using Flashbots' bundle APIs

This library works by injecting a new module in the Web3.py instance, which allows submitting "bundles" of transactions directly to miners. This is done by also creating a middleware which captures calls to eth_sendBundle and eth_callBundle, and sends them to an RPC endpoint which you have specified, which corresponds to mev-geth.

Georgios Konstantopoulos 233 Jun 23, 2022