GroupDocs.Assembly for Python v26.11 sürümünün Kasım 2026 itibarıyla yayınlandığını duyurmaktan mutluluk duyuyoruz. Bu sürüm, Linux ve macOS için ilk tekerlekler dahil olmak üzere büyük platform desteği iyileştirmeleri, yerel Python veri kaynağı desteği, geliştirilmiş hata işleme ve yükseltilmiş bağımlılıklar sunar. Ayrıca modern Python uygulamaları ve .NET 10 ile uyumlu olmak için birkaç yeni özellik ve kırılma değişikliği getiriyor.

Bu sürümde yenilikler

  • [Özellik] Linux x64 ve macOS (Intel ve Apple Silicon) için tekerlekler ekle (ASSEMBLYPYTHON-26)
  • [Özellik] Python dict veya list’ini veri kaynağı olarak destek ekle (ASSEMBLYPYTHON-27)
  • [Özellik] Belge tablo yüklemesi için Python işleyicisi (IDocumentTableLoadHandler) desteği ekle (ASSEMBLYPYTHON-28)
  • [Özellik] API’nin .NET Type aldığı yerlerde Python tipleri desteği ekle (DocumentTableColumn.type, known_types) (ASSEMBLYPYTHON-29)
  • [Özellik] GROUPDOCS_LIC_PATH ortam değişkeninden lisans uygulama desteği ekle (ASSEMBLYPYTHON-30)
  • [İyileştirme] GroupDocs.Assembly’i 26.7 sürümüne ve gömülü çalışma zamanını .NET 10.0.14’e güncelle (ASSEMBLYPYTHON-31)
  • [İyileştirme] Derlenmiş uzantı yerine Python 3.5 – 3.14 için saf-Python paketi gönder (ASSEMBLYPYTHON-32)
  • [İyileştirme] assemble_document() içinde bir DataSourceInfo ve bir liste kabul et (ASSEMBLYPYTHON-33)
  • [İyileştirme] Eksik dosya için FileNotFoundError, uygulanamayan lisans için LicenseError ve diğer motor hataları için GroupDocsAssemblyException yükselt (ASSEMBLYPYTHON-34)
  • [İyileştirme] BarcodeSettings.x_resolution/y_resolution‘ı xresolution/yresolution olarak yeniden adlandır ve use_reflection_optimization‘ı sınıf özniteliği yap (ASSEMBLYPYTHON-35)
  • [İyileştirme] 32-bit Windows tekerleğini kaldır (ASSEMBLYPYTHON-36)
  • [Düzeltme] 25.5.1’deki CVE bulgularını düzelt: zlib 1.2.11 → 1.2.12 (+4 daha) (ASSEMBLYPYTHON-11)

Genel API değişiklikleri

Güncelleyicilerin x_resolution/y_resolution ve set_use_reflection_optimization()‘ı yeniden adlandırması ve RuntimeError yakaladıkları yerde GroupDocsAssemblyException ve LicenseError yakalaması gerekir. Diğer her şey eklemedir.

Yeni sınıflar ve üyeler

  • groupdocs.assembly: FontSettings, FolderFontSource, IFontSource, SearchOption, OoxmlCompliance, GroupDocsAssemblyException, LicenseError, LicenseWarning.
  • LoadSaveOptions: ooxml_compliance.
  • KnownTypeSet: append().
  • DocumentTableCollection, DocumentTableColumnCollection: get().
  • DocumentTableRelationCollection: append(), get().

Yeniden adlandırıldı

  • BarcodeSettings.x_resolution → BarcodeSettings.xresolution
  • BarcodeSettings.y_resolution → BarcodeSettings.yresolution

Eski adlar, okuma ve atama sırasında “Bunu mu demek istediniz” ipucu içeren AttributeError hatası verir.

Kaldırıldı

  • DocumentAssembler.set_use_reflection_optimization(): bunun yerine sınıf özniteliğini atayın, DocumentAssembler.use_reflection_optimization = False.

Değiştirildi

  • DataSourceInfo bir dict veya list alır.
  • assemble_document() bir DataSourceInfo ve bir liste alabilir.
  • DocumentTableSet(path, load_handler) bir Python fonksiyonu veya handle(args) metoduna sahip bir nesne alır.
  • DocumentTableColumn.type ve KnownTypeSet.add() bir Python tipi alır.
  • Motor hataları FileNotFoundError, RuntimeError, LicenseError veya GroupDocsAssemblyException yükseltir. except Exception her iki sürümdeki hataları yakalar.

