https://github.com/pri22296/pywrap
https://github.com/pri22296/pywrap
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pri22296/pywrap
- Owner: pri22296
- Created: 2017-05-28T08:48:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T10:39:21.000Z (about 8 years ago)
- Last Synced: 2025-01-29T21:28:06.433Z (5 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
What is **pywrap**
==================It is a generic command line wrapper for Python. It translates various python constructs
to their command line equivalents which means that it is limited in certain aspects where
the python language offers no equivalent construct.Usage
=====**pywrap** can be used to wrap around any command line tool. Let's
see an example with our favourite vcs `git`.. code:: python
from pywrap import Command
git = Command('git') # Create wrapper- `git(help=True)` will be translated to `git --help`
- `git.commit(message='My commit message')` will be translated to `git commit --message 'My commit message'`
- `git.push('origin', 'development')` will be translated to `git push origin master`Overview
========- attribute lookup are translated to sub-commands.
- keyword arguments are translated to flags. Both short and long form are supported.
- positional arguments are translated to well, positional arguments.
- `True` and `None` can be used as values for keyword arguments when the underlying flags takes no parameters.Some things to Note
===================- This project is in very early stagea. It will be someday on PyPI. can't say when.
- It is usual to have command line parameters to contain a `-`. Since a variable cannot have `-` in python, An `_` is translated to a `-`. You can escape
this behaviour with another `_`.
- It is obvious that the **Command** objects would not provide docstrings. The calls are directly translated to command line statements. No validation is
performed.Contribute
==========Please submit any issues or Feature requests in the issue tracker. PR's are most welcome.
License
=======TODO