simplifiedcli 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. simplifiedcli-1.0.0/.gitignore +242 -0
  2. simplifiedcli-1.0.0/.idea/.gitignore +10 -0
  3. simplifiedcli-1.0.0/.idea/SimplifiedCLI.iml +17 -0
  4. simplifiedcli-1.0.0/.idea/dataSources.xml +12 -0
  5. simplifiedcli-1.0.0/.idea/inspectionProfiles/Project_Default.xml +58 -0
  6. simplifiedcli-1.0.0/.idea/misc.xml +18 -0
  7. simplifiedcli-1.0.0/.idea/modules.xml +8 -0
  8. simplifiedcli-1.0.0/.idea/runConfigurations/basic.xml +26 -0
  9. simplifiedcli-1.0.0/.idea/runConfigurations/build.xml +17 -0
  10. simplifiedcli-1.0.0/.idea/runConfigurations/install_deps.xml +17 -0
  11. simplifiedcli-1.0.0/.idea/runConfigurations/test_simpcli_py.xml +19 -0
  12. simplifiedcli-1.0.0/.idea/runConfigurations/tests.xml +26 -0
  13. simplifiedcli-1.0.0/.idea/scopes/Spellcheck.xml +3 -0
  14. simplifiedcli-1.0.0/.idea/vcs.xml +6 -0
  15. simplifiedcli-1.0.0/PKG-INFO +68 -0
  16. simplifiedcli-1.0.0/README.md +58 -0
  17. simplifiedcli-1.0.0/pyproject.toml +64 -0
  18. simplifiedcli-1.0.0/setup.cfg +4 -0
  19. simplifiedcli-1.0.0/src/examples/basic.py +49 -0
  20. simplifiedcli-1.0.0/src/simpcli/__init__.py +295 -0
  21. simplifiedcli-1.0.0/src/simplifiedcli.egg-info/PKG-INFO +68 -0
  22. simplifiedcli-1.0.0/src/simplifiedcli.egg-info/SOURCES.txt +27 -0
  23. simplifiedcli-1.0.0/src/simplifiedcli.egg-info/dependency_links.txt +1 -0
  24. simplifiedcli-1.0.0/src/simplifiedcli.egg-info/requires.txt +4 -0
  25. simplifiedcli-1.0.0/src/simplifiedcli.egg-info/top_level.txt +2 -0
  26. simplifiedcli-1.0.0/test/conftest.py +1 -0
  27. simplifiedcli-1.0.0/test/test_simpcli.py +335 -0
  28. simplifiedcli-1.0.0/tox.ini +27 -0
  29. simplifiedcli-1.0.0/uv.lock +172 -0
