Что такое формат файла KGL?
Файл .kgl - это скомпилированная библиотека для языка программирования KAGSA, интерпретируемого языка, построенного на Python и распространяемого под лицензией MIT. Разработчики пишут код Kagsa в исходных файлах .kg и упаковывают переиспользуемые функции в библиотеку .kgl, чтобы другие программы могли их вызывать.
По сути, файл .kgl - это архив .zip, которому присвоено другое расширение. Он всегда содержит как минимум два файла Python: main.py (скомпилированная точка входа) и __memory__.py (хранит данные пространства имен библиотеки). Любые дополнительные вспомогательные модули упаковываются вместе с ними. Поскольку контейнером является стандартный ZIP, файл начинается со знакомой сигнатуры PK.
Безопасность и защита
РИСК: MEDIUMA .kgl is a ZIP archive containing executable Python code that the Kagsa interpreter runs when the library is imported. Extracting the archive is safe, but importing or running a library from an untrusted source executes its code, so only use .kgl files you trust.
Детали формата
в двух словах- kglab / kgl (Python graph library) - The 'kgl' name is also used by DerwenAI's kglab knowledge-graph package, but it does not define a .kgl file type.
- kgl.exe (generic executable) - Various unrelated Windows programs ship an executable named kgl.exe; unrelated to the Kagsa library format.
Программы, открывающие файлы KGL
Технические подробности
глубокая спецификация| Encoding | Binary (ZIP archive) |
| Byte order | Little-endian (ZIP fields) |
| Container | ZIP archive with the .kgl extension instead of .zip |
| Compression | Standard ZIP compression (DEFLATE or stored), inherited from the ZIP container |
| Encryption | None by default; a KGL is a plain archive with no built-in encryption |
| Typical size | A few kilobytes to a few hundred kilobytes, depending on the amount of compiled code |
| Structure | A ZIP archive holding the Python files produced when a Kagsa source library is compiled. It always contains main.py (the compiled library entry point) and __memory__.py (the library's stored state/namespace data), plus any additional helper .py files. |
| Integrity | CRC-32 per entry, provided by the ZIP format |
| Platforms | Windows, Linux, Termux (Android), macOS |
| Notes | Generated by the Kagsa interpreter with the command kagsa -l lib.kg -o lib.kgl. The input must be a .kg source file and the output name must end in .kgl. Because it is just a renamed ZIP, renaming a copy to .zip lets any archiver inspect the contents. |
| Produced By | kagsa command-line interpreter |
| Consumed By | Kagsa runtime when a .kg program imports the library |
| Выпущен | 2022 |
| Последняя версия | Kagsa 1.2.0 (2023) |
| Спецификация | www.kagsa.org |
Конвертации KGL
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах KGL.