You are here: home python physcon

These data have been updated to the latest CODATA 2010 recommendations

Download a python module physcon.txt that provides the most important physical constants for use in python programs. The program is available under the GPL license; see license note in the module (Change the file extension from .txt to .py; the extension .txt is used because the webserver does not allow the download of .py files).


The physical constants in this module are a selection from the CODATA 2010 recommendations, published on March 15, 2012, in a CODATA report CODATA Recommended Values of the Fundamental Physical Constants 2010 by P.J. Mohr, B.N. Taylor and D.B. Newell (available from the NIST website). They are a result of least-squares fitting using all relevant data up to 31 Dec. 2010. The last recommendations before this one are from 2006; the next are expected to include data up to end 2014. The data can be searched on the NIST website.

The module contains a python dictionary called "all" with the following items:

In addition the following symbols are defined as the SI value (float):
alpha, a_0, c, e, eps_0, F, G, g_e, g_p, gamma_p, h, hbar, k_B m_d, m_e, m_n, m_p, mu_B, mu_e, mu_N, mu_p, mu_0, N_A, R, sigma, u

For example, if the module has been imported as pc, Planck's constant is available as pc.h and Avogadro's number is available as pc.N_A, etc.

>>> import physcon as pc
>>> print(pc.h, pc.N_A)
6.62606957e-034   6.02214129e+023

For details type after importing physcon as pc.

View a list of all physical constants in the dictionary (CODATA 2010).