The Clausius Clapeyron relationship defines the maximum amount of water vapor a gas can hold at a given temperature (i.e. the vapor pressure at 100% relative humidity). There are many different forms and derivations for the Clausius Clapeyron relationship depending on the application. But the most common differential form for meteorological and climatological applications is as follows:

where ps is the saturation vapor pressure, T is the temperature, Rv is a gas constant, Lv(T) is a temperature dependent specific latent heat of evaporation. Because of the temperature dependence of the latent heat term, this differential equation is non-linear and does not have an exact solution. However, there is a close numerical approximate solution, known as the August-Roche-Magnus formula that is presented here.

where e is the natural number 2.718 and temperature is given in degrees Celsius. This equation roughly translates to a rule of thumb that for every degree C of warming, the atmosphere can hold about 5-6% more water vapor. This is illustrated by the diagram below.

The code below takes as inputs a given water vapor pressure and temperature and returns the saturation vapor pressure, the relative humidity of the input conditions and the dewpoint temperature of the given vapor pressure.
R script
#This script provides a formulation of the Clausius Clapeyron equation and a
#calculation of the relative humidity for a given temp and vapor pressure. The
#full Clausius-Clapeyron equation has a non-linear temperature dependent latent
#heat term that complicates matters. But this formulation is an approximation
#known as the August-Roche-Magnus formula.
#observed vapor pressure (vp) in hPa and temperature (deg C)
vp <- c(15, 20)
T <- c(30, 33)
#saturation vapor pressure from CC equation
svp <- 6.1094*exp((17.625*T)/(T+243.04))
print(paste('svp',svp))
#relative humidity
RH <- 100*vp/svp
print(paste('RH',RH))
#dew point temperature for stated vp
Tdew <- (243.04*log(vp/6.1094))/(17.625-log(vp/6.1094))
print(paste('Tdew',Tdew))
Python script
# This script provides a formulation of the Clausius Clapeyron equation and a
# calculation of the relative humidity for a given temp and vapor pressure.
# The full Clausius-Clapeyron equation has a non-linear temperature dependent
# latent heat term that complicates matters. But this formulation is an
# approximation known as the August-Roche-Magnus formula. You can run this
# experiment with a vector of vapor pressure values or temperatures, but either
# vapor pressure or temperature should have only one value.
import numpy as np
import math
#observed vapor pressure vp (in hPa) and temperature T (in deg C).
vp = [15, 20, 25]
print(vp)
T = [30]
#saturation vapor pressure from CC equation
svp = 6.1094*math.e**((np.multiply(17.625,T))/(np.add(T,243.04)))
print('svp',svp)
#relative humidity
RH = np.divide((np.multiply(vp,100)),svp)
print('RH',RH)
#dew point temperature for stated vp
Tdew = (243.04*np.log(np.divide(vp,6.1094)))/(17.625-np.log(np.divide(vp,6.1094)))
print('Tdew',Tdew)
Matlab script
%This script provides a formulation of the Clausius Clapeyron equation and a
%calculation of the relative humidity for a given temp and vapor pressure.
%The full Clausius-Clapeyron equation has a non-linear temperature
%dependent latent heat term that complicates matters. But this formulation
%is an approximation known as the August-Roche-Magnus formula.
%observed vapor pressure (in hPA) and temperature (in C)
vp = 15;
T = 30;
%saturation vapor pressure (svp) from CC equation
svp = 6.1094*exp((17.625*T)/(T+243.04))
%relative humidity
RH = 100*vp/svp
%dew point temperature for stated vp
Tdew = (243.04*log(vp/6.1094))/(17.625-log(vp/6.1094))