https://github.com/agoose77/xontrib-mod
Lazily access modules without importing them first.
https://github.com/agoose77/xontrib-mod
helper import shell xonsh xontrib
Last synced: 2 months ago
JSON representation
Lazily access modules without importing them first.
- Host: GitHub
- URL: https://github.com/agoose77/xontrib-mod
- Owner: agoose77
- License: mit
- Created: 2021-11-04T10:39:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-20T09:51:28.000Z (over 3 years ago)
- Last Synced: 2024-10-24T15:38:51.655Z (8 months ago)
- Topics: helper, import, shell, xonsh, xontrib
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xontrib-mod
[![pypi-badge][]][pypi][pypi-badge]: https://img.shields.io/pypi/v/xontrib-mod
[pypi]: https://pypi.org/project/xontrib-mod
Xonsh pushes the user towards Pythonic contructs over shell pipelines of general purpose tools (think `xargs` and friends), but these constructs are generally more verbose to use. This is in part due to the need to import them from the Python path with `import ...`. Given that the shell rewards ease-of-writing over verbosity, this can make writing shell script in Python a less enjoyable experience for shell programmers.
Enter `mod`. `mod` is a simple xontrib that defines a `mod` builtin that attempts to resolve modules and their attributes:
```pycon
>>> xontrib load mod
>>> mod.json.loads($(echo "[1, 2, 3]"))
[1, 2, 3]
```