Skip to main content

os-independent

library for easier work with different system platforms such as config files, path stuff and so on...

example

from os_independent import OSIndependent

osi = OSIndependent("project_name")
# by default empty config is {"editor": "nano"}

# gets the config file for project_name, useful for cli's and command line stuff
# all config files are stored at either ~, ~/.config or %APPDATA%
print(osi.get_config()) # {"editor": "nano"}

# add new stuff to the config
osi.config["meow"] = "that"
osi.save_config()
# --- or ---
# this variant saves the config immediately after adding new stuff
osi.add_to_config({"meow": "that"})

# calls osi.cli_edit(osi.config_path)
# which in this case runs "nano ~/.config/project_name.json" in your terminal
osi.edit_config()

# reset config, in this case it will return to {"editor": "nano"}
osi.reset_config()

# cli stuff
# cli_edit in this case runs "nano <path>"
osi.cli_edit(path)

# cli_read in linux runs "less <path>"
osi.cli_read(path)

# you can also run this to return the contents of path in terminal instead
osi.cli_read(path, print_in_terminal = True)

things might be a bit different on other systems

Download files

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

Source Distribution

os_independent-1.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

os_independent-1.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file os_independent-1.0.1.tar.gz.

File metadata

  • Download URL: os_independent-1.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for os_independent-1.0.1.tar.gz
Algorithm Hash digest
SHA256 194cbc999b861c4cebab7a51f5eebfd443d13c004103cfc261441d8db762dab1
MD5 8fa86f964ff16007bf352f202a2a43d3
BLAKE2b-256 e06c75ce1850c89d97bca103afbf7508e67c02d89d81726ea52c1d27156d76ed

See more details on using hashes here.

File details

Details for the file os_independent-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: os_independent-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for os_independent-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb7b435254c771fb1b6d81b48e06ec85856e670fca4373c7e000d301965fd67
MD5 a405a1ed2285954187a682013fd198c8
BLAKE2b-256 7c52ac689288e00d8f80573154555756019a2ba0cf273d316761f827315de9cc

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.2

2 files

This release

1.0.1 This release

2 files

1.0.0

2 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