Saravanan666/pypi-org huggingface dataset:
Package: xontrib-jedi
Xonsh Python completions usingjedi.If you like the idea click ⭐ on the repo andtweet.InstallationTo install use pip:xpipinstallxontrib-jedi# or: xpip install -U git+https://github.com/xonsh/xontrib-jediUsagexontribloadjedi# TODO: what's next?Examples...Known issues...Releasing your packageBump the version of your package.Create a GitHub release (The release notes are automatically generated as a draft release after each push).And publish withpoetry publish --buildortwineCreditsThis package was created withxontrib cookiecutter template.
Package: xontrib-jump-to-dir
Jump to used before directory by part of the path in xonsh shell.Lightweight zero-dependency implementation ofautojumporzoxideprojects functionality.If you like the idea click ⭐ on the repo andtweet.NoteThis xontrib is usingxonsh sqlite history backendto get statistics by directories you're used to run commands.InstallationTo install use pip:xpipinstallxontrib-jump-to-dir# OR: xpip install -U git+https://github.com/anki-code/xontrib-jump-to-dirUsageInit:# Check that you're using sqlite history in ~/.xonshrc
$XONSH_HISTORY_BACKEND = 'sqlite'
xontrib load jump_to_dirJump to directory by path:mkdir -p /tmp/hello /tmp/world
cd /tmp/hello
echo 1
echo 2
echo 3
cd /tmp/world
echo 1
cd /

j           # Jump to most frequent directory i.e. `/tmp/hello/` because 3 `echo` commands were executed.
j wor       # Jump to directory with `*wor*` in path i.e. `/tmp/world/`.
j t he      # Jump to directory with `*t*he*` in path i.e. `/tmp/hello/`.Jump to directory by command:cd /tmp
echo 112233
cd /
jc 22       # Jump to the directory where `*22*` command executed i.e. `/tmp`.Custom shortcut:$XONTRIB_JUMP_TO_DIR_SHORTCUT = 'z'
xontrib load jump_to_dir
z tm            # Jump to previous directory with `*tm*` in path e.g. `/tmp/`
zc git commit   #Jump to previous directory where `*git*commit*` command executed e.g. `/git/`How it worksThe history database has the commands you run and the directory where you was. The xontrib sorts the directories from history database by count of executed commands and filter them by mask e.g. thej tmcommand will find the directories by mask*tm*. Then you jump into the existing directory with the highest number of executed commands or if you already there to the previous directory by statistics. So if you have no commands that were executed in/exampledirectory please avoid expectation that you can jump to it by runningj ex.If you want to add fallback functionality to jump to any directory by partial path in case of zero result in history database (e.g.j o lo biwill jump to/opt/local/bin) feel free to create PR.Environment variablesXONTRIB_JUMP_TO_DIR_SHORTCUT- shortcut string. Defaultj.XONTRIB_JUMP_TO_DIR_WARNING- show warnings from xontrib. DefaultTrue.CreditsThis package was created withxontrib template.
Package: xontrib-jupyter
Xonsh kernel for Jupyter Notebook and Jupyter Lab allows to execute
xonsh shell commands in a notebook cell.If you like the idea click ⭐ on the repo andtweet.InstallationTo install usexpip:xpip install xontrib-jupyter
# or: xpip install -U git+https://github.com/xonsh/xontrib-jupyter

xontrib load jupyter
xonfig jupyter-kernel --help  # Options for installing.
xonfig jupyter-kernel --user  # Install kernel spec in user config directory.Check the installation:jupyter kernelspec list
# Available kernels:
#  python3    /opt/homebrew/lib/python3.11/site-packages/ipykernel/resources
#  xonsh      /PATH_TO_ENV_PREFIX/share/jupyter/kernels/xonsh

xontrib load jupyter
xonfig jupyter-kernel
# Installing Jupyter kernel spec:
#  root: None
#  prefix: /PATH_TO_ENV_PREFIX/
#  as user: False

