Skip to main content

simpleapp

simpleapp is a python module designed to make it easy to create simple applications for sharing with colleagues who may not have python installed, etc. The initial application area targetted is text processing and conversion. The aim is to enable a relatively weak python programmer (who may only use python occasionally) to be able to write some code to transform some data, but to not to have to worry too much about how to turn what is basically a single function into a full blow application.

The module uses the gooey module to provide a GUI for the command line options.

The two main areas where simpleapp helps is in providing a more sophisticated drop in replacement for argparse (sitting between argparse and gooey) and a pipeline function that can process data in a pipeline.

Here is a motivating example:

import simpleapp, codecs
from simpleapp.pipeline import Pipeline, textinfile, textoutfile

def process(txt, args):
    if args.reverse:
        res = txt.encode('raw_unicode_escape').decode('utf-8')
    else:
        res = txt.encode('utf-8').decode('raw_unicode_escape')
    return res

def main(argv=None):
    parser = simpleapp.ArgumentParser(prog="uniraw")
    parser.add_argument("infiles",nargs="+",help="Input file")
    parser.add_argument("-o","--outfile",help="Output file")
    parser.add_argument("-r","--reverse",action="store_true",help="Expand out Unicode chars")
    args = parser.parse_args(argv)

    Pipeline(args, textinfile, process, textoutfile, defaultext="_output")

if __name__ == "__main__":
    main()

Running this without command line options will bring up a GUI where a user may select multiple files and output them to a directory (or default them to have _output appended to the filename). If all the required command line options (infiles in this case) are given on the command line, no GUI is presented and the app can run file -> file rather than file -> directory for the single input file case. Likewise if the program is run with the -h command line option then help is printed to the terminal.

Having written such an application, it is then possible, using pyinstaller, to bundle the application as a .exe on Windows for users who do not want to install python or use a command line. For example:

pyinstaller -w -F uniraw.py

Will result in a 30+ MB. This seems a lot, but in the modern world, it will be barely noticeable!

Release files for simpleapp 0.1.1

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

Source distribution (sdist)

Source distribution for simpleapp 0.1.1
File Size Uploaded
simpleapp-0.1.1.tar.gz 14.3 kB Details

Built distribution (wheel)

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

Total release size: 29.1 kB

Release files / simpleapp-0.1.1.tar.gz

Download URL simpleapp-0.1.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3b3895bd618574ba694c111a0b5edcda045bbd5f687ea6ecfcc23dcf268b81d2
BLAKE2b-256 checksum
How to use checksums
29ff9f2502e30dfc4939ffee7f81f832d5265ad871fa07e1de51e49c37afa870
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / simpleapp-0.1.1-py3-none-any.whl

Download URL simpleapp-0.1.1-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f43262b2b3be340d5efbecb701614fd4eaf26792f03debe7b936dc4c953043ca
BLAKE2b-256 checksum
How to use checksums
d92eb9c380534e376d0caf77f5db3aac5786f4fb6b9b7e5dba07f1ebbc115925
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1

2 release files

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