Skip to main content

Summary

pyosal is an Operating System Abstraction Layer written in Python. It contains various functions help write cross-platform python code.

see doc/pyosal_api.md or the website above for more information about these functions.

Over time, I will be searching through my projects looking for code like:

if  pyosal.os_name == 'ubuntu':
    do_some_thing_ubu()
elif  pyosal.os_name == 'msys2':
    do_some_thing_msys2()

It might be possible that do_some_thing() is a viable OSAL function to be added to pyosal.

Function Summary

A summary of the functions available are:

Name Type Description
os_name property get OS name/tag
os_version property get OS version info
python_version property get python version info
root_dir property get path for root directory
root_dir_msys2 property get root directory for msys2 shells
userid property get current userid
hostname property get current PC's hostname
os_valid property get list of recognized valid OS names
curr_repo_dir property current repo directory converted to posix
curr_repo_name property current repo name
run_cmd_timeout function run a command in a subprocess, terminate after a timeout
run_cmd function run a command in a subprocess
stdout_flush function flush for stdout
stderr_flush function flush for stderr
xlat_to_win function convert a path to windows i.e. backslashes
xlat_to_posix function convert a path to posix i.e. forward slashes
xlat_dir_to_relative function convert a path to relative to home
abort function abort the current script

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyosal-0.2.2.tar.gz (13.3 kB view details)

Uploaded Source

File details

Details for the file pyosal-0.2.2.tar.gz.

File metadata

  • Download URL: pyosal-0.2.2.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyosal-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7f3e3af844b7f57e427cc702e156ea03a6171f7daa9ab6b8d56a0cb68e5ff7b3
MD5 49021ecdbf4536e9eb64df6adcbaae5e
BLAKE2b-256 fc3389a1329ff1bb8dbe88717797d3a45c31a4f220e39756b9ce18b05850ca85

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.2 This release

1 file

0.2.1

1 file

0.2.0

1 file

0.1.12

1 file

0.1.11

1 file

0.1.10

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

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