Skip to main content

Parser for .par files produced by ASDASoft

Project description

ASDA tools

Simple Python3 parser for .par files produced by ASDASoft by Delta Electronics. Main purpose of this tool is to help with comparing servo driver configuration backups using 'normal' tools such as vimdiff.

It can also be used as an diff-tool for git, so you will get human-readable git diffs while commiting raw binary .par files to your repository.

Warning

This was tested only on a few files produced by ASDASoft version 5.4.1.0 with ASDA-A2 servo driver. Implementation may be incomplete for other series.

On the other hand, this script tries to work on the safe side - if it produces json output without giving any error, then you can be sure, that it can completely recreate original .par file from this json.

This script was created by examination of few .par files. The script is most probably not complete. If you find that it fails on any .par file produced by ASDASoft, feel free to create new issue and please include that .par file. (You will probably need to zip it before Github will accept it.)

Using as git diff-tool

All the parsing is located in a single script asda_tools/asdapar2json.py and it has no special dependency. So you can copy it to your repository. (Let's assume, it will be in the same place as in this repository, inside asda_tools directory.)

Then you need to asociate .par files with new difftool by creating a .gitattributes with content:

*.par diff=asdapar2json

And lastly, you need to enable this script in every clone of your repository.

That is security measure -- script will be run automatically by git in the background. It might be better idea to have script somewhere outside of the repository and update it manually. Otherwise mallicious version can be run by git when you switch to branch from untrusted source!

But it should be safe in case of your private repository.

In that case, just add:

[diff "asdapar2json"]
	textconv = `git rev-parse --show-toplevel`/asda_tools/asdapar2json.py

to the file .git/config.

If you are brave enough to run my version, you can test it on this repository :)

Just clone it, edit the .git/config and run:

git log -p test/test_files/test_01_pr.par

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

asda_tools-0.0.2.tar.gz (45.9 kB view details)

Uploaded Source

Built Distribution

asda_tools-0.0.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file asda_tools-0.0.2.tar.gz.

File metadata

  • Download URL: asda_tools-0.0.2.tar.gz
  • Upload date:
  • Size: 45.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for asda_tools-0.0.2.tar.gz
Algorithm Hash digest
SHA256 38f4ff3d49c86a9558e12a40ea0ef36f4a389c7a07e2640a22c1847affdd753a
MD5 a34f3b4547d8a82d2c620d80e6a678a4
BLAKE2b-256 bd161cf88df0ffb027bf0c7f5bde1b5341f092976adc0e1e94865f684ffb3fdf

See more details on using hashes here.

File details

Details for the file asda_tools-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: asda_tools-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for asda_tools-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3537c8374e5959f89f329a1b23b0692d94d22d18ea402e7d8157b18012479841
MD5 6974682da9a032eae0b6494d7f4e4eae
BLAKE2b-256 ddaac9676c989cf56eece6677a795c8a986c6d94909c0b191d3fda89552af9d5

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