Skip to main content

Mussel-Python Mussel-Python

Python for any environment

Overview

Mussel Python is a versatile tool designed to streamline the process of creating standalone Python applications with pyinstaller within a standardized environment.

Features

  • Isolated Build Environment: Utilize Docker to build standalone Python application (with its dependencies), ensuring a consistent and isolated build environment.

  • Dependency Management: Easily manage Python package dependencies and versions within your mussel app, avoiding conflicts and ensuring reproducibility.

  • Build Automation: Streamline the build process, making it easy to share and deploy your Python applications.

  • Portability: Python application built with mussel-python runs consistently across different operating systems and environments.

Installation

Install mussel using pip:

pip install mussel

Expected Binary Compatibility

This section describe compatibility of your python executable after mussel's build.

Linux

Compatibles Linux distributions :

  • Any distro with GLIBC >= 2.14
    • Ubuntu 14.04 or higher
    • Debian 8 or higher
    • Fedora 20 or higher
    • And many more ...
Command Bundled Python*
mussel --python 3.8 [OPTIONS] 3.8.18 (With OpenSSL 3.1.3)
mussel --python 3.9 [OPTIONS] 3.9.13 (With OpenSSL 3.1.3)
mussel --python 3.10 [OPTIONS] 3.10.12 (With OpenSSL 3.1.3)
mussel --python 3.11 [OPTIONS] 3.11.5 (With OpenSSL 3.1.3)

(*) Bundled Python: Python distributed inside mussel (pyinstaller) bundled application.

Windows

Command Bundled Python* Compatiblity
mussel --python 3.8 [OPTIONS] 3.8.10 (With OpenSSL 1.1.1n) Windows 7 or higher
mussel --python 3.9 [OPTIONS] 3.9.13 (With OpenSSL 1.1.1n) Windows 8 or higher
mussel --python 3.10 [OPTIONS] 3.10.11 (With OpenSSL 1.1.1n) Windows 8 or higher
mussel --python 3.11 [OPTIONS] 3.11.5 (With OpenSSL 1.1.1n) Windows 8 or higher

Compatiblity example

Building your application with mussel --python 3.11 will produce:

  • An application running on Python 3.11.5 on Windows & Linux
  • Compatible with:
    • Ubuntu 14.04 or higher
    • Windows 8 or higher

Getting Started

Prerequisites

Before you begin, make sure you have the following prerequisites installed on your system:

Write your first mussel standalone app

1. Define your Python application code

Script above will print Python & OpenSSL version

import sys
import ssl

if __name__ == '__main__':
    print("Python", sys.version)
    print(ssl.OPENSSL_VERSION)

2. Build your standalone app with mussel-python

Usage

mussel --python <VERSION> (--source PATH) [pyinstaller options]

For detailed information on pyinstaller options, please reach https://pyinstaller.org/en/stable/usage.html#options

Example below will build a single file standalone executable (-F) from a python script my-app.py

$ mussel --python 3.10 -F my-app.py

3. Run your standalone executable

Executable files are by default created within a dist directory.

$ ./dist/my-app
Python 3.10.12 (main, Sep 29 2023, 07:32:58) [GCC 4.8.4]
OpenSSL 3.1.3 19 Sep 2023

# Try with ubuntu:14.04 container
$ docker run --rm -v ./dist/my-app:/my-app ubuntu:14.04 /my-app
Python 3.10.12 (main, Sep 29 2023, 07:32:58) [GCC 4.8.4]
OpenSSL 3.1.3 19 Sep 2023

# Try with more recent distro... ubuntu:22.04
$ docker run --rm -v ./dist/my-app:/my-app ubuntu:22.04 /my-app
Python 3.10.12 (main, Sep 29 2023, 07:32:58) [GCC 4.8.4]
OpenSSL 3.1.3 19 Sep 2023

# Fedora 40 ?
$ docker run --rm -v ./dist/my-app:/my-app fedora:40 /my-app
Python 3.10.12 (main, Sep 29 2023, 07:32:58) [GCC 4.8.4]
OpenSSL 3.1.3 19 Sep 2023

# alpine ?
$ docker run --rm -v ./dist/my-app:/my-app alpine:latest sh -c "apk add libc6-compat gcompat ; ./my-app"
...
OK: 8 MiB in 19 packages
Python 3.10.12 (main, Sep 29 2023, 07:32:58) [GCC 4.8.4]
OpenSSL 3.1.3 19 Sep 2023

# Windows ?
\> .\dist\my-app.exe
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v1929 64 bit (AMD64)]
OpenSSL 1.1.1n  15 Mar 2022

License

This project is licensed under the MIT License.

Acknowledgments

  • Inspired by the need for standalone & environment agnostic Python application.
  • Built with Docker and pysintaller.

Contact

For questions or feedback, please contact contact@tmahe.dev.

Happy coding!

Metadata

Release files for mussel 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mussel 1.1.0
File Size Uploaded Provenance Actions
mussel-1.1.0.tar.gz 4.7 kB Without provenance Details for mussel-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mussel 1.1.0
File Interpreter ABI Platform Actions
mussel-1.1.0-py3-none-any.whl Python 3 none any Details for mussel-1.1.0-py3-none-any.whl

Total release size: 9.3 kB

Release files / mussel-1.1.0.tar.gz

Download URL mussel-1.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9f1fa66c621df183735cc0cd3eea2b38cec950b04c68eda1357fd3f3c6b89a92
BLAKE2b-256 checksum
How to use checksums
a2a0ff54a0356f6339898fddfcd33663deb6a5ff1b4c9cdd196f27cfccabb725
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.6 Linux/5.15.0-84-generic

Release files / mussel-1.1.0-py3-none-any.whl

Download URL mussel-1.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74d4803f80b1ddf13e0331a35dee306be3acce52f33ff24b9ac43e81ca029c63
BLAKE2b-256 checksum
How to use checksums
e5b8a60004772f1dccbd7f982c29cbbdf4e32266209d4a95dedc48dd72798f66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.6 Linux/5.15.0-84-generic

Security for mussel 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page