Upload PDF File Using FAST-API

Upload PDF File Using FAST-API

Tiempo de lectura: < 1 minuto Reading time: < 1 minute Hello, today we are going to see how we can upload a PDF file using FAST-API. The first thing we need to do is install python multipart: install python-multipart Once installed, we need to go to our routes file and import this: import shutil Now we create this Route: @app.post("/_pdf", ... Read more

Install Llama 2, Meta’s Open Source and Commercializable AI that Competes with Chat GPT for Use with Python and Docker (with GPU Access)

Install Llama 2, Meta’s Open Source and Commercializable AI that Competes with Chat GPT for Use with Python and Docker (with GPU Access)

Tiempo de lectura: 3 minutos Reading time: 3 minutes Hello, today we are going to see how we can install and download llama 2, the AI from Meta that competes with chatgpt 3.5. To do this, I have created a Docker Compose that will help us set up the environment. The first thing we need to do is go to … Read more

Install Llama 2, the Meta Open Source and Commercializable AI that competes with Chat GPT for use with Python and Docker (with GPU access)

Install Llama 2, the Meta Open Source and Commercializable AI that competes with Chat GPT for use with Python and Docker (with GPU access)

Tiempo de lectura: 3 minutos Hello, today we will see how we can install and download llama 2, the Meta AI that competes with chatgpt 3.5. For this, I have created a Docker Compose that will help us set up the environment. The first thing we need to do is go to the llama 2 page and request a version … Read more

Using Pexels API with Python

Using Pexels API with Python

Tiempo de lectura: 4 minutos Reading Time: 2 minutes Hello, today we are going to learn how to use the Pexels API to retrieve images directly using Python. The first thing we need to do is obtain a free Pexels API key. Go to the API website: https://www.pexels.com/api/ First, sign in: Now go to your profile and navigate to Image … Read more

Fetching WordPress Categories with Python API

Fetching WordPress Categories with Python API

Tiempo de lectura: 3 minutos Reading time: < 1 minute Today we are going to learn how to fetch categories from the WordPress API. Let’s create a python file named code.py with the following content: import os from dotenv import load_dotenv import requests import json import random from requests.auth import HTTPBasicAuth def fetch_categories(): load_dotenv() WORDPRESS_USERNAME = os.getenv("WORDPRESS_USERNAME") WORDPRESS_PASSWORD = os.getenv("WORDPRESS_PASSWORD") ... Read more

Auto-publishing posts on WordPress using Python

Auto-publishing posts on WordPress using Python

Tiempo de lectura: 2 minutos Reading time: 2 minutes Today we are going to learn how we can auto-publish posts on our WordPress using Python. The first thing we need to do is create our remote_publish.py file. def post_publisher(wpBaseURL, postStatus): WP_url = wpBaseURL + “/wp-json/wp/v2/posts” auth = HTTPBasicAuth(WORDPRESS_USERNAME, WORDPRESS_PASSWORD) headers = { “Accept”: “application/json”, “Content-Type”: “application/json” } payload = json.dumps({ … Read more

Create a Rest API using FAST API (example without database connection)

Create a Rest API using FAST API (example without database connection)

Tiempo de lectura: 2 minutos Reading time: 3 minutes In this tutorial, I will show you how to create a REST API using FastAPI. FastAPI is a modern and fast web framework for building APIs with Python 3.6+ based on the ASGI standard and with the philosophy of “less code, more productivity.” Additionally, FastAPI provides interactive and user-friendly automatic documentation, … Read more

Send email using FAST API with fastapi_mail

Send email using FAST API with fastapi_mail

Tiempo de lectura: 2 minutos Reading time: 2 minutes In this tutorial, I will show you how to send emails using FastAPI and fastapi_mail. FastAPI is a modern and fast web framework for building APIs with Python 3.6+ based on the ASGI standard and with the philosophy of “less code, more productivity.” On the other hand, fastapi_mail is a FastAPI … Read more

Return HTML with FAST API

Return HTML with FAST API

Tiempo de lectura: < 1 minuto Reading time: < 1 minute Hello, today I’m going to show you how to return an HTML after calling an endpoint in FastAPI, the Python REST API: The first thing is to import this dependency: from fastapi.responses import HTMLResponse Once imported, we’re going to create a “get” function that, when called by the URL in … Read more

Flutter- structure call API -GET

Flutter- structure call API -GET

Tiempo de lectura: < 1 minuto Reading Time: < 1 minute The structure to make an API call and retrieve data in Flutter is as follows: First, declare and initialize a variable with the API endpoint, in this case, I’ll call it `uri`: final uri = ‘https://example.com/api’; Next, declare the headers, specifically the `Content-Type`: final headers = { ‘Content-Type’: ‘application/json’, }; … Read more