Package: chemyst
The Chemyst libraryTo install chemyst runpip install chemystUsage For P_total# gas_laws stands for Pressure, Volume, Number of Moles, R is the ideal gas law constant, T is temperaturefromchemyst.gas_lawsimportP_total# Mixture of 3 gases lets saytotal_pressure=P_total([9.987,2.33,123.9])print(total_pressure)# OUTPUT: 136.217Args:pressure is the only argument to P_totalIt is a list of the partial pressure of all the gases in a mixtureUsage For partial_pressurefromchemyst.gas_lawsimportpartial_pressure# Args: num_moles, ideal_gas_law, temp, volume, is_temp_kelvin=TruepressureO2=partial_pressure(2,'atm',31,15.0,False)print(pressureO2)# OUTPUT: 13.2Args:num_of_moles is the number of moles of the given gasideal_gas_law is the ideal gas law constant to use for the given pressure unitif the pressure unit is atmideal_gas_law should be 'atm'if the pressure unit is kpaideal_gas_law should be 'kpa'if the pressure unit is mmHgideal_gas_law should be 'mmhg'temp is the given temperature can be either Celsius or Kelvinvolume is the volume of the containeris_temp_kelvin determines whether the temperature should be converter to Kelvin or notif the temperature is in celsius is_temp_kelvin should equal falseUsage For the conversions modulefromchemyst.conversionsimportmoles_to_mass,mass_to_moles,atoms_to_grams,grams_to_atoms,ml_to_l,l_to_ml# Moles to mass OUTPUT: 512gmoles_to_mass(16,32)# Mass to moles OUTPUT: 16.0mass_to_moles(512,32)# Atoms to grams OUTPUT: 7.18e20atoms_to_grams(1352,32)# Grams to atoms OUTPUT: 1.88e24grams_to_atoms(100,32)# Mililiters to liters OUTPUT: 1 literml_to_l(1000)# Liters to mililiters OUTPUT: 1000mll_to_ml(1)Args:moles_to_mass(num_moles, molar_mass)num_moles is the number of moles to be converted to gramsmolar_mass is the mass of the element in gramsfor example O2 would have a molar mass of 32mass_to_moles(g_of_element, molar_mass)g_of_element is the amount of grams which will be converted to molesmolar_mass is the mass of the element in gramsatoms_to_grams(num_atoms, molar_mass)num_atoms is the number of atoms to be converted to gramsmolar_mass is the mass of the element in gramsgrams_to_atoms(g_of_element, molar_mass)g_of_element is the amount of grams which will be converted to molesmolar_mass is the mass of the element in gramsml_to_l(ml)ml is the number of mililiters to convert into litersl_to_ml(l)l is the number of liters to convert into mililitersUsage for the molar moduleMolar and finding the molesThe molar module gives the Molar amount (M) from the moles and volume of a solutionfromchemyst.molarimportmolar,find_moles# Find the Molar amount of 3 moles of sugar in 5 liters of watermolar(3,5)# OUTPUT: 0.6M# Find the number of moles of sugar with the Volume and Moles of the same siolutionfind_moles(0.6,5)# OUTPUT: 3 Moles SugarUsage For the yields moduleTheoretical yieldThe yields module is slightly different than the othersthe theoretical_yield() function takes 3 arguments:actual_yieldthe yield given in the equationmole_ratio_top which isFrom the balanced equation given, the number of moles of the wanted elementmole_ratio_bottom which likewise isFrom the balanced equation given, the number of moles of the given elementIMPORTANT: the theoretical_yield() function arguments MUST all be molesthis can be easily achieved by using themoles_to_massandmass_to_molesfunctions ofchemyst.conversionsPercent Yieldthe percent yield() function take 2 argumentsactual_yieldyield given in the equationtheoretical_yieldthis yield can be calculated using the theoretical_yield() functionIMPORTANT: the percent_yield() function arguments MUST all be gramsthis can be easily achieved by using themoles_to_massandmass_to_molesfunctions ofchemyst.conversions