{"id":21737,"library":"pyas2lib","title":"pyas2lib","description":"Python library for building and parsing AS2 (Applicability Statement 2) messages. It supports encryption, signing, compression, and MDN (Message Disposition Notification). Current version 1.4.4, released occasionally.","status":"active","version":"1.4.4","language":"python","source_language":"en","source_url":"https://github.com/abhishek-ram/pyas2-lib","tags":["AS2","EDI","encryption","signing","MIME"],"install":[{"cmd":"pip install pyas2lib","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Encryption and signing","package":"cryptography","optional":false},{"reason":"Certificate parsing","package":"pyopenssl","optional":false}],"imports":[{"note":"","wrong":"","symbol":"AS2Message","correct":"from pyas2lib import AS2Message"},{"note":"","wrong":"","symbol":"AS2Mdn","correct":"from pyas2lib import AS2Mdn"},{"note":"Before 1.x, was in pyas2lib.server; now in as2 submodule","wrong":"","symbol":"AS2Server","correct":"from pyas2lib.as2 import AS2Server"}],"quickstart":{"code":"from pyas2lib import AS2Message\n\n# Build a message\nmsg = AS2Message()\nmsg.build(\n    sender='as2://sender@domain',\n    receiver='as2://receiver@domain',\n    subject='Test',\n    content=b'Hello AS2',\n    content_type='application/octet-stream',\n    sign=False,\n    encrypt=False,\n    compress=False,\n)\nsigned_data = msg.to_bytes()\nprint(signed_data)","lang":"python","description":"Creates a simple unsigned, unencrypted AS2 message."},"warnings":[{"fix":"Use Python 3.7+","message":"Python 3.6 support dropped in v1.4.0","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Always provide all keyword arguments","message":"AS2Message requires all four fields (sender, receiver, subject, content) on build; missing one raises ValueError","severity":"gotcha","affected_versions":"all"},{"fix":"Use from pyas2lib.as2 import AS2Server","message":"AS2Server is deprecated in favor of AS2Server from pyas2lib.as2","severity":"deprecated","affected_versions":">=1.4.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install pyas2lib","cause":"Library not installed","error":"ModuleNotFoundError: No module named 'pyas2lib'"},{"fix":"Ensure sender, receiver, subject, content are all passed","cause":"Required argument not provided to AS2Message.build()","error":"ValueError: missing field 'receiver'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}