Skip to main content

cmerg

Python parser for CarMaker ERG files with Pandas DataFrame export.

Use and Examples

Mostly these are notes for myself but hopefully someone else finds them useful.

Installation

This package is published on PyPI under the name cmerg.

Windows

> python -m pip install -U pip
> python -m pip install cmerg

Linux

$ python3 -m pip install -U pip
$ python3 -m pip install cmerg

Examples

Import the package folder.

import cmerg

Create ERG file object. (Using example file from repo)

log1 = cmerg.ERG('test-data/Test-Dataset-1_175937.erg')

Dictionary of the signals in the file.

log1.signals

Save the vehicle speed signal to a variable.

speed = log1.get('Vhcl.v')

Plot signal.

speed.plot()

Add signal to DataFrame.

# New easy call to return a pandas DataFrame.
df = log1.to_pd()
# Simple example of adding ERG data to pandas.
import cmerg
import pandas as pd
import numpy as np

log1 = cmerg.ERG('data-file.erg')

speed = log1.get('Vhcl.v')

t = np.array(speed.timestamps)
spd = np.array(speed.samples)

df = pd.DataFrame({'time': t, 'speed': spd})

Export ERG file to CarMaker compliant csv (e.g. for import using Import from File)

log1 = cmerg.ERG('data-file.erg')
log1.export_cm_csv("./target.csv")

# it's also possible to export only quantities that matches a namespace:
log1.export_cm_csv("./target.csv", columns_filter=["Car_"])

# CM's Import from File cannot handle many digits well, therefore the exported values are rounded. The number of digits can be sepcified:
log1.export_cm_csv("./target.csv", columns_filter=["Car_"], digits=5)

Metadata

Release files for cmerg 0.4

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

Source distribution (sdist)

Source distribution for cmerg 0.4
File Size Uploaded Provenance
cmerg-0.4.tar.gz 24.2 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cmerg 0.4
File Interpreter ABI Platform
cmerg-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 MB

Release files / cmerg-0.4.tar.gz

Download URL cmerg-0.4.tar.gz
Size 24.2 MB
Tags Source
SHA-256 checksum
How to use checksums
e2d04c2bd4f8eeb73d1950797b88ae6b8eb09f0f723c2e32368556983bc965e6
BLAKE2b-256 checksum
How to use checksums
30e3e544fa6e914b2d4e5f1655e84b5de7059cb425bb8aabf093737440bbfbd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / cmerg-0.4-py3-none-any.whl

Download URL cmerg-0.4-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c70295902b7eec6b4282fa6ccc45f0cea2b17d95f9f9bdda421b1e1006e18b6
BLAKE2b-256 checksum
How to use checksums
febc9b87761edc03ce0057a18ab2fca991f588ceeca77dea0319460bffc636b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Security for cmerg 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files No provenance

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