Skip to main content

Python Cross Platform Toolkit for Windows and Linux variables, shortcuts and start menu shortcuts

Simple Cross Platform creation of shortcuts and Persistent Environment Variables

image PyPI - Python Version

Build Status Downloads

Installing

Install and update using pip:

pip install pycrosskit

or

pip3 install pycrosskit

Supported Platforms:

  • Linux
  • Windows

Shortcuts usage:

from pycrosskit.shortcuts import Shortcut

# Will Create shortcut 
# * at Desktop if desktop is True 
# * at Start Menu if start_menu is True

Shortcut(shortcut_name="My Spaghetti Shortcut", exec_path="/usr/bin/order_spaghetti", description="Such Yummy Spaghetti",
         icon_path="/home/.../spaghetti.png", desktop=True, start_menu=True)

# Will Delete shortcut
# * at Desktop if desktop is True 
# * at Start Menu if start_menu is True
Shortcut.delete(shortcut_name="My Spaghetti Shortcut", desktop=True, start_menu=True)

Environment Variables usage:

Accessing and write to environment variables is automatically handled based on your system Lin/Win SysEnv class is implemented as a singleton metaclass so don't be afraid about multiple instances

Support of Mac env variables on request

from pycrosskit.envariables import SysEnv

### ** Linux ** 

# Will Set Persistent Value for Variable in Systems bashrc file or custom one that you can pass
SysEnv().set(key="spaghetti", value="boloneys", shell_file="~/.zsh")

# Will Get Persistent Value for Variable in System
# * reg_path works only for windows as register path
# * registry works only for windows, if is False variable is obtained from User Environment Variables
SysEnv().get(key="spaghetti", shell_file="~/.zsh", shell="zsh")

# Will unset variable from your environment or registry
SysEnv().unset(key="spaghetti", shell_file="~/.zsh")

# For not having to override argument shell_file or shell
# This saves specs for every access, default arguments are ignored
SysEnv.save_shell_specs(shell="zsh", shell_file="~/.zsh")

### ** Windows **

# Will Set Persistent Value for Variable in System
# * subkey works only for windows like file in folder
# * reg_path works only for windows as register path (is ignored if registry=False) 
# * registry works only for windows, if is False variable is saved to User Environment Variables
SysEnv().set(key="spaghetti", value="bologna", subkey="italian_food", reg_path="HKEY-...\\CustomPath",
             registry=True)

# Will Get Persistent Value for Variable in System
# * reg_path works only for windows as register path
# * registry works only for windows, if is False variable is obtained from User Environment Variables
SysEnv().get(key="spaghetti", reg_path="HKEY-...\\CustomPath", registry=True)

# Will unset variable from your environment or registry
SysEnv().unset(key="spaghetti", registry=True)

Develop

Clone the repository, then:

# install dependencies and package in editable mode
python -m pip install -U -r requirements.txt
# install development dependencies
python -m pip install -U -e .[dev]
# install git hooks
pre-commit install


Did I made your life less painfull ?

Support my coffee addiction ;)
Buy me a Coffee

Metadata

Release files for pycrosskit 1.7.5

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

Source distribution (sdist)

Source distribution for pycrosskit 1.7.5
File Size Uploaded
pycrosskit-1.7.5.tar.gz 12.6 kB Details

Built distribution (wheel)

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

Total release size: 28.2 kB

Release files / pycrosskit-1.7.5.tar.gz

Download URL pycrosskit-1.7.5.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1d27fa7d150cdf07d41ffcf4a2b4bce2e641967f9a7d3ae4593b4c2e3e312578
BLAKE2b-256 checksum
How to use checksums
53adf8ac5c22fb9aecf614dcc30ec2a69f1922de0acea932810c08134c11956f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.10

Release files / pycrosskit-1.7.5-py3-none-any.whl

Download URL pycrosskit-1.7.5-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a0b57085b6261224c89d232b6cfe5f47fef6ed9c7b3d9042c816636fadf7ab5
BLAKE2b-256 checksum
How to use checksums
921920bef01328063bc9d9a642623aa895077eccef6f91698c199102ab7eb006
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.10
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