Skip to main content

No project description provided

Project description

Gitpod Ready-to-Code

License: GPL v3 CPP17 CI Coverage

CDFpp (CDF++)

A NASA's CDF modern C++ library. This is not a C++ wrapper but a full C++ implementation. Why? CDF files are still used for space physics missions but few implementations are available. The main one is NASA's C implementation available here but it lacks multi-threads support, has an old C interface and has a license which isn't compatible with most Linux distributions policy. There are also Java and Python implementations which are not usable in C++.

List of features and roadmap:

  • read uncompressed file headers
  • read uncompressed attributes
  • read uncompressed variables
  • read variable attributes
  • loads cdf files from memory (std::vector or char*)
  • handles both row and column major files
  • read variables with nested VXRs
  • read compressed file (GZip, RLE)
  • read compressed variables (GZip, RLE)
  • write uncompressed headers
  • write uncompressed attributes
  • write uncompressed variables
  • write compressed attributes
  • write compressed file variables
  • handle leap seconds
  • Python wrappers
  • Documentation
  • Examples
  • Benchmarks

If you want to understand how it works, how to use the code or what works, you may have to read tests.

Installing

From PyPi

pip3 install --user pycdfpp

From sources

meson build
cd build
ninja
sudo ninja install

Basic usage

Python

from pycdfpp import pycdfpp
cdf = pycdfpp.load("some_cdf.cdf")
cdf_var_data = cdf["var_name"].values #builds a numpy view or a list of strings
attribute_name_first_value = cdf.attributes['attribute_name'][0]

C++

#include "cdf-io/cdf-io.hpp"
#include <iostream>

std::ostream& operator<<(std::ostream& os, const cdf::Variable::shape_t& shape)
{
    os << "(";
    for (auto i = 0; i < static_cast<int>(std::size(shape)) - 1; i++)
        os << shape[i] << ',';
    if (std::size(shape) >= 1)
        os << shape[std::size(shape) - 1];
    os << ")";
    return os;
}

int main(int argc, char** argv)
{
    auto path = std::string(DATA_PATH) + "/a_cdf.cdf";
    // cdf::io::load returns a optional<CDF>
    if (const auto my_cdf = cdf::io::load(path); my_cdf)
    {
        std::cout << "Attribute list:" << std::endl;
        for (const auto& [name, attribute] : my_cdf->attributes)
        {
            std::cout << "\t" << name << std::endl;
        }
        std::cout << "Variable list:" << std::endl;
        for (const auto& [name, variable] : my_cdf->variables)
        {
            std::cout << "\t" << name << " shape:" << variable.shape() << std::endl;
        }
        return 0;
    }
    return -1;
}

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pycdfpp-0.2.0-cp310-cp310-win_amd64.whl (900.7 kB view details)

Uploaded CPython 3.10 Windows x86-64

