So, I’m making an install.sh script to download script files from GitHub to the user’s system. I know downloading to the home directory (~/script_dir/) is typically frowned upon.

For context, this is a directory containing python files, README, requirements, etc. pip dependencies need to be installed before launch. The script would be executed through main.py.

Where would be a good place to download to that won’t clutter the user’s home directory?

Edit: The script is a CLI interface for yt-dlp to make it easier to use. So, it will download files to specified directories on the user’s system.

Edit 2: Appreciate the responses. I forgot to mention this script has a config file it uses for certain parameters, such as default download directory for each category. If a config file doesn’t exist it creates one in the script’s directory and dumps the default values from a default config file (YAML).

Some of you are mentioning this could be a PyPI package. Would I still be able to read/write my config files if I made this a PyPI package?

    • AstroLightz@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      If I made this a PyPi package, would I be able to create a config file to read from it/have it read from a default config file and set that as the user config file?

      • Eager Eagle@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 day ago

        sure, you can store the config in $XDG_CONFIG_HOME/your-app-name/ (the var usually defaults to ~/.config/).

    • infeeeee@lemm.ee
      link
      fedilink
      arrow-up
      3
      ·
      1 day ago

      OP wrote they want to install dependencies as well, that’s why it’s a bit more complex situation. For python scripts without external dependencies it would work.

  • ExperimentalGuy@programming.dev
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    This is hard to say without knowing the use of the scripts. If it’s something to be used as normal CLI tools, probably some place that’s in the user’s path. If it’s something else, I would just have it download to the current working directory so that the user has the choice on where to put it.

    • AstroLightz@lemmy.worldOP
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Updated the post to include more info, but it is a CLI app which helps simplify yt-dlp commands. It doesn’t mess with any system files.

  • Xanza@lemm.ee
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    2
    ·
    edit-2
    2 days ago

    Use dotfiles; ~/.local/script_dir/

    Frankly, this is what pipx is for.