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 by default with your linux distribution.

Installation

In a terminal, enter:

pip install pycodata

License

MIT

MIT License

Copyright (c) Milan Skocic

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Examples

r"""Example in python."""
import sys
sys.path.insert(0, "../src/")
import pycodata

print("########## EXAMPLE IN PYTHON ##########")
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"])

Changelog

2.1.1

  • No code change.
  • Code refractoring and cleaning
  • Update CI/CD workflows.

Full changelog

2.1.0

  • Roll back to C API in Fortran code: easier maintenance.
  • Roll back to compiled C extension for python: easier maintenance.

Full changelog available at github

2.0.1

  • Fix bug in version for Fortran code.

Full changelog available at github

2.0.0

  • Drop compiled extensions for Python.
  • Pure Python code for constants auto-generated as it is the case for the Fortran code.
  • Pure C code for constants auto-generated as it is the case for the Fortran code.
  • API break:
    • No more C API in the Fortran code.
    • Use the pure C code to build a C library.

Full changelog available at github

1.2.2

  • Fix conflict that could occur with C API modules. Add prefix in module names.
  • Cleanup and refractoring.
  • Documentation update.

1.2.1

  • Refractoring
  • Merge back C API and python wrapper.

Full changelog available at github

1.2.0

  • Refractoring
  • Documentation update.

Full changelog available at github

1.1.0

  • C API and Python wrapper moved to their own repositories.
  • API break: C API is no more provided by default. Use the optional C wrapper.
  • Code cleanup
  • Documentation update

Full changelog available at github

1.0.0

  • Add codata values for 2010, 2014 and 2018.
  • Code refractoring and code cleaning.
  • Documentation update and switch to only FORD documentation.
  • Rewrite code generators in python.
  • Generate source code for stdlib.
  • API break: constants are defined as DT like in stdlib.

Full changelog available at github

Python wrapper available at pypi.

0.10.0

  • Remove remove generation of the version module.
  • Add tests using the test-drive framework.
  • Explicit parameter constants for Fortran and protected constants for C API.
  • Minor fixes in documentation.
  • Code cleanup.
  • Merge of all code for autogeneration in one file.

Full changelog available at github

Python wrapper available at pypi.

0.9.0

  • No API changes.
  • Automatic generation of the version module.
  • Generic Makefiles for automatic the building process of the library and the pywrapper.
  • Add targets: build, build_debug, test, test_debug.
  • Minor fixes in documentation.

Full changelog available at github

Python wrapper available at pypi.

0.8.2

  • No API changes.
  • Improve Makefile for generating the source code at each compilation.
  • Source generator rewritten in Fortran.
  • Switch to pyproject.toml for the Python wrapper.
  • Minor fixes in documentation.

Full changelog available at github

Python wrapper available at pypi.

0.8.1

  • Use shared library in python wrapper.
  • Minor fixes in documentation.

Full changelog available at github

Python wrapper available at pypi.

0.8.0

  • Back to the approach with a library.
  • Compatible with fpm.
  • Configuration file for setting all the environmental variables.
  • Global makefile for building a static library (through fpm) and a shared library.
  • Automatic copy of the necessary sources for the python wrapper.
  • Python wrapper built with the static library
    • no dependency on a shared library.
    • sources and static library embeded in the python wrapper.
  • FORD for documenting the Fortran code.
  • Integration of the FORD documentation into the main documentation with sphinx.

Full changelog available at github

Python wrapper available at pypi.

0.7.1

  • Minor fixes in generator code
  • Add automatic copy of c sources for the python wrapper.

Full changelog available at github

Python wrapper available at pypi.

0.7.0

  • Migrate documentation from doxygen to sphinx+breathe.
  • Add YEAR constant indicating the year of the codata constants.
  • Refractoring

Full changelog available at github

Python wrapper available at pypi.

0.6.0

  • Created documentation.
  • Fixed missing uncertainties for Cpython.

Full changelog available at github

Python wrapper available at pypi.

0.5.0

  • Changed the complete approach by not generating a library but only source files for different languages.
  • Available languages: Fortran, C, python, CPython

Full changelog available at github

Python wrapper available at pypi.

0.4.0

  • Bring back pywrapper in the codata repository to sync versions.
  • Improvements of the documentation.