xonfig info
#| jupyter          | True
#| jupyter kernel   | /PATH_TO_ENV_PREFIX/share/jupyter/kernels/xonshUsageJupyterJust runJupyter Notebook or JupyterLaband choose xonsh:jupyter notebook
# or
jupyter labEuporieEuporieis a terminal based interactive computing environment.euporie-notebook --kernel-name xonsh  # or change the kernel in UI
# or
euporie-console --kernel-name xonsh  # or change the kernel in UITestinginstall the project with its dependenciespoetryinstall
poetryinstall--only-rootnow start the xonsh shellxonsh--no-rcinside the xonsh shell, you can load the jupyter xontrib and install the kernelxontribloadjupyter# this will install the kernelxonfigjupyter-kernel--user# now start a notebook and choose xonsh kerneljupyternotebookReleasing your packageBump the version of the packagepoetry version patch(or minor/major)Push the changes to the repo and publish withpoereleaseThe release notes are automatically generated as a draft release after each PR.Create a GitHub release from the draft release against the newly pushed tagPublish the package withpoetry publishKnown issuesUncaptured outputSome tools likeAWS CLIusing the uncapturablelesspager to show the output by default. In these cases you need to find the way to disable the pager e.g. set$AWS_PAGER = 'cat'for AWS CLI.CreditsThis package was created withxontrib cookiecutter template.awesome-jupyter- A curated list of awesome Jupyter projects, libraries and resources.
Package: xontrib-jupyter-shell
Xonsh provides a kernel for Jupyter Notebook and Lab so you can execute
xonsh commands in a notebook cell without any additional magic.If you like the idea click ⭐ on the repo andtweet.InstallationTo install usexpip:xpip install xontrib-jupyter-shell
# or: xpip install -U git+https://github.com/xonsh/xontrib-jupyter

xontrib load jupyter
xonfig jupyter-kernel --help  # Options for installing.
xonfig jupyter-kernel --user  # Install kernel spec in user config directory.Check the installation:jupyter kernelspec list
# Available kernels:
#  python3    /opt/homebrew/lib/python3.11/site-packages/ipykernel/resources
#  xonsh      /PATH_TO_ENV_PREFIX/share/jupyter/kernels/xonsh

xontrib load jupyter
xonfig jupyter-kernel
# Installing Jupyter kernel spec:
#  root: None
#  prefix: /PATH_TO_ENV_PREFIX/
#  as user: False

