{"id":27768,"library":"g3hardware","title":"G3 PLC Hardware XML Configuration Generator","description":"Generates XML configuration files for G3 PLC hardware. Current version: 0.2.16. Release cadence: infrequent.","status":"active","version":"0.2.16","language":"python","source_language":"en","source_url":"https://github.com/g3plc/g3hardware","tags":["G3","PLC","XML","configuration","industrial"],"install":[{"cmd":"pip install g3hardware","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"XML processing","package":"lxml","optional":false},{"reason":"Common utilities for G3 PLC projects","package":"g3util","optional":true}],"imports":[{"note":"Function is exposed at package level, not in submodule","wrong":"from g3hardware.generator import generate_config","symbol":"generate_config","correct":"from g3hardware import generate_config"},{"note":"Class is imported directly from package","wrong":"import g3hardware.PLCConfig","symbol":"PLCConfig","correct":"from g3hardware import PLCConfig"}],"quickstart":{"code":"from g3hardware import generate_config\n\n# Generate a basic PLC configuration XML\nconfig = generate_config(device_name='MyPLC', interfaces=['CAN', 'ETH'])\nprint(config.decode() if isinstance(config, bytes) else config)","lang":"python","description":"Generates an XML configuration string for a G3 PLC with specified interfaces."},"warnings":[{"fix":"Wrap output with config.decode() if bytes is returned, or use config = generate_config(…).decode('utf-8') if you need a string.","message":"Output format: The generate_config function returns bytes by default (or string in some contexts). Always check the type and decode appropriately.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Ensure your environment uses Python 3.10 or higher.","message":"Python version requirement: Requires Python >=3.10. Installing on older Pythons will fail during installation.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace 'config_type' with 'generator_type' in function calls.","message":"The parameter 'config_type' in some generation functions is deprecated in favor of 'generator_type'.","severity":"deprecated","affected_versions":">=0.2.10"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use 'from g3hardware import generate_config' instead of 'from g3hardware.generator import generate_config'.","cause":"Incorrect import path; the submodule 'generator' does not expose the function.","error":"AttributeError: module 'g3hardware' has no attribute 'generate_config'"},{"fix":"Replace 'config_type' with 'generator_type'.","cause":"Parameter name changed in version 0.2.10.","error":"TypeError: generate_config() got an unexpected keyword argument 'config_type'"},{"fix":"Upgrade to Python 3.10 or later, or create a new virtual environment with Python 3.10+.","cause":"Installing on Python version older than 3.10.","error":"pip install: ERROR: Package 'g3hardware' requires a different Python: 3.9.x not in '>=3.10'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}