نحن سعداء بالإعلان عن إصدار GroupDocs.Assembly for Python v26.11، المتاح اعتبارًا من نوفمبر 2026. يقدم هذا الإصدار تحسينات كبيرة في دعم المنصات — بما في ذلك أول عجلات (wheels) لـ Linux و macOS — إلى جانب دعم مصدر بيانات Python الأصلي، تحسين معالجة الأخطاء، وترقية التبعيات. كما يقدم عدة ميزات جديدة وتغييرات كسرية لتتماشى مع ممارسات Python الحديثة و .NET 10.
ما الجديد في هذا الإصدار
- [Feature] إضافة عجلات (wheels) لـ Linux x64 و macOS (Intel و Apple Silicon) (ASSEMBLYPYTHON-26)
- [Feature] إضافة دعم لقاموس Python أو قائمة كمصدر بيانات (ASSEMBLYPYTHON-27)
- [Feature] إضافة دعم لمعالج تحميل جدول المستند في Python (
IDocumentTableLoadHandler) (ASSEMBLYPYTHON-28) - [Feature] إضافة دعم لأنواع Python حيث يأخذ API نوع .NET (
DocumentTableColumn.type،known_types) (ASSEMBLYPYTHON-29) - [Feature] إضافة دعم لتطبيق الترخيص من متغير البيئة
GROUPDOCS_LIC_PATH(ASSEMBLYPYTHON-30) - [Enhancement] تحديث GroupDocs.Assembly إلى 26.7 وتحديث وقت التشغيل المدمج إلى .NET 10.0.14 (ASSEMBLYPYTHON-31)
- [Enhancement] توفير حزمة Python صافية لـ Python 3.5 – 3.14 بدلاً من الامتداد المترجم (ASSEMBLYPYTHON-32)
- [Enhancement] قبول
DataSourceInfoواحد فيassemble_document()بالإضافة إلى قائمة (ASSEMBLYPYTHON-33) - [Enhancement] رفع استثناء
FileNotFoundErrorعند فقدان ملف، وLicenseErrorعند عدم إمكانية تطبيق الترخيص، وGroupDocsAssemblyExceptionلأخطاء المحرك الأخرى (ASSEMBLYPYTHON-34) - [Enhancement] إعادة تسمية
BarcodeSettings.x_resolution/y_resolutionإلىxresolution/yresolution، وجعلuse_reflection_optimizationسمة صفية (ASSEMBLYPYTHON-35) - [Enhancement] إزالة عجلة Windows 32‑bit (ASSEMBLYPYTHON-36)
- [Fix] إصلاح مشكلات CVE في 25.5.1: zlib 1.2.11 → 1.2.12 (+4 أخرى) (ASSEMBLYPYTHON-11)
تغييرات API العامة
يجب على المحدثين إعادة تسمية x_resolution/y_resolution وset_use_reflection_optimization()، والتقاط GroupDocsAssemblyException وLicenseError حيث كانوا يلتقطون RuntimeError. كل ما تبقى إضافي.
الفئات والأعضاء الجديدة
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
الأسماء القديمة ترفع استثناء AttributeError مع تلميح “هل قصدت” عند القراءة أو الإسناد.
تم الإزالة
DocumentAssembler.set_use_reflection_optimization(): عيّن سمة الصف بدلاً من ذلك،DocumentAssembler.use_reflection_optimization = False.
تم التغيير
DataSourceInfoيقبل قاموسًا أو قائمة.assemble_document()يقبلDataSourceInfoواحدًا بالإضافة إلى قائمة.DocumentTableSet(path, load_handler)يقبل دالة Python أو كائن يحتوي علىhandle(args).DocumentTableColumn.typeوKnownTypeSet.add()يقبلان نوع Python.- أخطاء المحرك ترفع
FileNotFoundError،RuntimeError،LicenseErrorأوGroupDocsAssemblyException.except Exceptionيلتقط الأخطاء في كلا الإصدارين.
الميزات الجديدة
Linux و macOS
يحتوي الإصدار 26.11 على عجلات (wheels) لـ 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 (انظر المتطلبات).
pip install groupdocs-assembly-net==26.11.0
بيانات Python كمصدر بيانات
DataSourceInfo يقبل قاموسًا، أو قائمة من القواميس، أو قائمة من القيم كما هي؛ كان الإصدار 25.5 يرفع TypeError عند تمرير قاموس. يقوم الغلاف بتحويل البيانات إلى كائنات .NET مُعرفة وفقًا لبنيتها، لذا تصل القيم العددية، والسلاسل، وbool، وdatetime، وdate وDecimal إلى القالب مُعرفة النوع: <<[o.OrderDate.Month]>> و<<if [c.Vip]>> يعملان كما في كائنات .NET. القواميس في قائمة واحدة تشترك في نوع موحد يجمع مفاتيحها.
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: جدول يُكرر الصف <<foreach [o in orders]>><<[o.Number]>> ... <</foreach>> لكل طلب
DocumentAssembler().assemble_document("order-table.docx", "order-table-report.docx", [
DataSourceInfo("Quayside Bistro", "customer"),
DataSourceInfo(orders, "orders"),
])
مصدر بيانات واحد بدون قائمة
assemble_document() يقبل DataSourceInfo واحدًا أو قائمة منها، كما يفعل params DataSourceInfo[] في .NET. كان الإصدار 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 يرفع TypeError عند تمرير دالة Python.
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])
أنواع Python حيث يأخذ API نوع .NET
نوع 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") # القوالب يمكنها استدعاء <<[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 ووضع التقييم بدلاً من ذلك.
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
التحميل المباشر
حمّل العجلات (wheels) لمنصتك من صفحة GroupDocs.Assembly for Python v26.11.