Pyerg
Pyerg is a C++ library with a Python wrapper for reading the ERG files produced by IPG CarMaker program. The library implements the specifications of the ERG file format described in the IPG CarMaker reference manual.
Henesis s.r.l. is not affiliated with IPG, the developer of CarMaker program.
Requisites
Python library
- Linux, Windows (tested within Anaconda)
- Python >=3.7
- Numpy >= 1.14
- GCC >= 4.7
C++ library
- CMake
- Google test library (optional, for building the C++ library)
Install Python extension
Run python setup.py install to install the pyerg module.
Build C++ library
Create a build directory in the current folder and from that directory run:
cmake ..
And then
make
The default behavior is to build a static (erg_s) and a shared (erg) version of the Erg parser library.
CMake options:
BUILD_PYTHON_MODULEenable the building of thepyergPython module. When building the Python module using CMake, please check that theNUMPY_INCLUDE_DIRin thepyerg/CMakeLists.txtcontains the right path to the Numpy headers.BUILD_TESTSenable the building test program for the C++ library. Data for testing is not included.
Use:
cmake .. -DBUILD_PYTHON_MODULE=ON -DBUILD_TESTS=ON
To build the C++ library, the Python pyerg module and the C++ tests.
Examples of use
C++
#include <erg.h>
...
erg::Reader parser;
// Read all erg format
parser.open("my_file.erg");
// Allocate the destination memory using vector<byte> as container
std::vector<std::vector<uint8_t>> data(parser.numQuanities());
for(int i=0; i<data.size(); ++i)
data[i].assign(parser.quantitySize(i), 0);
// Create a vector of pointer to the allocated memory to
// store the data
std::vector<uint8_t*> dataPtrList;
std::vector<size_t> dataPtrListSize;
for(std::vector<uint8_t>& v: data)
{
dataPtrList.push_back(v.data());
dataPtrListSize.push_back(v.size());
}
size_t numRows = parser.readAll(dataPtrList, dataWrapperSize);
// data is a vector of vector<byte> with all the quantities from
// the erg file.
Python
import pyerg
parser = pyerg.Reader()
parser.open("my_file.erg")
data = parser.readAll()
# data is a dict of numpy.ndarray with all the quantities from
# the erg file.
See the test applications for more usage examples.
Release files for pyerg 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyerg-0.6.1.tar.gz | 24.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyerg-0.6.1-cp37-cp37m-win_amd64.whl | CPython 3.7 | CPython 3.7 pymalloc | Windows x86-64 | Details |
Total release size: 24.3 MB
Release files / pyerg-0.6.1.tar.gz
| Download URL | pyerg-0.6.1.tar.gz |
|---|---|
| Size | 24.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c0d4d5ae0589d1356a0c6631af9f1401e8a5255efe83276964df6f56d682b36
|
|
BLAKE2b-256 checksum How to use checksums |
0e09a66b1cb24a86162d2858402e2b76bd1afd18ba078c8788da2fd7b457a5fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / pyerg-0.6.1-cp37-cp37m-win_amd64.whl
| Download URL | pyerg-0.6.1-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 38.7 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cdb612bf53c51dc79b912a4c546d64926c2a0e2b6731d19f792513ad81e35b8d
|
|
BLAKE2b-256 checksum How to use checksums |
98389bc41ea0d02b047a3eb76ecdc05ba468c33e160018bc29c62351d6569c81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|