Registry / communication / pyas2lib

pyas2lib

JSON →
library1.4.4pypypi✓ verified 85d ago

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.

pip install pyas2lib
INSTALL
IMPORT
SIG · PYAS2LIB
P
pyas2lib
communicationpythonv1.4.4
Install
2.8s avg
Import
Disk
37MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 38MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.8s · import 0.000s · 38MB
37MB installed
● package 37MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Message
from pyas2lib import Message
from pyas2lib import AS2Message
Mdn
from pyas2lib import Mdn
Partner
from pyas2lib import Partner

Creates a simple unsigned, unencrypted AS2 message.

from pyas2lib import AS2Message # Build a message msg = AS2Message() msg.build( sender='as2://sender@domain', receiver='as2://receiver@domain', subject='Test', content=b'Hello AS2', content_type='application/octet-stream', sign=False, encrypt=False, compress=False, ) signed_data = msg.to_bytes() print(signed_data)
Debug
Known issues
breakingPython 3.6 support dropped in v1.4.0
fix
Use Python 3.7+
affects: >=1.4.0
gotchaAS2Message requires all four fields (sender, receiver, subject, content) on build; missing one raises ValueError
fix
Always provide all keyword arguments
affects: all
deprecatedAS2Server is deprecated in favor of AS2Server from pyas2lib.as2
fix
Use from pyas2lib.as2 import AS2Server
affects: >=1.4.0
Upgrade
Version history
1.4.4latest on PyPI · released Mar 22, 2025
Audit
Dependencies
cryptographyrequiredEncryption and signing
pyopensslrequiredCertificate parsing
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
2
Resources
pyas2lib — pip install pyas2lib · libregistry