Skip to main content

pycodata: CODATA constants for python.

Project description

Introduction

Python wrapper around the Fortran codata library. The Fortran library does not need to be installed, the python wrapper embeds all needed fortran dependencies for Windows and MacOS. On linux, you might have to install libgfortran if it is not distributed with your linux distribution.

Installation

In a terminal, enter:

pip install pycodata

Usage

The latest values (2022) do not have the year as a suffix in their name. Older values can be used and they feature the year as a suffix in their name.

The latest values are available at the top level and older values are available in dedicated modules.

import pycodata

print("########## VERSION ##########")
print(f"version = {pycodata.__version__}")

print("########## constants ##########")
print(f"c =", pycodata.SPEED_OF_LIGHT_IN_VACUUM["value"])

print("########## UNCERTAINTY ##########")
print(f"u(c) = ", pycodata.SPEED_OF_LIGHT_IN_VACUUM["uncertainty"])

print("########## OLDER VALUES ##########")
print(f"Mu_2022 = ", pycodata.MOLAR_MASS_CONSTANT["value"])
print(f"Mu_2018 = ", pycodata.constants_2018.MOLAR_MASS_CONSTANT_2018["value"])
print(f"Mu_2014 = ", pycodata.constants_2014.MOLAR_MASS_CONSTANT_2014["value"])
print(f"Mu_2010 = ", pycodata.constants_2010.MOLAR_MASS_CONSTANT_2010["value"])

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycodata-1.1.0a0.tar.gz (1.6 MB view hashes)

Uploaded Source

Built Distributions

pycodata-1.1.0a0-cp312-cp312-macosx_12_0_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.12 macOS 12.0+ x86-64

pycodata-1.1.0a0-cp311-cp311-macosx_12_0_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.11 macOS 12.0+ x86-64

pycodata-1.1.0a0-cp310-cp310-macosx_12_0_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.10 macOS 12.0+ x86-64

pycodata-1.1.0a0-cp39-cp39-macosx_12_0_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.9 macOS 12.0+ x86-64

pycodata-1.1.0a0-cp38-cp38-macosx_12_0_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.8 macOS 12.0+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page