InstallerPack is a Python module designed to simplify adding 'Installer' functionality to Python applications. It provides a single function that can be linked to button clicks, enabling cloud-based version updates and seamless rebuilding with `pyinstaller`.
Project description
Overview
InstallerPack is a Python module designed to simplify updating and distributing Python applications. It mainly:
- Downloads application versions stored in OctaStore (a cloud-based version storage system).
- Determines the latest or requested version.
- Builds a standalone executable using PyInstaller.
- Optionally replaces an existing executable or places it in a specified folder.
Essentially, it’s a Python “installer/updater” helper.
Main Components
1. Initialization and Config
-
CAN_USEis a flag to indicate ifInstallerPackis ready to operate. -
OctaConfig: adataclassthat stores configuration for OctaStore:tokens,owners,repos— credentials and repos to access.branch,app_name,path_prefix— where the app versions are stored.encryption_key,use_cli_fallback— optional security and fallback options.
_OCTACONF: Optional[OctaConfig] = None # module-level config
init()— prints credits and setsCAN_USE = True.setocta(conf)— validates and sets the OctaStore configuration.
2. Version Handling
InstallerPack supports multiple versioning schemes:
- Semver:
1.2.3or1.2.3-alpha - Calver:
YYYY.MM.DDorYYYY.MM - Sequence version: numbers like
001,002 - Zero-based version (ZERVER)
Functions:
parse_semver(v),parse_calver(v),parse_seq(v)— convert version strings into tuples for comparison.version_key(v, style)— returns a sortable key based on version style.compare_versions(a, b, style)— compares two versions: returns-1,0, or1.
This allows InstallerPack to determine the latest version or prevent downgrades.
3. OctaStore Helpers
These functions interact with the cloud storage:
_build_repo_path_for_version(version, conf)— determines path in repo for a version._list_versions_via_api(conf)— tries to list versions using Python API._list_versions_via_cli(conf)— fallback using CLI if Python API fails._download_version_files(conf, version, dest)— downloads the version’s files locally, trying Python API first, then CLI.
Essentially, these functions make
InstallerPackcloud-aware, and able to fetch any version of your app automatically.
4. PyInstaller Helpers
InstallerPack can build standalone executables:
_generate_spec(main_script, dest_spec, ...)— creates a.specfile for PyInstaller automatically._run_pyinstaller(spec_path, main_script, ...)— runs PyInstaller, finds the executable, and returns its path.
This allows automatic building of a distributable .exe (or executable) from the downloaded version.
5. The update() Function
This is the main public function, designed to be linked to a GUI button or CLI action.
Steps performed by update():
-
Determine version style (
SEMVERby default). -
Ensure OctaStore configuration is set.
-
List available versions from OctaStore.
-
Choose the version to install:
"latest"→ pick the newest version.- Specific version → find closest match.
-
Compare with
currentverto prevent unnecessary upgrades/downgrades. -
Download the version files into a temporary directory.
-
Determine the main Python script to build:
- Looks for
<app_name>.py,main.py,app.py, or first.pyrecursively.
- Looks for
-
Optionally generate a PyInstaller
.specfile (buildspec=True). -
Run PyInstaller to produce executable.
-
Place or replace the executable in the target folder (
landingfolder). -
Clean up temporary files and spec files.
-
Return a summary dictionary with info:
{
"updated": True,
"version": "0.1.0",
"downloaded_to": "/tmp/installerpack_XXXX",
"main_script": "/tmp/installerpack_XXXX/main.py",
"exe": "/target/folder/MyApp.exe"
}
Key Design Choices
- Fallbacks: If Python API fails, CLI is used for listing/downloading versions.
- Safety: Prevents downgrades and checks existing versions.
- Heuristics: Tries to detect main script automatically.
- Temporary workspace: Downloads are isolated in temp directories.
Usage Example
from installerpack import init, setocta, OctaConfig, update
init()
setocta(OctaConfig(
tokens=["ghp_xxx"],
owners=["user"],
repos=["repo"],
branch="main",
app_name="MyApp",
path_prefix="apps"
))
update(currentver="0.1.0", newver="latest", buildspec=True, landingfolder="C:/MyApps")
This will fetch the latest version from OctaStore, build it, and place the executable in C:/MyApps.
✅ In short
InstallerPack is a Python cloud-aware installer/updater framework:
- Connects to OctaStore to get versions.
- Supports multiple versioning schemes.
- Automatically builds executables via PyInstaller.
- Handles version comparison, downloads, and installation intelligently.
- Provides both API and CLI fallbacks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file installerpack-0.1.0.tar.gz.
File metadata
- Download URL: installerpack-0.1.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc6df96f938f1b95d0cf115c4100f5147d2ac08a0ee0c3fbc9e6d11ee474af9e
|
|
| MD5 |
d2ffc3a0c039fcbd24afe122d98e964b
|
|
| BLAKE2b-256 |
ceef6a70e3a75b57d22cd35f0fe8c29a554837e9079ca8101516a791c65a18df
|
File details
Details for the file installerpack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: installerpack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6617bda479573ddefc9f26c8e68e00858e913f41d47a2f6ebc3522b4e718f3df
|
|
| MD5 |
b29bd6531cbdb354809965afc0c98aab
|
|
| BLAKE2b-256 |
1e9794f45099fca260a6ead672aba0e01115e7a3c3c8e4f3f22312ba6c08035d
|