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

Create a Neural Network to Classify Movie Reviews as Positive or Negative

Create a Neural Network to Classify Movie Reviews as Positive or Negative

Tiempo de lectura: 3 minutos Reading Time: 3 minutes Today, I’m going to show you how to create a Neural Network applied to Artificial Intelligence (AI) that can classify movie reviews as positive or negative. Step 1: Prepare the Data First, we need to obtain the data to train our neural network. In this case, we will use the IMDB … Read more

Create a Deep Learning Model (Neural Network) to Predict the Outcome of Regional Elections Using Fictional Data

Create a Deep Learning Model (Neural Network) to Predict the Outcome of Regional Elections Using Fictional Data

Tiempo de lectura: 2 minutos Reading Time: 3 minutes In this example, we are going to build a deep learning model using TensorFlow to predict the outcome of regional elections based on candidates’ social media data. We will use a fictional database that consists of the following fields: Age: candidate’s age Gender: candidate’s gender (0 for male, 1 for female) … Read more

Creating a TensorFlow Neural Network that can Recognize Handwritten Digits

Creating a TensorFlow Neural Network that can Recognize Handwritten Digits

Tiempo de lectura: 4 minutos Reading time: 5 minutes Step 1: Install TensorFlow The first thing you need to do is install TensorFlow. You can do this by following the instructions on the TensorFlow website: https://www.tensorflow.org/install/. If you want to install it in Docker:  docker pull tensorflow/tensorflow:latest  # Download latest stable image docker run -it -p 8888:8888 tensorflow/tensorflow:latest-jupyter  # Start Jupyter … Read more

Creating a Neural Network for Classifying Clothing Images into Different Categories using AI with TensorFlow

Creating a Neural Network for Classifying Clothing Images into Different Categories using AI with TensorFlow

Tiempo de lectura: 3 minutos Reading time: 3 minutes In this tutorial, I will show you how to create a sample neural network using TensorFlow and a public dataset. For this example, we will create a neural network that can classify images of clothing into different categories. Before we get started, you’ll need to have TensorFlow installed on your machine. … Read more