New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pymbusparser

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pymbusparser

Python bindings for m-bus-parser written in Rust

  • 0.0.4
  • PyPI
  • Socket score

Maintainers
1

Python bindings

Rust lib aims to be accessible from a Python module. This is done by using the PyO3 crate. See the rust project for more documentation on the Rust side of things on github.

Development

  • pipx install maturin to install maturin globally.
  • maturin develop to build the Rust lib and create a Python module in the current environment.
  • Currently this creates a release in the target directory that is one hierachy up. This is not ideal and will be fixed in the future.
  • after calling the maturin develop command cd one up and pip install target/.. and then run python and from pymbusparser import pymbus to test the module.
  • to test inside REPL run python and then `import p

Publishing

  • maturin publish
  • username = token
  • passwrod = api key from pypi

Usage

pip install pymbusparser

from pymbusparser import m_bus_parse,parse_application_layer

print(m_bus_parse("68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 0A 5E 16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16","table"))

print(m_bus_parse("68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 0A 5E 16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16","json"))

print(m_bus_parse("68 3D 3D 68 08 01 72 00 51 20 02 82 4D 02 04 00 88 00 00 04 07 00 00 00 00 0C 15 03 00 00 00 0B 2E 00 00 00 0B 3B 00 00 00 0A 5A 88 12 0A 5E )16 05 0B 61 23 77 00 02 6C 8C 11 02 27 37 0D 0F 60 00 67 16","yml"))

# note this is not as pretty as the function before, still TODO, currently it just outputs structs of RUST in string
print(parse_application_layer("2f2f0413fce0f5052f2f2f2f2f2f2f2f"))

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc