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.3.0.tar.gz (2.2 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.3.0-cp314-cp314t-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.14tWindows x86-64

pycodata-2.3.0-cp314-cp314t-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.34+ x86-64manylinux: glibc 2.35+ x86-64

pycodata-2.3.0-cp314-cp314t-macosx_13_0_universal2.whl (1.9 MB view details)

Uploaded CPython 3.14tmacOS 13.0+ universal2 (ARM64, x86-64)

pycodata-2.3.0-cp313-cp313-win_amd64.whl (981.5 kB view details)

Uploaded CPython 3.13Windows x86-64

pycodata-2.3.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.3.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.3.0-cp312-cp312-win_amd64.whl (981.5 kB view details)

Uploaded CPython 3.12Windows x86-64

pycodata-2.3.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.3.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.3.0-cp311-cp311-win_amd64.whl (994.7 kB view details)

Uploaded CPython 3.11Windows x86-64

pycodata-2.3.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.3.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.3.0-cp310-cp310-win_amd64.whl (994.7 kB view details)

Uploaded CPython 3.10Windows x86-64

pycodata-2.3.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.3.0-cp310-cp310-macosx_13_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

File details

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

File metadata

  • Download URL: pycodata-2.3.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pycodata-2.3.0.tar.gz
Algorithm Hash digest
SHA256 f22ecc90e0204557050a95f4ddc8010441f2bf182f7558c16f7329eb784012e1
MD5 c3616391af7a7ae01b0d6c30f464a8af
BLAKE2b-256 9f0bd3520848380a3aa2b0c356e42fc99f949d52a5e61076938b52329f8a85ec

See more details on using hashes here.

File details

Details for the file pycodata-2.3.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: pycodata-2.3.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pycodata-2.3.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 7287dcbc1e5f37a40d28b5c2b5a784f3fc83d7060aa11fe5ecdaca8adcc03bdf
MD5 c64d2f316f1389d4a70f45de555a58f9
BLAKE2b-256 c0b79db20c6b1480341dd1dfc9d01ecf3f0550f9d92fb1f0e6bf54c3e6b09917

See more details on using hashes here.

File details

Details for the file pycodata-2.3.0-cp314-cp314t-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pycodata-2.3.0-cp314-cp314t-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 5df458c78b99f5eceeddfd038a32bee76fc821f712fa55a5bf0755e58112e081
MD5 effe4e41b13c626f9bcd467ba3d58ac7
BLAKE2b-256 6915e100082084bff16025591f4c3babc989aae504b1c80b321f5321f8135d20

See more details on using hashes here.

File details

Details for the file pycodata-2.3.0-cp314-cp314t-macosx_13_0_universal2.whl.

File metadata

File hashes

Hashes for pycodata-2.3.0-cp314-cp314t-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 d579fe180def66ee5cdbe6f2630d5530d14782ed2599fc4017d2a07d9132876b
MD5 2eccaa993a6932ffcadfa8bd8b07bece
BLAKE2b-256 d280e9a2fb1cc6d776f56b03d3e1041224f6f5da1c33e86fdded1d8d46cc3fc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodata-2.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 981.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pycodata-2.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8af7399465d4e8f6a5da4aadfa5b4bf33744bd0237046bc09253cb2a61249b98
MD5 ab07232db3115ba156bba3589f64e945
BLAKE2b-256 ab5ada78142ec71b896cb5e4d8060d2b799a19daff0f7e863a1188ca3e2e984e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycodata-2.3.0-cp313-cp313-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 966672cf5f55e31318a8a0194d6e09b6eb5e557227c0961e3b3ef2aed0664200
MD5 147a88382aaa9aceae33e5da00b972c7
BLAKE2b-256 a7d2dd282aea98316a25783ff7d988c6cc61c6bad53181a028540f1821efe30e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycodata-2.3.0-cp313-cp313-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 55f15589dc87556fd1d393b1da05127f82de4739cf60f2093e25d3b5ca1ce02e
MD5 0c6eb6550a5ad0be75e8048485fab033
BLAKE2b-256 7825b5c23b2d6a13715af7a1753e2686bad67a2f3ba5ec4e0f168484a41c0029

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodata-2.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 981.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pycodata-2.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 055595972541b39e3043df91ea87909d9dd24296fdf36edebbf80c0c93a47ee6
MD5 83688e4e1e2a7751d91b3a5979fc53e7
BLAKE2b-256 1452ec86e154da5891ada703299392277780f6b7bb9eb8874314ccc5af3eb217

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycodata-2.3.0-cp312-cp312-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 890f55697eecfeec0f1aa2efa8816be3f32bdbacb7459698fecf9f8a8db5e4a7
MD5 ca6111fe521069e299e725c6ed0c5925
BLAKE2b-256 051fa7ede1f1d533522755a2cc5012acf3c58672e22011b13e3991587885d14e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycodata-2.3.0-cp312-cp312-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 2a9188fb373704bfdc43c30663ce5c0a3578cbb7b1b84bdef631610bf33c01ef
MD5 36e5da48d2624115060a3ed60b476502
BLAKE2b-256 65bb173d40184bbefcc2e1c20f20ecac0cf0e3182cac16b581d9d6f9dc53193d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodata-2.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 994.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pycodata-2.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6026c15d683641eb76ba698ad964f2f9a044af191bcd9644c06893c6aeeaaecc
MD5 5342e8d94b7ab04439a89740fd1a4c15
BLAKE2b-256 45bde5a99b17076ab3f002e88f49ca6a4dce3c21a271ec03492025c45afb2818

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycodata-2.3.0-cp311-cp311-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 67e0898f9cafc88abc25e98ab6577c7d0a2d6efb2b2f6818c6755a3a52350143
MD5 afcf29ba5b11b0db1097f765dbf6b9ba
BLAKE2b-256 5ca4d07a47a8ab7235dc7a90d45e0d1a1d3ae60b5cbf95e2930cdb0613d9638b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycodata-2.3.0-cp311-cp311-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 103539772560724d15c7e2332f2cd2fbd9411b9ac532711254ffa1755c5595c2
MD5 9c04ef851d5e0cd1e2422dfa1b3fe730
BLAKE2b-256 26b1d485909588c88fb635ce80b59c524f5f048e027b0fcf7965eff2686924d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycodata-2.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 994.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pycodata-2.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a31e44f483226ff8c6dae500d570607f4780016b323f4c9d56daa91b6f727683
MD5 64d06f0bd89ec3a655a6b9b665d81f44
BLAKE2b-256 a9916965fa6c517a586ea0927ee0b8b2ce188e5b21819a028a046358f318e3b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycodata-2.3.0-cp310-cp310-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 c9bb929cd0deabdf72d1592359075c75f09deeaffd0ab6a7fbdcf77dd8c4d8a5
MD5 c4c451ed89eeecfc2a7e5e5380fea5ce
BLAKE2b-256 aeff90c777dce658fe7b4e735816c1cd9af658d6e4df5b0339a65af739d92501

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycodata-2.3.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c676dd0bd4a7bd1520a0e4299b92e05e995cf174b182db4eaa2f697d9b342fe7
MD5 f2ec2349805d2f9999d38af2bcff5732
BLAKE2b-256 480aa388a8641544f69554070ecf63d6854231381a6087608aaed2a09ab9ea04

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