pycdfpp-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (421.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pycdfpp-0.2.0-cp310-cp310-macosx_10_15_x86_64.whl (355.9 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pycdfpp-0.2.0-cp39-cp39-win_amd64.whl (902.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

pycdfpp-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (420.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pycdfpp-0.2.0-cp39-cp39-macosx_10_15_x86_64.whl (355.8 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pycdfpp-0.2.0-cp38-cp38-win_amd64.whl (900.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

pycdfpp-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (420.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pycdfpp-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl (355.7 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

pycdfpp-0.2.0-cp37-cp37m-win_amd64.whl (901.2 kB view details)

Uploaded CPython 3.7m Windows x86-64

pycdfpp-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (421.2 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pycdfpp-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl (357.5 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

Details for the file pycdfpp-0.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 900.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pycdfpp-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7ea46a09a62437ec6cdec7710685141e6e923c5e0e887de02332ab8cb9856866
MD5 ccc0dcd77b734b69e37dd34cec4c3330
BLAKE2b-256 e8cf71b7f095957487dd32df92243f8ca8007cffb8e37836846468d7d9c37aae

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 421.0 kB
  • Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pycdfpp-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b17c171609e39881aea9b61690d8ed9e6bb3f708d54d78c1314ce350a3aa5377
MD5 0d659d7a45ab0b46044a95e08b1b473f
BLAKE2b-256 33e4bccf087bcfe27d3ba14d1f7d83bf8bd2f0fb60a0215b1bb94a31d6da4927

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp310-cp310-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 355.9 kB
  • Tags: CPython 3.10, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for pycdfpp-0.2.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3ceb8cb7d5ce1a07cebaf832cc1ebe6020e5453e12da6d20fccb3502909bfc99
MD5 4a7f428b1875dca29f32b2c13952ae7c
BLAKE2b-256 29928b4652917a3d1dc3077680ecdafb73e2fbd798a6dc23c4741bad52f67ded

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 902.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pycdfpp-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b5fe761b6db90cbdc7198a6fcaa29aceee00905a283b7c7531306012a97a4825
MD5 6141128c16295956ec3dce79cf8ddcc1
BLAKE2b-256 d54b59d26f0d477bf0abcacd07f0586f09ae71902a1bb79dbac244bbbc975e94

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 420.5 kB
  • Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pycdfpp-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 415e99aff05d9c4758e22ce3b48862487cf1e830cc0f530f5427c8a1e17c757c
MD5 606f4fa86254be17d2b2beddc2d69c68
BLAKE2b-256 705ad9a72b5ebacee3f227ca032c47c44292a0d0a5fbd53f0cc61251464e6800

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 355.8 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for pycdfpp-0.2.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f6e67597b623af7e791606dfa03d0ab43e97a83833458141a7966d2e4b5c4a0c
MD5 fbd453910ad7211cda20f4bdf1335314
BLAKE2b-256 c35af2279b1e4af3a0c0056c18bed4118738fb80a81b00a5329e2814839d93b7

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 900.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for pycdfpp-0.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f8117d9adc9b09e448b13c5eac06aee3094fd32c6da96070964112d1802be7a0
MD5 47f2e25aa3197b744ccadb3b276a7ae2
BLAKE2b-256 d0468695b71e0b45775ac94adc8d7d210aa245b45a16ff3c50e14987dea19c98

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 420.0 kB
  • Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pycdfpp-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f18d252d2c3b9b98f15a08fac9e8e6b14f8dd8f54d11e3110fd895903c8baf96
MD5 00d9c69576014300d66fec38c5d1d2ee
BLAKE2b-256 75606f8aadd0210132441121b6e68a6bbecf9a8e53b6d15ca760027f99612231

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 355.7 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for pycdfpp-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4aa618caebd4d37581bb84e543475df137eadb47e697bad647821487c6418625
MD5 c16c380c58ba0943644aacec2ee605e8
BLAKE2b-256 5c8a685aec6927918814e39805f8c49d9bccac3c29afd7ba244526c082da2bcc

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 901.2 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

File hashes

Hashes for pycdfpp-0.2.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f04f5a2d49801d6893314d7f39a668ccd59e36540908ca9b68fa32cfd238f620
MD5 e752d389307f87eb84ebf2f5ed97674c
BLAKE2b-256 a7f4dddcbb5bec314d76b059e77233230c24fd1228959aadb6321bdf98458bb3

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 421.2 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for pycdfpp-0.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c37b4dbe943adc7671f0b7e829a6e4e4e549738b526d1c13fe3a1445933b53e7
MD5 2bf539b76e244a123b080c5a41e53906
BLAKE2b-256 40a94f21105a4d6c42feaefc0b2aa742d828b92f655d194c89ee47e0db088ee6

See more details on using hashes here.

File details

Details for the file pycdfpp-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: pycdfpp-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 357.5 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for pycdfpp-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7f323bebe42bc259904936fed1a26822e77d3b46a28c3c75fa4a9076022d0caf
MD5 b4411e16af9488426bca409b6ddb6bf8
BLAKE2b-256 93e9e828065b923a8efac91dda06c4b34d3f592c07e4ec57bbeb845fe0d84c95

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