Package: fastgcf
fastgcfUnlock the full potential of Google Cloud Functions with FastAPI and async capabilitiesAre you bored with using Flask for your Google Cloud Functions and you are looking for a powerful entry point with request validation and async code? The package is designed for just that, providing seamless integration with FastAPI and async code.Key HighlightsEasily register a single entry point for your Google Cloud Function.Leverage FastAPI for robust request handling and request validation.Harness the power of async code for responsive and scalable functions.Define your function's input parameters with ease.Use it just as you would use your FastAPI route function.Forget about Flask.Example Usage# Import necessary modulesimportasynciofromdatetimeimportdatefromfastgcfimportrouter# Simply use a decorator@router.get()asyncdefmain(start_date:date,end_date:date):awaitasyncio.sleep(1)# Simulate async processingreturn{"start_date":start_date,"end_date":end_date}# That's it! Your Google Cloud Function is ready to handle and validate async GET requests seamlessly.InstallationYou can installfastgcfusing pip:pipinstallfastgcfLinksFastAPI: The official FastAPI documentation for in-depth information on FastAPI usage and features.Flask: Flask documentation for reference on Flask web framework.AcknowledgmentsThis package is an experimental attempt to mimic FastAPI behavior within Google Cloud Functions. While it provides key features such as request validation, async support, file uploads, streaming responses, and many more, please be aware of the following:Performance Variability: The package may not offer the same level of performance as a dedicated ASGI server. Performance, especially when handling large files, may not be optimal due to the nature of the proxy used under the hood to proxy Flask requests to FastAPI app.Experimental Nature:fastgcfshould be considered experimental. It was tested in basic use cases, including method and request validation, file uploads, streaming responses, and async support.Limitations: Whilefastgcfmay be a great Flask replacement in context of Google Cloud Functions, be aware that certain FastAPI features or behaviors may vary when used withfastgcf. It is recommended to thoroughly test and evaluate your use case to ensure compatibility.By usingfastgcf, you can benefit from FastAPI's features in the context of Google Cloud Functions, but it's essential to keep these considerations in mind when designing your functions.ContributionContributions from the community are welcomed! If you'd like to contribute tofastgcf, here are a few ways you can get involved:Report Issues: If you encounter any bugs or issues, pleaseopen an issueon my GitHub repository.Submit Pull Requests: If you have improvements or new features to suggest, feel free tosubmit a pull requestwith your changes.Share Feedback: I value feedback on your experience usingfastgcf. Let me know how I can make it better by opening an issue or starting a discussion.Documentation: Help improve the documentation by suggesting edits or additions.Spread the Word: If you findfastgcfuseful, consider sharing it with others in your community or network.By contributing tofastgcf, you can help make it even more powerful and useful for others. I appreciate your support and collaboration!