.KGL

KGL File

Kagsa Library
Ask a question
QUICK ANSWER

A .kgl file is a compiled library for the KAGSA programming language, an interpreted language built on Python. It is a renamed ZIP archive that bundles the Python files (main.py and __memory__.py) generated when a Kagsa source file is compiled, so a Kagsa program can call the library's functions. You open and use it with the free Kagsa interpreter, or rename a copy to .zip and inspect it with any archive tool.

Developer: Kagsa (KAGSA project) Category: Developer Files MIME: application/zip
OPENS ON Windows macOS Linux Android
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Jun 24, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the KGL file format?

A .kgl file is a compiled library for the KAGSA programming language, an interpreted language built on Python and released under the MIT license. Developers write Kagsa code in .kg source files and package reusable functions into a .kgl library so other programs can call them.

Under the hood a .kgl file is a .zip archive that has been given a different extension. It always contains at least two Python files: main.py, the compiled entry point, and __memory__.py, which holds the library's stored namespace data. Any extra helper modules are packed in alongside them. Because the container is standard ZIP, the file starts with the familiar PK signature.

Security & safety

RISK: MEDIUM

A .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.

Format details

in a nutshell
FULL NAMEKagsa Libraryaka Kagsa compiled library, KAGSA library archive
DEVELOPERKagsa (KAGSA project)since 2022
MIME TYPEapplication/zip
TYPECompiled library archive (ZIP container)
This extension is also used by…
  • 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.
MAGIC BYTES · FILE SIGNATURE
OFFSET
00010203
HEX
504B0304
ASCII
PK··
A .kgl file is a renamed ZIP archive, so it carries the standard ZIP local-file-header signature PK\x03\x04. Empty or spanned archives use PK\x05\x06 or PK\x07\x08.

Programs that open KGL files

Windows3 apps
WinRAR Paid Point WinRAR at the file (rename to .zip if needed) to browse and unpack the ZIP contents of the library.
7-Zip Open-source Open the .kgl directly or rename a copy to .zip, then extract main.py and __memory__.py to read the packaged Python code.
Kagsa Open-source Install Kagsa, then import the library from a .kg program or inspect it with the interpreter; this is the native tool for running .kgl code.
macOS2 apps
The Unarchiver Free Rename a copy to .zip and open it to extract the bundled .py files for inspection.
Kagsa Open-source Install via pip install kagsa and use the interpreter to import and run the library in your Kagsa project.
Linux2 apps
unzip Open-source Run unzip lib.kgl (or copy to lib.zip first) to list and extract main.py and __memory__.py.
Kagsa Open-source Install with pip install kagsa or the official Linux installer, then reference the library from a .kg source file.
Android1 app
Kagsa on Termux Open-source Install Kagsa inside Termux and run or import the library from the command line on Android.

Technical details

deep spec
EncodingBinary (ZIP archive)
Byte orderLittle-endian (ZIP fields)
ContainerZIP archive with the .kgl extension instead of .zip
CompressionStandard ZIP compression (DEFLATE or stored), inherited from the ZIP container
EncryptionNone by default; a KGL is a plain archive with no built-in encryption
Typical sizeA few kilobytes to a few hundred kilobytes, depending on the amount of compiled code
StructureA 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.
IntegrityCRC-32 per entry, provided by the ZIP format
PlatformsWindows, Linux, Termux (Android), macOS
NotesGenerated 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 Bykagsa command-line interpreter
Consumed ByKagsa runtime when a .kg program imports the library
Released2022
Latest versionKagsa 1.2.0 (2023)
Specificationwww.kagsa.org

KGL conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with KGL files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about KGL files.

Frequently asked questions

What is a .kgl file?
It is a compiled library for the KAGSA programming language. It packages Python files (main.py and __memory__.py) into a ZIP archive so a Kagsa program can call the library's functions.
How do I open a .kgl file?
Install the free Kagsa interpreter to use it in a project, or rename a copy to .zip and open it with 7-Zip, WinRAR or unzip to see the .py files inside.
How do I create a .kgl library?
Compile a Kagsa source file with the command kagsa -l lib.kg -o lib.kgl. The input must end in .kg and the output must end in .kgl.
Is a .kgl file just a ZIP file?
Yes. It uses standard ZIP compression and the PK signature; only the extension differs. That is why archivers can open it after you rename it to .zip.
What is inside a .kgl file?
At minimum main.py, the compiled library entry point, and __memory__.py, which holds the library's stored namespace data, plus any additional helper Python files.
Can I convert a .kgl back to Kagsa source?
No. The archive stores compiled Python, not the original .kg source, so there is no way to recover the readable Kagsa code from it.

References

1KAGSA on GitHubgithub.com
2KAGSA official documentationwww.kagsa.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.BINCD/DVD Disc Image (BIN/CUE)
6.EXEWindows Executable (Portable Executable)
7.RPMSGRestricted Permission Message
8.NOMEDIAAndroid No-Media Marker File
9.MDMarkdown Document
10.TMPTemporary File

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z