xonfig info
#| jupyter          | True
#| jupyter kernel   | /PATH_TO_ENV_PREFIX/share/jupyter/kernels/xonshUsageJupyterJust runJupyter Notebook or JupyterLaband choose xonsh:jupyter notebook
jupyter labEuporieEuporieis a terminal based interactive computing environment.euporie-notebook
# Change the kernel to xonshReleasing your packageBump the version of the package.The release notes are automatically generated as a draft release after each PR.Create a GitHub release.Publish withpoetry publish --buildortwine.CreditsThis package was created withxontrib cookiecutter template.
Package: xontrib-kitty
xontrib-kittyXonsh hooks for the Kitty terminal emulator.This xontrib provides extra tools for interacting with the combination of
the xonsh shell and the kitty terminal emulator in the best possible way!It provides all of the standard aliases, tab completions, and even matplotlib
integrations! This allows you to render plots right in your terminal!InstallationTo installxontrib-kitty, get the source from your favorite package manager.conda:$condainstall-cconda-forgexontrib-kittypip:$pipinstallxontrib-kittySetupTo usexontrib-kitty, just load it in your current session or in your~/.xonshrcfile with the following line:xontribloadkitty
Package: xontrib-langenv
xontrib-langenvxonshintegration with:PyenvNodenvGoenvRbenvThis xontrib replaces the slowlangenvinitialization with a faster python version (and skips therehashstep), which could save up to ~0.5s for eachlangThe only two exceptions are:goenv, which requires an extrarehash --only-manage-pathsinit stepto set some moreenvironment variablesvirtualenv-initso if you rewrite thatgoenvenv var setting andpyenvvirtualenvinit logic in python and xontribute to this xontrib, you could eliminate the last sources of xonsh langenv startup delay!InstallInstall using pippip install xontrib-langenvUsageAdd to your.xonshrcas follows:PyenvxontribloadpyenvThis xontrib initializespyenvwhenxonshis started.
After initializationpyenvcommands works as they would do in anyclassicshell.Also supportspyenv-virtualenv.NodenvxontribloadnodenvThis xontrib initializesnodenvwhenxonshis started.
After initializationnodenvcommands works as they would do in anyclassicshell.GoenvxontribloadgoenvThis xontrib initializesgoenvwhenxonshis started.
After initializationgoenvcommands works as they would do in anyclassicshell.RbenvxontribloadrbenvThis xontrib initializesrbenvwhenxonshis started.
After initializationrbenvcommands works as they would do in anyclassicshell.Compatibility notesIf you are usingxonshv0.11 (or older) and you have issues with the latest version of this xontrib, try to downgrade it to version 1.0.6.
Package: xontrib-linuxbrew
Add Homebrew's shell environment toxonsh shellon Linux(alternative toshellenv).If you like the idea click ⭐ on the repo to accelerate addingxonsh support to Homebrew.IntroductionHomebrewhas ashellenvcommand to addits environmentto your shell: it adds a few
environment variables (HOMEBREW_PREFIX/CELLAR/REPOSITORY) and updates a few paths (MAN/INFO/PATH).This xontrib automatically translates the defaultbashexport statements ofshellenvintoxonsh.InstallationTo install use pip:xpipinstallxontrib-linuxbrew# or: xpip install -U git+https://github.com/eugenesvk/xontrib-linuxbrewUsageAdd this to your xonsh run control file (~/.xonshrcor~/.config/rc.xsh):xontribloadlinuxbrewSet the level of verbosity via$XONTRIB_LINUXBREW_LOGLEVELto0–3:0 print nothing (fail silently)1 (default) print errors (e.g. can't find brew at default locations)2 print warnings (e.g parsing errors)3 print more verbose messagesKnown issuesOnly default installation paths (~/.linuxbrewand/home/linuxbrew/.linuxbrew) are supported.CreditsThis package was created withxontrib cookiecutter template.
Package: xontrib-log-all-history
persists all shell history in `$HOME/.logs`If you like the idea click ⭐ on the repo andtweet.xontrib log-all-historyTo install use pip:xpipinstallxontrib-log-all-history# or: xpip install -U git+https://github.com/drmikecrowe/xontrib-log-all-historyUsagexontribloadlog_all_history# TODO: what's next?:warning: If you usingSqliteHistorybackend, youmustinclude$XONSH_HISTORY_BACKEND = 'sqlite'beforeloading.  For example:$XONSH_HISTORY_BACKEND = 'sqlite'
xontrib load 'log-all-history'ArchitectureThis plugin intercepts history before sending to theJsonHistoryorSqliteHistorybackend. In short:Take the current command line and append to a history named:$HOME/.logs/$PWD/xonsh-history-{DateTime}.logFor example:~/P/P/x/xontrib-log-all-historycatREADME.md>/dev/null~/P/P/x/xontrib-log-all-historytail$LOG_ALL_HISTORY_FILE2022-03-11.21.17.01catREADME.md>/dev/null~/P/P/x/xontrib-log-all-historyI've been using this method since October in 2019 (both in bash and now xonsh). Here's stats on my logs directory:~/P/P/x/xontrib-log-all-historydu-sh~/.logs
16M/home/mcrowe/.logs~/P/P/x/xontrib-log-all-historyegrep'^201'~/.logs-Rh|cut-b-7|sort|uniq|head-n12019-10~/P/P/x/xontrib-log-all-historyfind~/.logs|wc-l3645~/P/P/x/xontrib-log-all-historySearching HistoryTwo helper aliases are enabled to assist in searching your accumulated history:hgrep-- "H"istory "Grep"This command is simplygrep -ERh {SEARCH_STRING} $HOME/.logs-- it searches all folders.hgrep-- "H"istory in this "D"irectory "Grep"This command is simplygrep -ERh {SEARCH_STRING} $HOME/.logs/$PWD-- it searches all logs you've done in this specific directory. The use-case for this is:You use thepythoncommand frequentlyYou remember using apythoncommand in the past for the current project with a lot of parameters you figured out, but you didn't save it.If you didhgrep python, you'd find many entries.By usinghdgrep python, you find the specific command.Example:~/P/P/x/xontrib-log-all-historyhgrepcat|wc-l1427~/P/P/x/xontrib-log-all-historyhdgrepcat|wc-l10~/P/P/x/xontrib-log-all-history(yes, I did severalcats testing for the readme...)Optional ConfigurationIf you want to place to the logs in a different folder, set:$LOG_ALL_HISTORY_DIR = f"{$HOME}/.all-logs"
xontrib load 'log-all-history'CreditsThis package was created withxontrib cookiecutter template.
Package: xontrib-macro
Library of the usefulmacrosfor thexonsh shell.If you like the idea click ⭐ on the repo andtweet.InstallationTo install use pip:xpipinstallxontrib-macro# or: xpip install -U git+https://github.com/anki-code/xontrib-macroUsageBy loading the whole module - recommended for interactive usage (typemacro.<Tab>):xontrib load macro
with! macro.data.Write('/tmp/hello', replace=True):  # more macros below
    worldBy importing certain macro - recommended for scripts:from xontrib.macro.data import Write
with! Write('/tmp/hello', replace=True):  # more macros below
    worldMacrosBlock (xonsh builtin)fromxonsh.contextsimportBlockwith!Block()asb:anytexthereb.macro_block# 'any\ntext\nhere\n\n'b.lines# ['any', 'text', 'here', '']data.WriteWrite a file from block (rich list of parameters):from xontrib.macro.data import Write

