A molecular project rarely consists of a structure alone. There may also be analysis scripts, input files, notes, figures, or a small Python app that turns a series of steps into a repeatable workflow. When those pieces live in separate folders, sharing the project can mean sending several files, explaining where they belong, and hoping the recipient can reconstruct the setup.
SAMSON documents offer a practical way to keep those project materials together: embed scripts, files, and folders alongside the molecular model. The result is a self-contained document that can be transferred to another computer and shared with colleagues or students.
Package the workflow with the model
Instead of treating the Python script as an afterthought, include it in the document that gives the script its context. A recipient can see the model and the workflow materials together, rather than having to search through email attachments or guess which version of a script belongs to which structure.
To add files or folders, drag and drop them into SAMSON and respond to the prompt to embed them. You can also use Home > Embed files or Home > Embed folders.

Because the files and folders are stored within the document, the project is easier to move and share. For example, a researcher can attach analysis scripts to a molecular model, while an instructor can distribute a document containing lecture material and interactive Python exercises.
Make the script usable by someone else
Embedding a script solves the “where is the file?” problem, but a little preparation makes the workflow easier to understand and reproduce. Before sharing, consider adding a short README or notes file that explains:
- What the script is intended to do and which model or data it expects.
- How to open and run it. An embedded Python script can be opened in the Code Editor by double-clicking it.
- Which Python packages the workflow uses, and any setup the recipient may need to complete.
- What output to look for, and whether the script modifies the open document.
These are simple communication habits, not special requirements of SAMSON. They help a colleague distinguish a ready-to-run example from a script that needs adaptation, and make it less likely that important assumptions remain only in the author’s memory.
Run and refine the code in SAMSON
SAMSON’s Code Editor can open and modify text files, including Python scripts, and run Python files. It includes syntax highlighting and auto-completion, and offers Python templates to help you get started. For quick tests, you can use the integrated Python Console, which provides access to the SAMSON Python API through a Jupyter Qt console.

If a script needs additional Python packages, the integrated package manager can install packages using pip. Open the Python Console and choose Edit > Manage packages…. Packages can be installed by name, with version specifications such as foo==1.2.0, or from a local Python package path. For a local package you are actively developing, editable mode lets Python refer to the package’s source files; for a package you do not intend to modify, the documentation recommends leaving editable mode unchecked.
A useful handoff checklist
- Keep the relevant model, scripts, and supporting project files together in the SAMSON document.
- Give files clear names and add a brief explanation of the workflow’s purpose and requirements.
- Open the embedded script in the Code Editor and check that it is the intended version.
- Share the document through a suitable channel, such as email, GitHub, or SAMSON Connect Documents.
This approach is useful whenever the value of a molecular model depends on how it was prepared or analyzed. Instead of handing off only the result, you can hand off the context and tools needed to inspect or continue the work.
Learn more in the SAMSON scripting documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
