Skip to main content

pycodata: CODATA constants for python.

Project description

Introduction

pycodata is a library providing the latest codata constants (2022) and older values (2018, 2014 and 2010). The raw codata are taken from http://physics.nist.gov/constants. The constants (values and uncertainties) are implemented as dictionnaries.

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.codata_constants_2018.MOLAR_MASS_CONSTANT_2018["value"])
print(f"Mu_2014 = ", pycodata.codata_constants_2014.MOLAR_MASS_CONSTANT_2014["value"])
print(f"Mu_2010 = ", pycodata.codata_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-2.0.0.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

pycodata-2.0.0-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file pycodata-2.0.0.tar.gz.

File metadata

  • Download URL: pycodata-2.0.0.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for pycodata-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5e288c35b07c88f556568556a1356715841c123706d8c91d0fd09e888271fcb9
MD5 1edd23371f99ba2b06854e8756f1f09f
BLAKE2b-256 8e8a8e91305a885ee84056e4c896f9f9967efcb03aec2d8491be6e0436218f2f

See more details on using hashes here.

File details

Details for the file pycodata-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pycodata-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 41.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for pycodata-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02d0f960095e1843c81137acc8f4edb54058837c8bd4e23b1999a4deccd00b25
MD5 9d76f0d022964998245cd01a37d0973d
BLAKE2b-256 7c741f4e7213f20f5c86948675b8c6b9e4c2c44bf47a1b3bcf2e0b8ae885ff16

See more details on using hashes here.

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