with! Write('/tmp/t/hello.xsh', chmod=0o700, replace=True, makedir=True, format={'name': 'world'}, verbose=True):
    echo {name}
    
## Make directories: /tmp/t
## Write to file: /tmp/t/hello.xsh
## Set chmod: rw- --- ---
## Set exec:  rwx --- ---

/tmp/t/hello.xsh
# worldThere is alsodata.Replace()macro withmode='w', replace=True, makedir=True, replace_keep='a'.Note! There is an upstream issue described below in "Known issues" section - the first lines that begin from#will be ignored in the block. As workaround to createshebanguseWrite(..., shebang="#!/bin/xonsh").data.JsonBlockMake json block and use it as dict:fromxontrib.macro.dataimportJsonBlockwith!JsonBlock()asj:{"hello":"world"}j['hello']# 'world'data.XmlBlockSimple XML macro context manager fromxonsh macro tutorial. This will return the parsed XML tree from a macro blockfrom xontrib.macro.data import XmlBlock

with! XmlBlock() as tree:
    <note>
      <heading>Hello world!</heading>
      <body>
        Hello!
      </body>
    </note>

type(tree)
# xml.etree.ElementTree.Element

tree.find('body').text
# '\n    Hello!\n  'run.OnceRun the code once and save mark about it inXONSH_DATA_DIR.
In the next run the code will not be executed if it was not changed. If the code will be changed it will be executed again.Example:fromxontrib.macro.runimportOncewith!Once('First install'):if$(whichpacman):pacman-Svimhtopelif$(whichapt):aptupdate&&aptinstall-yvimhtopdocker.RunInDockerfrom xontrib.macro.docker import RunInDocker as docker

with! docker():  # default: image='ubuntu', executor='bash'
    echo hello