Yeni özellikler

Linux ve macOS

26.11, Windows x64’nin yanı sıra Linux x64 (manylinux_2_27_x86_64, glibc 2.27 veya daha yeni) ve macOS 12 veya daha yeni Intel (macosx_12_0_x86_64) ve Apple Silicon (macosx_12_0_arm64) için tekerlekler içerir. 25.5 sadece Windows tekerleklerine sahipti. pip 20.3 veya daha yenisi platform için uygun tekerleği seçer. Linux’ta .NET çalışma zamanı ICU gerektirir ve sunum şablonları libgdiplus gerektirir (bkz. Gereksinimler).

pip install groupdocs-assembly-net==26.11.0

Python verisi veri kaynağı olarak

DataSourceInfo bir dict, dict listesi veya değer listesi alır; 25.5 bir dict için TypeError yükseltti. Sarmalayıcı veriyi şekline göre tiplenmiş .NET nesnelerine dönüştürür, böylece sayılar, stringler, bool, datetime, date ve Decimal değerleri şablonda tipli olarak erişilir: <<[o.OrderDate.Month]>> ve <<if [c.Vip]>> .NET nesnelerinde olduğu gibi çalışır. Tek bir listedeki dict’ler, anahtarlarının birleşimiyle tek bir tip paylaşır.

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"),
])

Liste olmadan tek veri kaynağı

assemble_document() bir DataSourceInfo veya bir liste alır, .NET’in params DataSourceInfo[] gibi. 25.5 bir liste gerektiriyordu ve tek bir öğe için TypeError: can't build Array value from 'groupdocs.assembly.DataSourceInfo' yükseltti.

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"))

Tablo yükleme işleyicileri

DocumentTableSet(path, load_handler) bir Python fonksiyonu (args) veya handle(args) metoduna sahip bir nesne alır ve belge yüklenmeden önce her tablo için çağırır. İşleyici tablonun args.options değerini ayarlar veya args.is_loaded = False ile tabloyu atlar; args.table_index tablonun hangi indeks olduğunu söyler. 25.5 bir Python fonksiyonu için TypeError yükseltti.

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’nin .NET tipi aldığı yerde Python tipleri

Bir Python tipi, bir üyenin aldığı .NET tipini temsil eder: float → System.Double, int, str, bool, datetime. Bir belge tablosunun sütunu sayısal yapılabilir, böylece bir grafik onu toplar ve known_types bir şablonun tipin statik üyelerini çağırmasına izin verir; ayrıca bir .NET tip adı alır. 25.5 TypeError: can't build Type value from 'type' yükseltti.

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"))

Ortamdan lisans

GROUPDOCS_LIC_PATH ortam değişkenini bir lisans dosyasının yolu ya da bir URL olarak ayarlayın; lisans ilk motor çağrısında, lisans kodu olmadan uygulanır; 25.5 bu değişkeni okumadı. Eğer lisans uygulanamazsa (eksik dosya, süresi dolmuş abonelik, başka bir ürün için lisans), her motor çağrısı LicenseError yükseltir, değişkeni ve motorun nedenini belirtir, License().set_license() bir lisans uygulayana kadar. GROUPDOCS_LIC_STRICT=0 ayarlayarak bir LicenseWarning ve değerlendirme modunu alabilirsiniz.

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>

Hata türlerine göre

25.5 her motor hatası için çıplak bir RuntimeError("Proxy error(<.NET exception>): ...") yükseltti. 26.11 eksik şablon veya veri dosyası için FileNotFoundError yükseltir, bu hâlâ RuntimeError‘dan türetilir; şablon hatası veya veri eksikliği için yalnızca motorun mesajı ile RuntimeError; uygulanamayan lisans için LicenseError; ve diğer motor hataları için GroupDocsAssemblyException. LicenseError ve GroupDocsAssemblyException groupdocs.assembly üzerinden içe aktarılabilir ve RuntimeError‘dan türemez.

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)

Kod örneği

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"))

Güncellemeyi nasıl alabilirsiniz

PyPI

PyPI üzerinden en son pakete yükseltin:

groupdocs-assembly-net 26.11.0

pip install groupdocs-assembly-net==26.11.0

Doğrudan indirme

Platformunuz için tekerlekleri GroupDocs.Assembly for Python v26.11 sayfasından indirin.

Kaynaklar