Fast API templates

Multi Product Landing Page with Navigation

This app will create a simple multi product landing page with updated Bootstrap styles, incl. a grid of 6 product cards with random content, and a navigation bar using FastAPI.

816
Fast API endpoint for Text Classification using GPT 4

This API will classify incoming text items into categories using the GPT 4 model. If the model is unsure about the category of a text item, it will respond with an empty string. The categories are parameters that the API endpoint accepts. The GPT 4 model will classify the items on its own with a prompt like this: "Classify the following item {item} into one of these categories {categories}". There is no maximum number of categories a text item can belong to in the multiple categories classification. The API will use the llm_prompt ability to ask the LLM to classify the item and respond with the category. The API will take the LLM's response as is and will not handle situations where the model identifies multiple categories for a text item in the single category classification. If the model is unsure about the category of a text item in the multiple categories classification, it will respond with an empty string for that item. The API will use Python's concurrent.futures module to parallelize the classification of text items. The API will handle timeouts and exceptions by leaving the items unclassified. The API will parse the LLM's response for the multiple categories classification and match it to the list of categories provided in the API parameters. The API will convert the LLM's response and the categories to lowercase before matching them. The API will split the LLM's response on both ':' and ',' to remove the "Category" word from the response. The temperature of the GPT model is set to a minimal value to make the output more deterministic. The API will return all matching categories for a text item in the multiple categories classification. The API will strip any leading or trailing whitespace from the categories in the LLM's response before matching them to the list of categories provided in the API parameters. The API will accept lists as answers from the LLM. If the LLM responds with a string that's formatted like a list, the API will parse it and match it to the list of categories provided in the API parameters.

284
Create Stripe Checkout Session with API

<p>This application serves as an API server that incorporates functionalities. It includes an endpoint that allows you to create a Stripe checkout session, for payment processing. Additionally it provides another endpoint to retrieve the status of a checkout session. The application allows for origin resource sharing (CORS) and generates logs with information level details regarding sent requests.</p><p>‍</p>

54
Stripe Webhook Test Sender

This app will send and test the mock webhook received from the Stripe API. Stripe Webhook test will print the data on the console.

209
Create Stripe Payment Intent with API

This app template will create and retrieve a payment intent on Stripe using API. It requires the Stripe API key to be set as an environment variable named 'STRIPE_API_KEY'. The template provides a POST endpoint at '/create_payment_intent' to create a payment intent and a GET endpoint at '/retrieve_payment_intent/{payment_intent_id}' to retrieve a payment intent.

94
Fast API Endpoint for Automatic Tweet Posting in Twitter

This app is a fast API endpoint that will automatically post a tweet provided via the API to a company's Twitter account. Can be used in your product to promote certain things happening, for example a product community member does something and you tweet automatically about it. Ideal for automatic tweets posting for company updates. Steps: 1. Sign up for a developer account on https://developer.twitter.com/ (you have to log in with the company's Twitter handle) 2. There's a free option (even though they are pushing the $100 per month basic option you don't need that to get started and for small volumes) 3. Navigate to projects and apps 4. From the consumer keys section copy the API key and Secret into Env Secrets tab in Lazy (make sure variable names are correct) 5. Generate an Access Token and Secret and copy them into Env Secrets tab in Lazy (make sure variable names are correct) THESE MUST HAVE READ AND WRITE ACCESS OTHERWISE IT WON'T WORK 6. Generate a bearer token and add to env secrets 7. Use the Fast API docs page to test app and try to post using the API endpoint or make a sample request directly. 8. Check your Twitter for the post appearing and voila!

64
How to implement Stripe into Wordpress

This app integrates a custom Stripe payment page in WordPress. It includes both a backend and a frontend. The backend service is set up using FastAPI and is compatible with any price point established through the Stripe API. The backend service creates a Stripe checkout session and retrieves the status of a checkout session. It also allows all CORS and logs sent requests and checkout session statuses. The price ID is fetched during the request from the user. After adding the Stripe API key and directing the backend service to the price ID, the backend service can be activated by clicking the test button. The frontend code can be integrated into a WordPress page to create a custom payment page in WordPress. This method can be used to set up various types of payment pages in WordPress, including one-time payments and subscriptions. The required environment secrets for this app are STRIPE_SECRET_KEY and YOUR_DOMAIN.

55
How to Implement Stripe Payment Gateway into Wordpress

This template integrates a custom Stripe payment gateway in WordPress. It includes both a backend and a frontend. The backend service is set up using FastAPI and is compatible with any price point established through the Stripe API. The backend service creates a Stripe checkout session and retrieves the status of a checkout session. It also allows all CORS and logs sent requests and checkout session statuses. The price ID is fetched during the request from the user. After adding the Stripe API key and directing the backend service to the price ID, the backend service can be activated by clicking the test button. The frontend code can be integrated into a WordPress page to create a custom payment gateway page with a payment button in WordPress. This method can be used to set up various types of payment pages in WordPress, including one-time payments and subscriptions. The required environment secrets for this app are STRIPE_SECRET_KEY and YOUR_DOMAIN.

30
Implement Custom Stripe Checkout Page in Python & FastAPI

This app integrates a custom Stripe checkout page in a Python application. It includes both a backend and a frontend. The backend service is set up using FastAPI and is compatible with any price point established through the Stripe API. The backend service creates a Stripe checkout session and retrieves the status of a checkout session. It also allows all CORS and logs sent requests and checkout session statuses. The price ID is fetched during the request from the user. After adding the Stripe API key and directing the backend service to the price ID, the backend service can be activated by clicking the test button. The frontend code can be integrated into a Python application to create a custom payment page. This method can be used to set up various types of payment pages, including one-time payments and subscriptions. The required environment secrets for this app are STRIPE_SECRET_KEY and YOUR_DOMAIN.

57

Fast API

FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints. It is designed to be easy to use, efficient, and scalable. FastAPI is built on top of Starlette, which is a lightweight asynchronous web framework.

Some key features of FastAPI include:

  1. High performance: FastAPI is built on top of Starlette, which is an asynchronous web framework. This allows it to handle high loads and process requests quickly.
  2. Easy to use: FastAPI is designed to be easy to use and intuitive. It leverages Python type hints to provide automatic data validation, serialization, and documentation generation.
  3. Fast development: FastAPI provides automatic interactive API documentation based on the OpenAPI standard. This means that as you write your code, the documentation is generated automatically, saving you time and effort.
  4. Standards-based: FastAPI is based on standard Python type hints and the OpenAPI standard. This makes it easy to integrate with other tools and frameworks in the Python ecosystem.
  5. Asynchronous support: FastAPI fully supports asynchronous programming, allowing you to write efficient and scalable code. It also integrates seamlessly with other asynchronous libraries and frameworks.
  6. Security: FastAPI provides built-in security features, such as OAuth2 authentication and JWT token authentication. It also supports automatic generation of API keys and rate limiting.

Overall, FastAPI is a powerful and efficient web framework for building APIs with Python. It combines the ease of use of Python type hints with the performance of asynchronous programming, making it a great choice for building high-performance APIs.