Skip to main content

PDIC Open Source Love svg1

PDIC: (IDL) Transpiler Source-to-source compiler C/C++ to YAML Portable Data Interface Description

Project related to PDI Linux

GitHub license Build Github Status

PyPI version PyPI implementation

Doc made-with-Markdown

GitHub release Docker

From C/C++ to Yaml Description

Simple binary Python library
static binary Python 3
./pdic file.c import pdic; result:str = pdic.files_to_pdi()

Instalation

Binary

cmake -S . -DBINARY:BOOL=ON -B build && cmake --build build -- -j `nproc`

Google Test

cmake -S . -DTEST:BOOL=ON -B build && cmake --build build -- -j `nproc`
cd build && ctest

Python

python setup.py build -G "Unix Makefiles"
python3 setup.py bdist_wheel -G "Unix Makefiles" -j `nproc`
python setup.py build_ext  -G "Unix Makefiles" --inplace -j `nproc`
pytest

Usage

#pragma pdi on

typedef struct Var8
{
#pragma pdi type : int64
    int my_int;
    char char_tab[20];
    char my_char;
} var;

#pragma pdi size:[42]
int **array_of_pointer_of_array[21];

var my_var;

#pragma pdi off

Will be see and describe as follow

structs:
 Var8:
  type: record
  name: Var8
  alias: [var]
  fieldsize: 3
  buffersize: 28
  packed: false
  members:
   char_tab: { type: array, subtype: char, size: 20 }
   my_char:
    offset: 24   
    type: char
   my_int:
    type: int64
data:
 array_of_pointer_of_array: { type: array, subtype:  { type: pointer, subtype:  { type: array, subtype: int, size: 42 } }, size: 21 }
 my_var:
  type: record
  name: Var8
  alias: [var]
  fieldsize: 3
  buffersize: 28
  packed: false
  members:
   char_tab: { type: array, subtype: char, size: 20 }
   my_char:
    offset: 24   
    type: char
   my_int:
    type: int64

Python Usage

import os
import pathlib
import yaml
import pdic

here = pathlib.Path(__file__).parent.resolve()
# pip show -f pdic
if __name__ == "__main__":
    pdi_yml_description: str = pdic.files_to_pdi([os.path.join(here, "level_1.c"),
                                                  os.path.join(here, "level_2.c")])
    print(pdi_yml_description)
    print(yaml.dump(yaml.load(pdi_yml_description)))

Index

  1. Abstract
  2. Usage
    1. Binary
    2. Python
  3. Developpement
    • Code
    • Documentation
    • Test
    • Deploy
  4. Links
  5. Extra
    • Clang LLVM
    • Mind Map
    • Graph
    • UML
  6. Contact / Credits

Credits

Barre Kevin neudinger (Software Scientist)

CEA pdi team

Release files for pdic 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pdic 0.0.2
File Interpreter ABI Platform
pdic-0.0.2-cp39-cp39-manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details
pdic-0.0.2-cp39-cp39-manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details

Total release size: 17.8 MB

Release files / pdic-0.0.2-cp39-cp39-manylinux2010_x86_64.whl

Download URL pdic-0.0.2-cp39-cp39-manylinux2010_x86_64.whl
Size 8.9 MB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
b98d3d2e601a0dc3895208639baaa1df32a8047a95852ce61a6234c58bb74750
BLAKE2b-256 checksum
How to use checksums
b1200f8bceff92e0c928a779e7029e5ece4d4e127c7a280570534a5245305020
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / pdic-0.0.2-cp39-cp39-manylinux1_x86_64.whl

Download URL pdic-0.0.2-cp39-cp39-manylinux1_x86_64.whl
Size 8.9 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
c7559c1ba4234ea3eec79c3efc049764621007248077d54e89ef44af422c46f4
BLAKE2b-256 checksum
How to use checksums
bffdd1a16739ddfdba7469caba1b1baa5ab5880b3b3cae544212042995db7b25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page