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.2.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.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: os_independent-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 59a3450a5806d98c5165ae377792a5e4580e993fc86fb5082c9d73a7791df3c9
MD5 d43766787ee37fdb8ec4d28c6927521a
BLAKE2b-256 c0322d274a3ae64dd0f8420653046af8cc2a32a659965eef324e48e2a8aac34c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: os_independent-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f374c6deedbbdc3e26d42a6c0504bbd96ed9bab247298fefe09139f9f2ca8015
MD5 7f0d0eebe4205c8232b06d43f156ea21
BLAKE2b-256 bf53cd7640cfa53f74a7c10eff281195eaeb73c9644e065dc69678fca5d4c891

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

1.0.1

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