Full changelog available at github

Python wrapper available at pypi.

0.3.0

  • Only last codata constants.

Full changelog available at github

Python wrapper available at pypi.

0.2.1

  • Integration of Intel Fortran compiler and MSVC in cmake scripts.
  • Add specifications and instructions for compiling on Windows

Full changelog available at github

Python wrapper available at pypi.

0.2.0

  • Bug fixes for the codata 2010.
  • Bug fixes in the tests linked to the codata 2010.
  • Add python wrapper for the number of constants method.

Full changelog available at github

Python wrapper available at pypi.

0.1.0

Implementation of:

  • the parser of the codata raw data
  • the generator of the Fortran modules
  • the C API and C header
  • the python wrapper (will be moved to its repository next release).

Full changelog available at github

Python wrapper available at pypi.

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.2.0.tar.gz (2.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pycodata-2.2.0-cp313-cp313-win_amd64.whl (977.5 kB view details)

Uploaded CPython 3.13Windows x86-64

pycodata-2.2.0-cp313-cp313-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64manylinux: glibc 2.35+ x86-64

pycodata-2.2.0-cp313-cp313-macosx_13_0_universal2.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 13.0+ universal2 (ARM64, x86-64)

pycodata-2.2.0-cp312-cp312-win_amd64.whl (977.4 kB view details)

Uploaded CPython 3.12Windows x86-64

pycodata-2.2.0-cp312-cp312-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64manylinux: glibc 2.35+ x86-64

pycodata-2.2.0-cp312-cp312-macosx_13_0_universal2.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ universal2 (ARM64, x86-64)

pycodata-2.2.0-cp311-cp311-win_amd64.whl (990.6 kB view details)

Uploaded CPython 3.11Windows x86-64

pycodata-2.2.0-cp311-cp311-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64manylinux: glibc 2.35+ x86-64

pycodata-2.2.0-cp311-cp311-macosx_13_0_universal2.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 13.0+ universal2 (ARM64, x86-64)

pycodata-2.2.0-cp310-cp310-win_amd64.whl (990.6 kB view details)

Uploaded CPython 3.10Windows x86-64

pycodata-2.2.0-cp310-cp310-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64manylinux: glibc 2.35+ x86-64

pycodata-2.2.0-cp310-cp310-macosx_13_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

pycodata-2.2.0-cp39-cp39-win_amd64.whl (990.6 kB view details)

Uploaded CPython 3.9Windows x86-64

pycodata-2.2.0-cp39-cp39-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64manylinux: glibc 2.35+ x86-64

pycodata-2.2.0-cp39-cp39-macosx_13_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

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

File metadata

  • Download URL: pycodata-2.2.0.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pycodata-2.2.0.tar.gz
Algorithm Hash digest
SHA256 7993a6c6aba3a18bdb555763d4633d5d03a4dba390ce8a59e122f0cb93bc1521
MD5 5c4d4c10aec665016d4ec7555cf06b45
BLAKE2b-256 3d5b6959ba7a343f1915965a901428733c3280a27b806786883de11b3f613c3a

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pycodata-2.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 977.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pycodata-2.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2c8fe6e708a10d6cb049455a1897304671ea4c80c716f1128ef3245f1db0ee31
MD5 0712f423751da8b2f3c044710e574d83
BLAKE2b-256 ab4fd4932492fe01aaf6befc26fd035aa40f747c38d926cf48983d867082f1d9

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp313-cp313-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp313-cp313-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 7e2496115c6664ad8f400579cd8e99d592501548550e9d3fccf3988655be6266
MD5 226f685c3ea11b11280eb75958bcd568
BLAKE2b-256 820781a2d902507798ea247faf1f8b7e1341ddef3bfc64bc9ac78a3886ddc6d8

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp313-cp313-macosx_13_0_universal2.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp313-cp313-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 ffa2cc11a126cb3566948490db69f3c076f3b18897631f40ffa070c4355da2ef
MD5 75d827eb8c6dace3ba822307c19bf577
BLAKE2b-256 5200beed7feb2b8164420f54f4d84ae47f6ac1d225af5cad789d3a7aa76b5bfe

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pycodata-2.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 977.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pycodata-2.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d7f9b1fcdfa7b73d08b8b32b93037a6cad215855013d38ff23c620146be113a5
MD5 000100905e074b9ff1ab1a1e93a41bc8
BLAKE2b-256 a26adae4a91ebbf98a61c6590b175b653d08418bc94de54ed40563c781552e46

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp312-cp312-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp312-cp312-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 ee203285275e25221fcc8f1e1564d9b73da51f6ed0f7d0d8a2359d530e7be9df
MD5 b22d401f58804ecff4317a5afa4f745d
BLAKE2b-256 ad109b425385832c7acefd9faebf3a8d7269e3a9ee46da9206f98638a9ae0e20

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp312-cp312-macosx_13_0_universal2.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp312-cp312-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 f9542a184f12be08c3e3052c39b99c4ee9c9625bbf3f56d58ff330a285cedf83
MD5 edff44bc470be47a1bf06a65b9665dac
BLAKE2b-256 bec7b026fbd6eb8ae7624120d6f93f23ef9087d60818032890ffc88b3efdca9f

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pycodata-2.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 990.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pycodata-2.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a7caccb3c9982bc9343bf4ac285e82bce95f97fe68e4b579ebdf2280148ce1f8
MD5 8ed69805d5061c55a9544f9e249a37a1
BLAKE2b-256 10e51de33e8847ee432309f776e12d627e7020d859202e456c566be10b8caf9b

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp311-cp311-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp311-cp311-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 8c0eb20157ec4ea1f1eb41567d18142a3ef2bf80cb67982c1b58a069db26fadf
MD5 e77934451c03b902103aaca269ea9388
BLAKE2b-256 8995777ed106e8df6f9ffc7e7a3b109d3ec5faac577d3a56f7d079e7e424e0fb

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp311-cp311-macosx_13_0_universal2.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp311-cp311-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 2f82c3f349702d841f11caeb15b6a3d607b05614727e0639b529601a14438c2a
MD5 bfd64bf45ae82a3ab4f8b85b123a83bb
BLAKE2b-256 21a415d4187385267f0b648847eee601ec08e068a353a93421b4878133f2e42c

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pycodata-2.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 990.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pycodata-2.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 60c074348ff5313c6a48aa056ec75b09544fdd5da8a5ee718812760f5aa84fb1
MD5 69a4cef4cb8b6019c36a3f3b9fc353ff
BLAKE2b-256 25d02f04873d98228c1b86c84c883cd6f66b161f5a31d2573316d6a3da934174

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp310-cp310-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp310-cp310-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 03601f4b8589fdc42e7bf16fdfa55765941c385ab4f96cc3da470dbfea17800a
MD5 bfe63d6786981bc8b10891abcba1c62d
BLAKE2b-256 f84a923bc187c1964ac7d7f38a465bbf29a8a021d5d0d1e1b3e24667511d5aee

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8962e30eabc7c7bbb21cc76348cc0b565689224379f8ace25d691c3fc33504dd
MD5 1e1a01a253eea79a2ecd4184ab68545c
BLAKE2b-256 55b7fd22f3c74445b2647e36a7a5e566b760c0b9d559b5a457b2578ce2085b56

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pycodata-2.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 990.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pycodata-2.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 6dcca9a708ef87bec44d47247308712706a56e320d973be42bd4d6dcd6da2400
MD5 489175e4a51d4d256e9e2e1ac7461648
BLAKE2b-256 5ae7357a9206668f61c6a3fab33321b4503a90e6befd7f503dcf84bb45e7a6e0

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp39-cp39-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp39-cp39-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 9c832f1674c2e214637d845f89b3d8b57300689e0f0f09420263b1ee14e36f63
MD5 9daa89dac782fc75ec2c1d1d8a4c3b57
BLAKE2b-256 e592a10326c93c239138df1c197908381ee1248e5a6f5176c063776d614e61dd

See more details on using hashes here.

File details

Details for the file pycodata-2.2.0-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for pycodata-2.2.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 725f98b17502fd53bd79d134a24c17ac9f9e1587d79c704d02f700257926b181
MD5 f7599999144c2da27d3c4a2744f7c029
BLAKE2b-256 62300411125626b4c31dfd12a74c4671aec8c45db05c882e0d034b37bdc2516b

See more details on using hashes here.

Supported by

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