# hellodocker.RunInXonshDockerfromxontrib.macro.dockerimportRunInXonshDockerasDoxerwith!Doxer():# default: image='xonsh/xonsh:slim', executor='/usr/local/bin/xonsh'echoInstalling...pipinstall-U-qpiplolcatecho"We are in docker container now!"|lolcat# We are in docker container now! (colorized)This is the same as:dockerrun-it--rmxonsh/xonsh:slimxonsh-c@("""pip install -U -q pip lolcatecho "We are in docker container now!" | lolcat""")Known issuesContext Manager Macro picks up comments from outside the block and ignore the initial comments in the block (4207). We can fix it in the xontrib by checking the indentation in the beginning line and the end line. PR is welcome!CreditsThis package was created withxontrib cookiecutter template.
Package: xontrib-mpl
Matplotlib hooks for xonsh, including the new 'mpl' alias that displays the current figure on the screenIf you like the idea click ⭐ on the repo andtweet.InstallationTo install use pip:xpipinstallxontrib-mpl# or: xpip install -U git+https://github.com/xonsh/xontrib-mplUsagexontribloadmpl# TODO: what's next?Examples...Known issues...Releasing your packageBump the version of your package.Create a GitHub release (The release notes are automatically generated as a draft release after each push).And publish withpoetry publish --buildortwineCreditsThis package was created withxontrib cookiecutter template.
Package: xontrib-navi
navi(interactive cli cheatsheet) integration intoxonsh(shell)If you like the idea click ⭐ on the repoInstallxpip install xontrib-navi
# or: xpip install -U git+https://github.com/eugenesvk/xontrib-naviConfigureAdd the following to your.pyxontrib loading config andimportit in your xonsh run control file (~/.xonshrcor~/.config/rc.xsh):fromxonsh.xontribsimportxontribs_loadfromxonsh.built_insimportXSHenvx=XSH.envxontribs=["navi",# Initializes navi (interactive cli cheatsheet)# your other xontribs]# ↓ optional configuration variables (use `False` to disable a keybind)if'navi'inxontribs:# Configure navi only if you're actually loading it# config var      	  value	 |default|alt_cmd¦ commentenvx["X_NAVI_KEY"]="⎈g"#|c-g|   False¦ Autofill existing command with navi's best match or launch navi if no good match foundxontribs_load(xontribs)# actually load all xontribs in the listOr just add this to your xonsh run control filexontrib load navi # Initializes navi (interactive cli cheatsheet)
# configure like in the example above, but replace envx['VAR'] with $VAR
$X_NAVI_KEY	= "c-g" # ...UseAutoreplace the command without invoking any manual selection UI withnavi's best match:git sta⎈ggit statusor hit it again to invoke the manual seletion UI:git status⎈gnavi UIbut failed best match will do nothing:git stu⎈ggit stuSplit multiple commands and only autofill the one at the ‸cursor position:git sta‸; git show⎈ggit status‸; git showls -a‸ | rg 'txt'⎈gls -alt ‸| rg 'txt'Known issuesBottom toolbar may temporary disappear on some invokations of the commands in this xonrib likely due to thisxonsh issueCreditsThis package was created withxontrib template
Package: xontrib-openai
Use Open AI models in xonsh shell.If you like the idea click ⭐ on the repo andtweet.InstallationTo install use pip:xpip install -U xontrib-openai
# or: xpip install -U git+https://github.com/anki-code/xontrib-openaiUsage$OPENAI_API_KEY='abcd1234'# https://platform.openai.com/account/api-keys# Defaults:# $OPENAI_MODEL = 'text-davinci-003'  # https://platform.openai.com/docs/models/overview# $OPENAI_MAX_TOKENS = 500xontribloadopenaiai!hello# Hello! How are you?In case you need addon with new model:aliases['ai4']="$OPENAI_MODEL='gpt-4' $OPENAI_MAX_TOKENS=1000 @('ai')"ai4!hellogpt-4# Hello humanGet shell commandsai!howtogitcommit.Givemeonlycommand# git commit -m "Commit message"ai!howtoremoveallcontainersandimagesindocker.Onlycommandsplease# docker stop $(docker ps -a -q)# docker rm $(docker ps -a -q)# docker rmi $(docker images -a -q)Get Python codeai!sendpostrequestwithjsondataonpython# import requests# import json## url = 'http://example.com/api/1/users'# data = {#   "first_name": "John",#   "last_name": "Smith"# }## headers = {'Content-type': 'application/json'}# response = requests.post(url, data=json.dumps(data), headers=headers)Generate dataai!givemejsonwherekeysarefruitsandvaluesaremostcommonfruitcolor# {#     "Apple": "Red",#     "Banana": "Yellow",#     "Orange": "Orange",#     "Grape": "Purple",#     "Strawberry": "Red",#     "Lemon": "Yellow",#     "Kiwi": "Green",#     "Cherry": "Red",#     "Watermelon": "Green"# }Using the data:importjsonj=json.loads($(aigivemesmalljson))j# {'name': 'John', 'age': 25}Known issuesTo usegpt-4model joinwait list.CreditsThis package was created withxontrib template.
Package: xontrib-pm
Persistent aliases for package managers.If you like the idea click ⭐ on the repo andtweet.InstallationTo install use pip:xpipinstallxontrib-pm# OR: xpip install -U git+https://github.com/anki-code/xontrib-pmUsageAfter loading xontrib-pm is searching the known package managers. If the package manager installed (e.g.pacman) the xontrib adds the aliases e.g.pacman-install,pacman-search, etc. Thepmcommand returns the list of known installed package managers.xontrib load pm
pm
# pacman, brew

# Type `pacman-` and press Tab
pacman-search vim    # sudo pacman -Ss vim
pacman-install vim   # sudo pacman -Sy vimFeel free to extand the list of known package managers.Supported package managersPMs:apt,brew,guix,pacman,port,yum,zap. Feel free to add more, PR is welcome!CommandsThe list of commands that need to have the package manager aliases i.e.<package_manager>-<command>:search- serach the packageinstall- install the packageuninstall- uninstall the packageOptinally:instally(install and say yes) - install without user confirmationinstalled- list of installed packagesAny other useful aliases e.g.pacman-upgrade-everything.CreditsPackage manager-independent bash aliasesThis package was created withxontrib template.
Package: xontrib-powerline
Powerline for Xonsh shell.InstallTo install this xontrib first download and install the python package:pip3installxontrib-powerlineAnd them load it on your.xonshrcxontribloadpowerlineConfigurationThere are two variables that can be set,PL_PROMPTfor the right prompt andPL_TOOLBARfor the bottom toolbar.
They contain a list of sections that can be used separated by>. The value!means not to use that prompt.Examples:$PL_TOOLBAR='who>virtualenv>branch>cwd>full_proc'$PL_TOOLBAR='!'# for no toolbarTo see all available sections typepl_available_sections, and to commit changes to your prompt executepl_build_prompt.More Inforead more on thexontrib docsand if you want to create your own on
thexontrib tutorialCreditsThis package was created by Leonardo Santagada withCookiecutterand thelaerus/cookiecutter-xontribproject template.The font being used on the screenshot is the incredible3270 fontwith injected characters fromnerd fonts.