We’re happy to announce the release of GroupDocs.Assembly for Python v26.11, available as of November 2026. This release delivers major platform support improvements—including the first wheels for Linux and macOS—along with native Python data source support, enhanced error handling, and upgraded dependencies. It also introduces several new features and breaking changes to align with modern Python practices and .NET 10.
このリリースの新機能
- [機能] Linux x64 と macOS(Intel と Apple Silicon)用のホイールを追加 (ASSEMBLYPYTHON-26)
- [機能] Python の dict または list をデータソースとしてサポート (ASSEMBLYPYTHON-27)
- [機能] ドキュメントテーブルロードハンドラ (
IDocumentTableLoadHandler) の Python ハンドラをサポート (ASSEMBLYPYTHON-28) - [機能] API が .NET
Typeを受け取る箇所で Python 型をサポート (DocumentTableColumn.type,known_types) (ASSEMBLYPYTHON-29) - [機能]
GROUPDOCS_LIC_PATH環境変数からライセンスを適用するサポートを追加 (ASSEMBLYPYTHON-30) - [強化] GroupDocs.Assembly を 26.7 に、組み込みランタイムを .NET 10.0.14 に更新 (ASSEMBLYPYTHON-31)
- [強化] コンパイル済み拡張モジュールの代わりに、Python 3.5 – 3.14 用の純粋 Python パッケージを提供 (ASSEMBLYPYTHON-32)
- [強化]
assemble_document()でDataSourceInfoを単体でもリストでも受け取れるように (ASSEMBLYPYTHON-33) - [強化] ファイルが見つからない場合は
FileNotFoundError、ライセンスが適用できない場合はLicenseError、その他のエンジンエラーはGroupDocsAssemblyExceptionを送出 (ASSEMBLYPYTHON-34) - [強化]
BarcodeSettings.x_resolution/y_resolutionをxresolution/yresolutionに名称変更し、use_reflection_optimizationをクラス属性に (ASSEMBLYPYTHON-35) - [強化] 32 ビット Windows 用ホイールを削除 (ASSEMBLYPYTHON-36)
- [修正] 25.5.1 の CVE 問題を修正: zlib 1.2.11 → 1.2.12 (+4 以上) (ASSEMBLYPYTHON-11)
パブリック API の変更
アップグレードする際は x_resolution/y_resolution と set_use_reflection_optimization() の名前を変更し、RuntimeError を捕捉していた箇所で GroupDocsAssemblyException と LicenseError を捕捉する必要があります。その他はすべて追加的です。
新しいクラスとメンバー
groupdocs.assembly:FontSettings,FolderFontSource,IFontSource,SearchOption,OoxmlCompliance,GroupDocsAssemblyException,LicenseError,LicenseWarning.LoadSaveOptions:ooxml_compliance.KnownTypeSet:append().DocumentTableCollection,DocumentTableColumnCollection:get().DocumentTableRelationCollection:append(),get().
名前が変更されたもの
BarcodeSettings.x_resolution→BarcodeSettings.xresolutionBarcodeSettings.y_resolution→BarcodeSettings.yresolution
古い名前は読み取り時も代入時も “Did you mean” ヒント付きの AttributeError を送出します。
削除されたもの
DocumentAssembler.set_use_reflection_optimization(): 代わりにクラス属性を設定してください。例:DocumentAssembler.use_reflection_optimization = False.
変更されたもの
DataSourceInfoは dict または list を受け取ります。assemble_document()は単一のDataSourceInfoと list の両方を受け取ります。DocumentTableSet(path, load_handler)は Python 関数またはhandle(args)メソッドを持つオブジェクトを受け取ります。DocumentTableColumn.typeとKnownTypeSet.add()は Python 型を受け取ります。- エンジンエラーは
FileNotFoundError,RuntimeError,LicenseErrorまたはGroupDocsAssemblyExceptionを送出します。except Exceptionは両リリースのエラーを捕捉します。
新機能
Linux と macOS
26.11 では Linux x64(manylinux_2_27_x86_64、glibc 2.27 以上)と macOS 12 以降の Intel(macosx_12_0_x86_64)および Apple Silicon(macosx_12_0_arm64)用ホイールを Windows x64 に加えて提供します。25.5 は Windows 用ホイールのみでした。pip 20.3 以降はプラットフォームに適したホイールを自動的に選択します。Linux では .NET ランタイムに ICU が必要で、プレゼンテーションテンプレートには libgdiplus が必要です(Requirements を参照)。
pip install groupdocs-assembly-net==26.11.0
データソースとしての Python データ
DataSourceInfo は dict、dict のリスト、または値のリストをそのまま受け取ります。25.5 は dict に対して TypeError を送出していました。ラッパーはデータの形状から .NET オブジェクトを生成するため、数値、文字列、bool、datetime、date、Decimal などの値がテンプレートで型付けされた形で利用できます:<<[o.OrderDate.Month]>> や <<if [c.Vip]>> は .NET オブジェクトと同様に機能します。1 つのリスト内の dict はキーの合併型で共通の型を共有します。
from groupdocs.assembly import DataSourceInfo, DocumentAssembler
orders = [
{"Number": 10001, "Product": "Harbor Blend whole bean coffee", "Quantity": 30, "Price": 552.0},
{"Number": 10004, "Product": "Aged harbour cheddar", "Quantity": 8, "Price": 132.0},
]
# order-table.docx: a table whose row <<foreach [o in orders]>><<[o.Number]>> ... <</foreach>> repeats per order
DocumentAssembler().assemble_document("order-table.docx", "order-table-report.docx", [
DataSourceInfo("Quayside Bistro", "customer"),
DataSourceInfo(orders, "orders"),
])
リストなしの単一データソース
assemble_document() は .NET の params DataSourceInfo[] と同様に、単体の DataSourceInfo またはそのリストを受け取ります。25.5 はリストが必須で、単体で渡すと TypeError: can't build Array value from 'groupdocs.assembly.DataSourceInfo' が発生していました。
from groupdocs.assembly import DataSourceInfo, DocumentAssembler
customer = {"Name": "Quayside Bistro", "Product": "Harbor Blend whole bean coffee"}
DocumentAssembler().assemble_document("hello-world.docx", "hello-world-report.docx", DataSourceInfo(customer, "customer"))
テーブルロードハンドラ
DocumentTableSet(path, load_handler) は Python 関数 (args)、または handle(args) メソッドを持つオブジェクトを受け取り、ドキュメントの各テーブルがロードされる前に呼び出されます。ハンドラはそのテーブルの args.options を設定したり、args.is_loaded = False でテーブルをスキップしたりできます。args.table_index はテーブル番号を示します。25.5 は Python 関数に対して TypeError を送出していました。
from groupdocs.assembly.data import DocumentTableOptions, DocumentTableSet
def on_table(args):
options = DocumentTableOptions()
options.first_row_contains_column_names = True
args.options = options
tables = DocumentTableSet("contracts.xlsx", on_table)
for table in tables.tables:
print(table.name, [column.name for column in table.columns])
API が .NET 型を受け取る場合の Python 型
Python 型はメンバーが受け取る .NET 型を表します:float は System.Double、int、str、bool、datetime など。ドキュメントテーブルの列を数値型にするとチャートで合計が取れ、known_types でテンプレートから型の静的メンバーを呼び出すことができます(.NET 型名も受け取ります)。25.5 は TypeError: can't build Type value from 'type' を送出していました。
from groupdocs.assembly import DataSourceInfo, DocumentAssembler
from groupdocs.assembly.data import DocumentTable, DocumentTableOptions
options = DocumentTableOptions()
options.first_row_contains_column_names = True
contracts = DocumentTable("contracts.xlsx", 0, options)
contracts.columns["Price"].type = float
assembler = DocumentAssembler()
assembler.known_types.add("System.Math") # templates can call <<[Math.Round(x, 1)]>>
assembler.assemble_document("table-row.docx", "table-row-report.docx", DataSourceInfo(contracts, "contracts"))
環境変数からのライセンス
GROUPDOCS_LIC_PATH にライセンスファイルのパスまたは URL を設定すると、最初のエンジン呼び出し時にライセンスが適用され、ライセンスコードは不要です。25.5 はこの変数を読み取っていませんでした。ライセンスが適用できない(ファイルがない、期限切れ、別製品用)場合、すべてのエンジン呼び出しは LicenseError を送出し、変数名とエンジン側の理由を示します。License().set_license() でライセンスを設定すればエラーは解消します。GROUPDOCS_LIC_STRICT=0 に設定すると LicenseWarning が 1 件だけ出力され、評価モードになります。
from groupdocs.assembly import DataSourceInfo, DocumentAssembler, LicenseError
customer = {"Name": "Quayside Bistro", "Product": "Harbor Blend whole bean coffee"}
try:
DocumentAssembler().assemble_document("hello-world.docx", "hello-world-report.docx", DataSourceInfo(customer, "customer"))
except LicenseError as e:
print(e) # GROUPDOCS_LIC_PATH=... could not be applied: <reason>
エラーの種類別
25.5 はすべてのエンジンエラーで裸の RuntimeError("Proxy error(<.NET exception>): ...") を送出していました。26.11 ではテンプレートやデータファイルが見つからない場合は FileNotFoundError(RuntimeError のサブクラス)を、テンプレートエラーやデータ不足の場合はエンジンメッセージだけの RuntimeError を、ライセンス適用不可の場合は LicenseError を、その他のエンジンエラーは GroupDocsAssemblyException を送出します。LicenseError と GroupDocsAssemblyException は groupdocs.assembly からインポート可能で、RuntimeError からは派生していません。
from groupdocs.assembly import DataSourceInfo, DocumentAssembler, GroupDocsAssemblyException
try:
DocumentAssembler().assemble_document("no-such-template.docx", "report.docx", DataSourceInfo({"Name": "A"}, "customer"))
except FileNotFoundError as e:
print("missing:", e)
except (RuntimeError, GroupDocsAssemblyException) as e:
print("engine:", e)
コード例
from groupdocs.assembly import DataSourceInfo, DocumentAssembler, FileFormat, LoadSaveOptions, OoxmlCompliance
options = LoadSaveOptions(FileFormat.DOCX)
options.ooxml_compliance = OoxmlCompliance.STRICT
customer = {"Name": "Quayside Bistro", "Product": "Harbor Blend whole bean coffee"}
DocumentAssembler().assemble_document("hello-world.docx", "hello-world-strict.docx", options, DataSourceInfo(customer, "customer"))
アップデートの取得方法
PyPI
PyPI から最新パッケージにアップグレードしてください:
groupdocs-assembly-net 26.11.0
pip install groupdocs-assembly-net==26.11.0
直接ダウンロード
GroupDocs.Assembly for Python v26.11 ページからプラットフォーム向けホイールをダウンロードしてください。