@@ -0,0 +1,242 @@
1
+ ### PyCharm template
2
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
4
+
5
+ # User-specific stuff
6
+ .idea/**/workspace.xml
7
+ .idea/**/tasks.xml
8
+ .idea/**/usage.statistics.xml
9
+ .idea/**/dictionaries
10
+ .idea/**/shelf
11
+
12
+ # AWS User-specific
13
+ .idea/**/aws.xml
14
+
15
+ # Generated files
16
+ .idea/**/contentModel.xml
17
+
18
+ # Sensitive or high-churn files
19
+ .idea/**/dataSources/
20
+ .idea/**/dataSources.ids
21
+ .idea/**/dataSources.local.xml
22
+ .idea/**/sqlDataSources.xml
23
+ .idea/**/dynamic.xml
24
+ .idea/**/uiDesigner.xml
25
+ .idea/**/dbnavigator.xml
26
+
27
+ # Gradle
28
+ .idea/**/gradle.xml
29
+ .idea/**/libraries
30
+
31
+ # Gradle and Maven with auto-import
32
+ # When using Gradle or Maven with auto-import, you should exclude module files,
33
+ # since they will be recreated, and may cause churn. Uncomment if using
34
+ # auto-import.
35
+ # .idea/artifacts
36
+ # .idea/compiler.xml
37
+ # .idea/jarRepositories.xml
38
+ # .idea/modules.xml
39
+ # .idea/*.iml
40
+ # .idea/modules
41
+ # *.iml
42
+ # *.ipr
43
+
44
+ # CMake
45
+ cmake-build-*/
46
+
47
+ # Mongo Explorer plugin
48
+ .idea/**/mongoSettings.xml
49
+
50
+ # File-based project format
51
+ *.iws
52
+
53
+ # IntelliJ
54
+ out/
55
+
56
+ # mpeltonen/sbt-idea plugin
57
+ .idea_modules/
58
+
59
+ # JIRA plugin
60
+ atlassian-ide-plugin.xml
61
+
62
+ # Cursive Clojure plugin
63
+ .idea/replstate.xml
64
+
65
+ # SonarLint plugin
66
+ .idea/sonarlint/
67
+
68
+ # Crashlytics plugin (for Android Studio and IntelliJ)
69
+ com_crashlytics_export_strings.xml
70
+ crashlytics.properties
71
+ crashlytics-build.properties
72
+ fabric.properties
73
+
74
+ # Editor-based Rest Client
75
+ .idea/httpRequests
76
+
77
+ # Android studio 3.1+ serialized cache file
78
+ .idea/caches/build_file_checksums.ser
79
+
80
+ ### Python template
81
+ # Byte-compiled / optimized / DLL files
82
+ __pycache__/
83
+ *.py[cod]
84
+ *$py.class
85
+
86
+ # C extensions
87
+ *.so
88
+
89
+ # Distribution / packaging
90
+ .Python
91
+ build/
92
+ develop-eggs/
93
+ dist/
94
+ downloads/
95
+ eggs/
96
+ .eggs/
97
+ lib/
98
+ lib64/
99
+ parts/
100
+ sdist/
101
+ var/
102
+ wheels/
103
+ share/python-wheels/
104
+ *.egg-info/
105
+ .installed.cfg
106
+ *.egg
107
+ MANIFEST
108
+
109
+ # PyInstaller
110
+ # Usually these files are written by a python script from a template
111
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
112
+ *.manifest
113
+ *.spec
114
+
115
+ # Installer logs
116
+ pip-log.txt
117
+ pip-delete-this-directory.txt
118
+
119
+ # Unit test / coverage reports
120
+ htmlcov/
121
+ .tox/
122
+ .nox/
123
+ .coverage
124
+ .coverage.*
125
+ .cache
126
+ nosetests.xml
127
+ coverage.xml
128
+ *.cover
129
+ *.py,cover
130
+ .hypothesis/
131
+ .pytest_cache/
132
+ cover/
133
+
134
+ # Translations
135
+ *.mo
136
+ *.pot
137
+
138
+ # Django stuff:
139
+ *.log
140
+ local_settings.py
141
+ db.sqlite3
142
+ db.sqlite3-journal
143
+
144
+ # Flask stuff:
145
+ instance/
146
+ .webassets-cache
147
+
148
+ # Scrapy stuff:
149
+ .scrapy
150
+
151
+ # Sphinx documentation
152
+ docs/_build/
153
+
154
+ # PyBuilder
155
+ .pybuilder/
156
+ target/
157
+
158
+ # Jupyter Notebook
159
+ .ipynb_checkpoints
160
+
161
+ # IPython
162
+ profile_default/
163
+ ipython_config.py
164
+
165
+ # pyenv
166
+ # For a library or package, you might want to ignore these files since the code is
167
+ # intended to run in multiple environments; otherwise, check them in:
168
+ # .python-version
169
+
170
+ # pipenv
171
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
172
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
173
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
174
+ # install all needed dependencies.
175
+ #Pipfile.lock
176
+
177
+ # poetry
178
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
179
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
180
+ # commonly ignored for libraries.
181
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
182
+ #poetry.lock
183
+
184
+ # pdm
185
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
186
+ #pdm.lock
187
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
188
+ # in version control.
189
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
190
+ .pdm.toml
191
+ .pdm-python
192
+ .pdm-build/
193
+
194
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
195
+ __pypackages__/
196
+
197
+ # Celery stuff
198
+ celerybeat-schedule
199
+ celerybeat.pid
200
+
201
+ # SageMath parsed files
202
+ *.sage.py
203
+
204
+ # Environments
205
+ .env
206
+ .venv
207
+ env/
208
+ venv/
209
+ ENV/
210
+ env.bak/
211
+ venv.bak/
212
+
213
+ # Spyder project settings
214
+ .spyderproject
215
+ .spyproject
216
+
217
+ # Rope project settings
218
+ .ropeproject
219
+
220
+ # mkdocs documentation
221
+ /site
222
+
223
+ # mypy
224
+ .mypy_cache/
225
+ .dmypy.json
226
+ dmypy.json
227
+
228
+ # Pyre type checker
229
+ .pyre/
230
+
231
+ # pytype static type analyzer
232
+ .pytype/
233
+
234
+ # Cython debug symbols
235
+ cython_debug/
236
+
237
+ # PyCharm
238
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
239
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
240
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
241
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
242
+ #.idea/
@@ -0,0 +1,10 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Ignored default folder with query files
5
+ /queries/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
9
+ # Editor-based HTTP Client requests
10
+ /httpRequests/
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
6
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
7
+ <excludeFolder url="file://$MODULE_DIR$/.idea/dataSources" />
8
+ <excludeFolder url="file://$MODULE_DIR$/.idea/dictionaries" />
9
+ <excludeFolder url="file://$MODULE_DIR$/.venv" />
10
+ <excludeFolder url="file://$MODULE_DIR$/htmlcov" />
11
+ <excludeFolder url="file://$MODULE_DIR$/src/simpcli.egg-info" />
12
+ <excludeFolder url="file://$MODULE_DIR$/dist" />
13
+ </content>
14
+ <orderEntry type="jdk" jdkName="uv (SimplifiedCLI)" jdkType="Python SDK" />
15
+ <orderEntry type="sourceFolder" forTests="false" />
16
+ </component>
17
+ </module>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
4
+ <data-source source="LOCAL" name=".coverage" uuid="f3e53f86-1198-476b-ad4e-e4500ad657c3">
5
+ <driver-ref>sqlite.xerial</driver-ref>
6
+ <synchronize>true</synchronize>
7
+ <jdbc-driver>org.sqlite.JDBC</jdbc-driver>
8
+ <jdbc-url>jdbc:sqlite:$PROJECT_DIR$/.coverage</jdbc-url>
9
+ <working-dir>$ProjectFileDir$</working-dir>
10
+ </data-source>
11
+ </component>
12
+ </project>
@@ -0,0 +1,58 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
5
+ <option name="myValues">
6
+ <value>
7
+ <list size="7">
8
+ <item index="0" class="java.lang.String" itemvalue="nobr" />
9
+ <item index="1" class="java.lang.String" itemvalue="noembed" />
10
+ <item index="2" class="java.lang.String" itemvalue="comment" />
11
+ <item index="3" class="java.lang.String" itemvalue="noscript" />
12
+ <item index="4" class="java.lang.String" itemvalue="embed" />
13
+ <item index="5" class="java.lang.String" itemvalue="script" />
14
+ <item index="6" class="java.lang.String" itemvalue="ql" />
15
+ </list>
16
+ </value>
17
+ </option>
18
+ <option name="myCustomValuesEnabled" value="true" />
19
+ </inspection_tool>
20
+ <inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
21
+ <option name="ourVersions">
22
+ <value>
23
+ <list size="2">
24
+ <item index="0" class="java.lang.String" itemvalue="3.13" />
25
+ <item index="1" class="java.lang.String" itemvalue="3.14" />
26
+ </list>
27
+ </value>
28
+ </option>
29
+ </inspection_tool>
30
+ <inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
31
+ <option name="ignoredBaseClasses">
32
+ <list>
33
+ <option value="unittest.TestCase" />
34
+ <option value="unittest.case.TestCase" />
35
+ <option value="win32serviceutil.ServiceFramework" />
36
+ <option value="System.Object" />
37
+ <option value="System.Array" />
38
+ <option value="wx.core.Object" />
39
+ <option value="System.Collections.IComparer" />
40
+ <option value="System.Collections.IDictionary" />
41
+ <option value="System.Collections.ICollection" />
42
+ <option value="System.Collections.Stack" />
43
+ <option value="System.Collections.SortedList" />
44
+ <option value="System.Reflection.TypeInfo" />
45
+ </list>
46
+ </option>
47
+ </inspection_tool>
48
+ <inspection_tool class="PyShadowingBuiltinsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false">
49
+ <option name="ignoredNames">
50
+ <list>
51
+ <option value="filter" />
52
+ </list>
53
+ </option>
54
+ </inspection_tool>
55
+ <inspection_tool class="PyShadowingNamesInspection" enabled="true" level="INFORMATION" enabled_by_default="true" />
56
+ <inspection_tool class="PyUnusedLocalInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
57
+ </profile>
58
+ </component>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="uv (SimplifiedCLI)" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="uv (SimplifiedCLI)" project-jdk-type="Python SDK" />
7
+ <component name="PythonCompatibilityInspectionAdvertiser">
8
+ <option name="version" value="3" />
9
+ </component>
10
+ <component name="RuffConfiguration">
11
+ <option name="enabled" value="true" />
12
+ <option name="executableDiscoveryMode" value="PATH" />
13
+ </component>
14
+ <component name="TyConfiguration">
15
+ <option name="enabled" value="true" />
16
+ <option name="executableDiscoveryMode" value="PATH" />
17
+ </component>
18
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/SimplifiedCLI.iml" filepath="$PROJECT_DIR$/.idea/SimplifiedCLI.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,26 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="basic" type="PythonConfigurationType" factoryName="Python" folderName="examples" nameIsGenerated="true">
3
+ <module name="SimplifiedCLI" />
4
+ <option name="ENV_FILES" value="" />
5
+ <option name="INTERPRETER_OPTIONS" value="" />
6
+ <option name="PARENT_ENVS" value="true" />
7
+ <envs>
8
+ <env name="PYTHONUNBUFFERED" value="1" />
9
+ </envs>
10
+ <option name="SDK_HOME" value="" />
11
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
12
+ <option name="IS_MODULE_SDK" value="true" />
13
+ <option name="ADD_CONTENT_ROOTS" value="true" />
14
+ <option name="ADD_SOURCE_ROOTS" value="true" />
15
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
16
+ <option name="RUN_TOOL" value="true" />
17
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/examples/basic.py" />
18
+ <option name="PARAMETERS" value="no positional_args 1 2" />
19
+ <option name="SHOW_COMMAND_LINE" value="false" />
20
+ <option name="EMULATE_TERMINAL" value="false" />
21
+ <option name="MODULE_MODE" value="false" />
22
+ <option name="REDIRECT_INPUT" value="false" />
23
+ <option name="INPUT_FILE" value="" />
24
+ <method v="2" />
25
+ </configuration>
26
+ </component>
@@ -0,0 +1,17 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="build" type="ShConfigurationType">
3
+ <option name="SCRIPT_TEXT" value="uv --native-tls build" />
4
+ <option name="INDEPENDENT_SCRIPT_PATH" value="true" />
5
+ <option name="SCRIPT_PATH" value="" />
6
+ <option name="SCRIPT_OPTIONS" value="" />
7
+ <option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
8
+ <option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
9
+ <option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
10
+ <option name="INTERPRETER_PATH" value="powershell.exe" />
11
+ <option name="INTERPRETER_OPTIONS" value="" />
12
+ <option name="EXECUTE_IN_TERMINAL" value="false" />
13
+ <option name="EXECUTE_SCRIPT_FILE" value="false" />
14
+ <envs />
15
+ <method v="2" />
16
+ </configuration>
17
+ </component>
@@ -0,0 +1,17 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="install deps" type="ShConfigurationType">
3
+ <option name="SCRIPT_TEXT" value="uv --native-tls sync --all-extras" />
4
+ <option name="INDEPENDENT_SCRIPT_PATH" value="true" />
5
+ <option name="SCRIPT_PATH" value="" />
6
+ <option name="SCRIPT_OPTIONS" value="" />
7
+ <option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
8
+ <option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
9
+ <option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
10
+ <option name="INTERPRETER_PATH" value="powershell.exe" />
11
+ <option name="INTERPRETER_OPTIONS" value="" />
12
+ <option name="EXECUTE_IN_TERMINAL" value="false" />
13
+ <option name="EXECUTE_SCRIPT_FILE" value="false" />
14
+ <envs />
15
+ <method v="2" />
16
+ </configuration>
17
+ </component>
@@ -0,0 +1,19 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="test_simpcli.py" type="tests" factoryName="Autodetect">
3
+ <module name="SimplifiedCLI" />
4
+ <option name="ENV_FILES" value="" />
5
+ <option name="INTERPRETER_OPTIONS" value="" />
6
+ <option name="PARENT_ENVS" value="true" />
7
+ <option name="SDK_HOME" value="" />
8
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
9
+ <option name="IS_MODULE_SDK" value="true" />
10
+ <option name="ADD_CONTENT_ROOTS" value="true" />
11
+ <option name="ADD_SOURCE_ROOTS" value="true" />
12
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
13
+ <option name="RUN_TOOL" value="true" />
14
+ <option name="_new_additionalArguments" value="&quot;&quot;" />
15
+ <option name="_new_target" value="&quot;$PROJECT_DIR$/test/test_simpcli.py&quot;" />
16
+ <option name="_new_targetType" value="&quot;PATH&quot;" />
17
+ <method v="2" />
18
+ </configuration>
19
+ </component>
@@ -0,0 +1,26 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="tests" type="Tox" factoryName="Tox">
3
+ <module name="SimplifiedCLI" />
4
+ <option name="ENV_FILES" value="" />
5
+ <option name="INTERPRETER_OPTIONS" value="" />
6
+ <option name="PARENT_ENVS" value="true" />
7
+ <envs>
8
+ <env name="PYTHONUNBUFFERED" value="1" />
9
+ </envs>
10
+ <option name="SDK_HOME" value="$PROJECT_DIR$/.venv/Scripts/python.exe" />
11
+ <option name="SDK_NAME" value="uv (SimplifiedCLI)" />
12
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
13
+ <option name="IS_MODULE_SDK" value="false" />
14
+ <option name="ADD_CONTENT_ROOTS" value="true" />
15
+ <option name="ADD_SOURCE_ROOTS" value="true" />
16
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
17
+ <option name="RUN_TOOL" value="" />
18
+ <arguments>
19
+ <array />
20
+ </arguments>
21
+ <runOnlyEnvs>
22
+ <array />
23
+ </runOnlyEnvs>
24
+ <method v="2" />
25
+ </configuration>
26
+ </component>
@@ -0,0 +1,3 @@
1
+ <component name="DependencyValidationManager">
2
+ <scope name="Spellcheck" pattern="!file:uv.lock" />
3
+ </component>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,68 @@
1
+ Metadata-Version: 2.4
2
+ Name: simplifiedcli
3
+ Version: 1.0.0
4
+ Summary: A simplified command line interface.
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Provides-Extra: dev
8
+ Requires-Dist: tox>=4.33.0; extra == "dev"
9
+ Requires-Dist: pytest>=8.4.2; extra == "dev"
10
+
11
+ # SimplifiedCLI
12
+
13
+ **A simple CLI for python applications.**
14
+
15
+ ## Basic Example:
16
+
17
+ ```python
18
+ """Basic example."""
19
+
20
+ from __future__ import annotations
21
+
22
+ from typing import TYPE_CHECKING
23
+
24
+ from simpcli import Manager
25
+ from simpcli import get_logger
26
+
27
+ if TYPE_CHECKING: # pragma: no cover
28
+ from logging import Logger
29
+
30
+ from simpcli import Result
31
+
32
+ __version__: str = "0.0.1"
33
+
34
+ logger: Logger = get_logger(__name__)
35
+
36
+
37
+ manager: Manager = Manager(prog=__name__, version=__version__)
38
+
39
+
40
+ @manager.command()
41
+ def no_args() -> Result:
42
+ """Command with no arguments."""
43
+ logger.info("no_args")
44
+ return 0
45
+
46
+
47
+ @manager.command()
48
+ @manager.parameter("one", type=str)
49
+ @manager.parameter("two", type=int)
50
+ def positional_args(one: str, two: int) -> Result:
51
+ """Command with positional arguments."""
52
+ logger.info("positional_args %s %s", one, two)
53
+ return 0
54
+
55
+
56
+ @manager.command()
57
+ @manager.parameter("param", type=str)
58
+ @manager.parameter("-f", "--flag", action="store_true", type=bool)
59
+ def optional_args(param: str, flag: bool = False) -> Result: # noqa: FBT001, FBT002
60
+ """Command with optional arguments."""
61
+ logger.info("flags %s %s", param, flag)
62
+ return 0
63
+
64
+
65
+ if __name__ == "__main__":
66
+ manager.handle_main()
67
+
68
+ ```
@@ -0,0 +1,58 @@
1
+ # SimplifiedCLI
2
+
3
+ **A simple CLI for python applications.**
4
+
5
+ ## Basic Example:
6
+
7
+ ```python
8
+ """Basic example."""
9
+
10
+ from __future__ import annotations
11
+
12
+ from typing import TYPE_CHECKING
13
+
14
+ from simpcli import Manager
15
+ from simpcli import get_logger
16
+
17
+ if TYPE_CHECKING: # pragma: no cover
18
+ from logging import Logger
19
+
20
+ from simpcli import Result
21
+
22
+ __version__: str = "0.0.1"
23
+
24
+ logger: Logger = get_logger(__name__)
25
+
26
+
27
+ manager: Manager = Manager(prog=__name__, version=__version__)
28
+
29
+
30
+ @manager.command()
31
+ def no_args() -> Result:
32
+ """Command with no arguments."""
33
+ logger.info("no_args")
34
+ return 0
35
+
36
+
37
+ @manager.command()
38
+ @manager.parameter("one", type=str)
39
+ @manager.parameter("two", type=int)
40
+ def positional_args(one: str, two: int) -> Result:
41
+ """Command with positional arguments."""
42
+ logger.info("positional_args %s %s", one, two)
43
+ return 0
44
+
45
+
46
+ @manager.command()
47
+ @manager.parameter("param", type=str)
48
+ @manager.parameter("-f", "--flag", action="store_true", type=bool)
49
+ def optional_args(param: str, flag: bool = False) -> Result: # noqa: FBT001, FBT002
50
+ """Command with optional arguments."""
51
+ logger.info("flags %s %s", param, flag)
52
+ return 0
53
+
54
+
55
+ if __name__ == "__main__":
56
+ manager.handle_main()
57
+
58
+ ```