carconnectivity-cli 0.1a1__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 (24) hide show
  1. carconnectivity_cli-0.1a1/.flake8 +2 -0
  2. carconnectivity_cli-0.1a1/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
  3. carconnectivity_cli-0.1a1/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  4. carconnectivity_cli-0.1a1/.github/dependabot.yml +11 -0
  5. carconnectivity_cli-0.1a1/.github/workflows/build.yml +51 -0
  6. carconnectivity_cli-0.1a1/.github/workflows/build_and_publish.yml +37 -0
  7. carconnectivity_cli-0.1a1/.github/workflows/codeql-analysis.yml +58 -0
  8. carconnectivity_cli-0.1a1/.gitignore +132 -0
  9. carconnectivity_cli-0.1a1/LICENSE +21 -0
  10. carconnectivity_cli-0.1a1/Makefile +22 -0
  11. carconnectivity_cli-0.1a1/PKG-INFO +92 -0
  12. carconnectivity_cli-0.1a1/README.md +48 -0
  13. carconnectivity_cli-0.1a1/pyproject.toml +49 -0
  14. carconnectivity_cli-0.1a1/setup.cfg +4 -0
  15. carconnectivity_cli-0.1a1/setup_requirements.txt +3 -0
  16. carconnectivity_cli-0.1a1/src/carconnectivity_cli/__init__.py +0 -0
  17. carconnectivity_cli-0.1a1/src/carconnectivity_cli/_version.py +16 -0
  18. carconnectivity_cli-0.1a1/src/carconnectivity_cli/carconnectivity_cli_base.py +540 -0
  19. carconnectivity_cli-0.1a1/src/carconnectivity_cli.egg-info/PKG-INFO +92 -0
  20. carconnectivity_cli-0.1a1/src/carconnectivity_cli.egg-info/SOURCES.txt +22 -0
  21. carconnectivity_cli-0.1a1/src/carconnectivity_cli.egg-info/dependency_links.txt +1 -0
  22. carconnectivity_cli-0.1a1/src/carconnectivity_cli.egg-info/entry_points.txt +2 -0
  23. carconnectivity_cli-0.1a1/src/carconnectivity_cli.egg-info/requires.txt +1 -0
  24. carconnectivity_cli-0.1a1/src/carconnectivity_cli.egg-info/top_level.txt +1 -0
@@ -0,0 +1,2 @@
1
+ [flake8]
2
+ max-line-length=160
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: bug
6
+ assignees: tillsteinbach
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Logs**
27
+ IF applicable logs that show the problem. Please take care to remove any confidential data from the logs (e.g. your vehicles VIN number, usernames or passwords)
28
+
29
+ - OS: [e.g. Windows, Linux, MacOS, ...]
30
+ - Version used [e.g. 0.6.2]
31
+
32
+ **Additional context**
33
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: enhancement
6
+ assignees: tillsteinbach
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "daily"
8
+ - package-ecosystem: "pip"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "daily"
@@ -0,0 +1,51 @@
1
+ name: Build Python Package
2
+
3
+ # Controls when the action will run.
4
+ on:
5
+ # Triggers the workflow on push or pull request events but only for the master branch
6
+ push:
7
+ branches: [ main ]
8
+ tags:
9
+ - "v*"
10
+ paths:
11
+ - .github/workflows/build.yml
12
+ - '**.py'
13
+ pull_request:
14
+ paths:
15
+ - .github/workflows/build.yml
16
+ - '**.py'
17
+
18
+ jobs:
19
+ build-python:
20
+ runs-on: ubuntu-latest
21
+ strategy:
22
+ matrix:
23
+ python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
24
+
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+ - name: Install dependencies
32
+ run: |
33
+ python -m pip install --upgrade pip
34
+ if [ -f setup_requirements.txt ]; then pip install -r setup_requirements.txt; fi
35
+ python -m pip install build
36
+ - name: Build
37
+ run: |
38
+ python -m build
39
+ - name: Install built package
40
+ run: |
41
+ pip install dist/*.whl
42
+ - name: Lint
43
+ run: |
44
+ make lint
45
+ # - name: Test
46
+ # run: |
47
+ # make test
48
+
49
+
50
+
51
+
@@ -0,0 +1,37 @@
1
+ name: Build and Upload Python Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ pypi-publish:
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/carconnectivity-cli
14
+ permissions:
15
+ id-token: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.x"
25
+ - name: Install dependencies
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ python -m pip install build twine
29
+ - name: Build
30
+ run: |
31
+ python -m build
32
+ - name: Publish package distributions to PyPI
33
+ uses: pypa/gh-action-pypi-publish@release/v1
34
+
35
+
36
+
37
+
@@ -0,0 +1,58 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - '**.py'
7
+ schedule:
8
+ - cron: '33 5 * * 0'
9
+
10
+ jobs:
11
+ analyze:
12
+ name: Analyze
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ actions: read
16
+ contents: read
17
+ security-events: write
18
+
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ language: [ 'python' ]
23
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
24
+ # Learn more:
25
+ # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
26
+
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+
31
+ # Initializes the CodeQL tools for scanning.
32
+ - name: Initialize CodeQL
33
+ uses: github/codeql-action/init@v3
34
+ with:
35
+ languages: ${{ matrix.language }}
36
+ # If you wish to specify custom queries, you can do so here or in a config file.
37
+ # By default, queries listed here will override any specified in a config file.
38
+ # Prefix the list here with "+" to use these queries and those in the config file.
39
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
40
+
41
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
42
+ # If this step fails, then you should remove it and run the build manually (see below)
43
+ - name: Autobuild
44
+ uses: github/codeql-action/autobuild@v3
45
+
46
+ # ℹ️ Command-line programs to run using the OS shell.
47
+ # 📚 https://git.io/JvXDl
48
+
49
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
50
+ # and modify them (or add more) to build your code if your project
51
+ # uses a compiled language
52
+
53
+ #- run: |
54
+ # make bootstrap
55
+ # make release
56
+
57
+ - name: Perform CodeQL Analysis
58
+ uses: github/codeql-action/analyze@v3
@@ -0,0 +1,132 @@
1
+ #Generated
2
+ _version.py
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ eggs/
19
+ .eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ wheels/
26
+ pip-wheel-metadata/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+
57
+ # Translations
58
+ *.mo
59
+ *.pot
60
+
61
+ # Django stuff:
62
+ *.log
63
+ local_settings.py
64
+ db.sqlite3
65
+ db.sqlite3-journal
66
+
67
+ # Flask stuff:
68
+ instance/
69
+ .webassets-cache
70
+
71
+ # Scrapy stuff:
72
+ .scrapy
73
+
74
+ # Sphinx documentation
75
+ docs/_build/
76
+
77
+ # PyBuilder
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98
+ __pypackages__/
99
+
100
+ # Celery stuff
101
+ celerybeat-schedule
102
+ celerybeat.pid
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .env
109
+ .venv
110
+ env/
111
+ venv/
112
+ ENV/
113
+ env.bak/
114
+ venv.bak/
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mkdocs documentation
124
+ /site
125
+
126
+ # mypy
127
+ .mypy_cache/
128
+ .dmypy.json
129
+ dmypy.json
130
+
131
+ # Pyre type checker
132
+ .pyre/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Till Steinbach
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,22 @@
1
+ MODULE := carconnectivity_cli.carconnectivity_cli_base
2
+ BLUE='\033[0;34m'
3
+ NC='\033[0m' # No Color
4
+
5
+ run:
6
+ @python -m $(MODULE)
7
+
8
+ test:
9
+ @pytest
10
+
11
+ lint:
12
+ @echo "\n${BLUE}Running Pylint against source and test files...${NC}\n"
13
+ @pylint ./src
14
+ @echo "\n${BLUE}Running Flake8 against source and test files...${NC}\n"
15
+ @flake8
16
+ @echo "\n${BLUE}Running Bandit against source files...${NC}\n"
17
+ @bandit -c pyproject.toml -r .
18
+
19
+ clean:
20
+ rm -rf .pytest_cache .coverage .pytest_cache coverage.xml coverage_html_report
21
+
22
+ .PHONY: clean test
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.1
2
+ Name: carconnectivity-cli
3
+ Version: 0.1a1
4
+ Summary: Library for retrieving information from car connectivity services
5
+ Author: Till Steinbach
6
+ License: MIT License
7
+
8
+ Copyright (c) 2021 Till Steinbach
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Classifier: Development Status :: 3 - Alpha
29
+ Classifier: Environment :: Console
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Intended Audience :: End Users/Desktop
32
+ Classifier: Intended Audience :: System Administrators
33
+ Classifier: Programming Language :: Python :: 3.9
34
+ Classifier: Programming Language :: Python :: 3.10
35
+ Classifier: Programming Language :: Python :: 3.11
36
+ Classifier: Programming Language :: Python :: 3.12
37
+ Classifier: Programming Language :: Python :: 3.13
38
+ Classifier: Topic :: Utilities
39
+ Classifier: Topic :: System :: Monitoring
40
+ Requires-Python: >=3.9
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE
43
+ Requires-Dist: argparse
44
+
45
+
46
+
47
+ # CarConnectivity Command Line Interface
48
+ [![GitHub sourcecode](https://img.shields.io/badge/Source-GitHub-green)](https://github.com/tillsteinbach/CarConnectivity-cli/)
49
+ [![GitHub release (latest by date)](https://img.shields.io/github/v/release/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/releases/latest)
50
+ [![GitHub](https://img.shields.io/github/license/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/blob/master/LICENSE)
51
+ [![GitHub issues](https://img.shields.io/github/issues/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/issues)
52
+ [![Donate at PayPal](https://img.shields.io/badge/Donate-PayPal-2997d8)](https://www.paypal.com/donate?hosted_button_id=2BVFF5GJ9SXAJ)
53
+ [![Sponsor at Github](https://img.shields.io/badge/Sponsor-GitHub-28a745)](https://github.com/sponsors/tillsteinbach)
54
+
55
+ ## CarConnectivity will become the successor of [WeConnect-python](https://github.com/tillsteinbach/WeConnect-python) in 2025 with similar functionality but support for other brands beyond Volkswagen!
56
+
57
+ ## Supported Car Brands
58
+ CarConenctivity uses a plugin architecture to enable access to the services of various brands. Currently known plugins are:
59
+
60
+ | Brand | Connector |
61
+ |------------|---------------------------------------------------------------------------------------------------------------|
62
+ | Skoda | [CarConnectivity-connector-skoda](https://github.com/tillsteinbach/CarConnectivity-connector-skoda) |
63
+ | Volkswagen | [CarConnectivity-connector-volkswagen](https://github.com/tillsteinbach/CarConnectivity-connector-volkswagen) |
64
+
65
+ If you know of a connector not listed here let me know and I will add it to the list.
66
+ If you are a python developer and willing to implement a connector for a brand not listed here, let me know and I try to support you as good as possible
67
+
68
+ ## Configuration
69
+ In your carconnectivity.json configuration add a section for the connectors you like to use like this:
70
+ ```
71
+ {
72
+ "carConnectivity": {
73
+ "connectors": [
74
+ {
75
+ "type": "volkswagen",
76
+ "config": {
77
+ "username": "test@test.de"
78
+ "password": "testpassword123"
79
+ }
80
+ },
81
+ {
82
+ "type": "skoda",
83
+ "config": {
84
+ "username": "test@test.de"
85
+ "password": "testpassword123"
86
+ }
87
+ }
88
+ ]
89
+ }
90
+ }
91
+ ```
92
+ The detailed configuration options of the connectors can be found in their README files.
@@ -0,0 +1,48 @@
1
+
2
+
3
+ # CarConnectivity Command Line Interface
4
+ [![GitHub sourcecode](https://img.shields.io/badge/Source-GitHub-green)](https://github.com/tillsteinbach/CarConnectivity-cli/)
5
+ [![GitHub release (latest by date)](https://img.shields.io/github/v/release/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/releases/latest)
6
+ [![GitHub](https://img.shields.io/github/license/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/blob/master/LICENSE)
7
+ [![GitHub issues](https://img.shields.io/github/issues/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/issues)
8
+ [![Donate at PayPal](https://img.shields.io/badge/Donate-PayPal-2997d8)](https://www.paypal.com/donate?hosted_button_id=2BVFF5GJ9SXAJ)
9
+ [![Sponsor at Github](https://img.shields.io/badge/Sponsor-GitHub-28a745)](https://github.com/sponsors/tillsteinbach)
10
+
11
+ ## CarConnectivity will become the successor of [WeConnect-python](https://github.com/tillsteinbach/WeConnect-python) in 2025 with similar functionality but support for other brands beyond Volkswagen!
12
+
13
+ ## Supported Car Brands
14
+ CarConenctivity uses a plugin architecture to enable access to the services of various brands. Currently known plugins are:
15
+
16
+ | Brand | Connector |
17
+ |------------|---------------------------------------------------------------------------------------------------------------|
18
+ | Skoda | [CarConnectivity-connector-skoda](https://github.com/tillsteinbach/CarConnectivity-connector-skoda) |
19
+ | Volkswagen | [CarConnectivity-connector-volkswagen](https://github.com/tillsteinbach/CarConnectivity-connector-volkswagen) |
20
+
21
+ If you know of a connector not listed here let me know and I will add it to the list.
22
+ If you are a python developer and willing to implement a connector for a brand not listed here, let me know and I try to support you as good as possible
23
+
24
+ ## Configuration
25
+ In your carconnectivity.json configuration add a section for the connectors you like to use like this:
26
+ ```
27
+ {
28
+ "carConnectivity": {
29
+ "connectors": [
30
+ {
31
+ "type": "volkswagen",
32
+ "config": {
33
+ "username": "test@test.de"
34
+ "password": "testpassword123"
35
+ }
36
+ },
37
+ {
38
+ "type": "skoda",
39
+ "config": {
40
+ "username": "test@test.de"
41
+ "password": "testpassword123"
42
+ }
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ ```
48
+ The detailed configuration options of the connectors can be found in their README files.
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=61.0",
4
+ "setuptools_scm>=8"
5
+ ]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ name = "carconnectivity-cli"
10
+ description = "Library for retrieving information from car connectivity services"
11
+ dynamic = ["version"]
12
+ requires-python = ">=3.9"
13
+ authors = [
14
+ { name = "Till Steinbach" }
15
+ ]
16
+ dependencies = [
17
+ "argparse"
18
+ ]
19
+ readme = "README.md"
20
+ license = { file = "LICENSE" }
21
+ classifiers = [
22
+ 'Development Status :: 3 - Alpha',
23
+ 'Environment :: Console',
24
+ 'License :: OSI Approved :: MIT License',
25
+ 'Intended Audience :: End Users/Desktop',
26
+ 'Intended Audience :: System Administrators',
27
+ 'Programming Language :: Python :: 3.9',
28
+ 'Programming Language :: Python :: 3.10',
29
+ 'Programming Language :: Python :: 3.11',
30
+ 'Programming Language :: Python :: 3.12',
31
+ 'Programming Language :: Python :: 3.13',
32
+ 'Topic :: Utilities',
33
+ 'Topic :: System :: Monitoring',
34
+ ]
35
+
36
+ [project.urls]
37
+
38
+ [project.scripts]
39
+ carconnectivity-cli = "carconnectivity_cli.carconnectivity_cli_base:main"
40
+
41
+ [tool.setuptools_scm]
42
+ write_to = "src/carconnectivity_cli/_version.py"
43
+
44
+ [tool.pylint.format]
45
+ max-line-length = 160
46
+ ignore-patterns= "_version.py"
47
+
48
+ [tool.bandit]
49
+ targets = "carconnectivity_cli"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ flake8~=7.1.1
2
+ pylint~=3.3.2
3
+ bandit~=1.8.0
@@ -0,0 +1,16 @@
1
+ # file generated by setuptools_scm
2
+ # don't change, don't track in version control
3
+ TYPE_CHECKING = False
4
+ if TYPE_CHECKING:
5
+ from typing import Tuple, Union
6
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
7
+ else:
8
+ VERSION_TUPLE = object
9
+
10
+ version: str
11
+ __version__: str
12
+ __version_tuple__: VERSION_TUPLE
13
+ version_tuple: VERSION_TUPLE
14
+
15
+ __version__ = version = '0.1a1'
16
+ __version_tuple__ = version_tuple = (0, 1)
@@ -0,0 +1,540 @@
1
+ """Module containing the commandline interface for the carconnectivity package."""
2
+ from __future__ import annotations
3
+ from typing import TYPE_CHECKING
4
+
5
+ from enum import Enum
6
+ import sys
7
+ import os
8
+ import argparse
9
+ import logging
10
+ import tempfile
11
+ import cmd
12
+ import json
13
+ import time
14
+ from datetime import datetime
15
+
16
+ from carconnectivity import carconnectivity, errors, util, objects, attributes, observable
17
+ from carconnectivity._version import __version__ as __carconnectivity_version__
18
+
19
+ from carconnectivity_cli._version import __version__
20
+
21
+ if TYPE_CHECKING:
22
+ from typing import Literal, List
23
+ from carconnectivity.objects import GenericObject
24
+ from carconnectivity.attributes import GenericAttribute
25
+
26
+ LOG_LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
27
+ DEFAULT_LOG_LEVEL = "ERROR"
28
+
29
+ LOG = logging.getLogger("carconnectivity-cli")
30
+
31
+
32
+ class Formats(Enum):
33
+ """
34
+ Formats is an enumeration that defines the output formats supported by the application.
35
+
36
+ Attributes:
37
+ STRING (str): Represents the string format.
38
+ JSON (str): Represents the JSON format.
39
+ """
40
+ STRING = 'string'
41
+ JSON = 'json'
42
+
43
+ def __str__(self) -> str:
44
+ return self.value
45
+
46
+
47
+ def main() -> None: # noqa: C901 # pylint: disable=too-many-statements,too-many-branches,too-many-locals
48
+ """
49
+ Entry point for the carconnectivity-cli command-line interface.
50
+
51
+ This function sets up the argument parser, handles logging configuration, and processes commands
52
+ such as 'list', 'get', 'set', 'save', and 'shell'. It interacts with the CarConnectivity service
53
+ to perform various operations based on the provided arguments.
54
+
55
+ Commands:
56
+ - list: Lists available resource IDs and exits.
57
+ - get: Retrieves resources by ID and exits.
58
+ - set: Sets resources by ID and exits.
59
+ - save: Saves resources by ID to a file.
60
+ - shell: Starts the WeConnect shell.
61
+
62
+ Arguments:
63
+ --version: Displays the version of the CLI and CarConnectivity.
64
+ config: Path to the configuration file.
65
+ --tokenfile: File to store the token (default: system temp directory).
66
+ -v, --verbose: Increases logging verbosity.
67
+ --logging-format: Specifies the logging format (default: '%(asctime)s:%(levelname)s:%(message)s').
68
+ --logging-date-format: Specifies the logging date format (default: '%Y-%m-%dT%H:%M:%S%z').
69
+ --hide-repeated-log: Hides repeated log messages from the same module.
70
+ """
71
+ parser = argparse.ArgumentParser(
72
+ prog='carconectivity-cli',
73
+ description='Commandline Interface to interact with Car Services of various brands')
74
+ parser.add_argument('--version', action='version',
75
+ version=f'%(prog)s {__version__} (using CarConnectivity {__carconnectivity_version__})')
76
+ parser.add_argument('config', help='Path to the configuration file')
77
+
78
+ default_temp = os.path.join(tempfile.gettempdir(), 'carconnectivity.token')
79
+ parser.add_argument('--tokenfile', help=f'file to store token (default: {default_temp})', default=default_temp)
80
+ default_cache_temp = os.path.join(tempfile.gettempdir(), 'carconnectivity.cache')
81
+ parser.add_argument('--cachefile', help=f'file to store cache (default: {default_cache_temp})', default=default_cache_temp)
82
+
83
+ logging_group = parser.add_argument_group('Logging')
84
+ logging_group.add_argument('-v', '--verbose', action="append_const", help='Logging level (verbosity)', const=-1,)
85
+ logging_group.add_argument('--logging-format', dest='logging_format', help='Logging format configured for python logging '
86
+ '(default: %%(asctime)s:%%(module)s:%%(message)s)', default='%(asctime)s:%(levelname)s:%(message)s')
87
+ logging_group.add_argument('--logging-date-format', dest='logging_date_format', help='Logging format configured for python logging '
88
+ '(default: %%Y-%%m-%%dT%%H:%%M:%%S%%z)', default='%Y-%m-%dT%H:%M:%S%z')
89
+ logging_group.add_argument('--hide-repeated-log', dest='hide_repeated_log', help='Hide repeated log messages from the same module', action='store_true')
90
+
91
+ parser.set_defaults(command='shell')
92
+
93
+ subparsers = parser.add_subparsers(title='commands', description='Valid commands',
94
+ help='The following commands can be used')
95
+ parser_list: argparse.ArgumentParser = subparsers.add_parser('list', aliases=['l'], help='List available ressource ids and exit')
96
+ parser_list.add_argument('-s', '--setters', help='List attributes that can be set', action='store_true')
97
+ parser_list.set_defaults(command='list')
98
+ parser_get: argparse.ArgumentParser = subparsers.add_parser('get', aliases=['g'], help='Get ressources by id and exit')
99
+ parser_get.add_argument('id', metavar='ID', type=str, help='Id to fetch')
100
+ parser_get.add_argument('--format', type=Formats, default=Formats.STRING, help='Output format', choices=list(Formats))
101
+ parser_get.set_defaults(command='get')
102
+ parser_set: argparse.ArgumentParser = subparsers.add_parser('set', aliases=['s'], help='Set ressources by id and exit')
103
+ parser_set.add_argument('id', metavar='ID', type=str, help='Id to set')
104
+ parser_set.add_argument('value', metavar='VALUE', type=str, help='Value to set')
105
+ parser_set.set_defaults(command='set')
106
+ parser_save: argparse.ArgumentParser = subparsers.add_parser('save', help='Save ressources by id to file')
107
+ parser_save.add_argument('id', metavar='ID', type=str, help='Id to save')
108
+ parser_save.add_argument('filename', metavar='FILENAME', type=str, help='File to save to')
109
+ parser_events = subparsers.add_parser(
110
+ 'events', aliases=['e'], help='Continously retrieve events and show on console')
111
+ parser_events.set_defaults(command='events')
112
+ parser_shell: argparse.ArgumentParser = subparsers.add_parser(
113
+ 'shell', aliases=['sh'], help='Start WeConnect shell')
114
+ parser_shell.set_defaults(command='shell')
115
+
116
+ args = parser.parse_args()
117
+ log_level = LOG_LEVELS.index(DEFAULT_LOG_LEVEL)
118
+ for adjustment in args.verbose or ():
119
+ log_level = min(len(LOG_LEVELS) - 1, max(log_level + adjustment, 0))
120
+
121
+ logging.basicConfig(level=LOG_LEVELS[log_level], format=args.logging_format, datefmt=args.logging_date_format)
122
+ if args.hide_repeated_log:
123
+ for handler in logging.root.handlers:
124
+ handler.addFilter(util.DuplicateFilter())
125
+
126
+ try: # pylint: disable=too-many-nested-blocks
127
+ with open(file=args.config, mode='r', encoding='utf-8') as config_file:
128
+ config_dict = json.load(config_file)
129
+ car_connectivity = carconnectivity.CarConnectivity(config=config_dict, tokenstore_file=args.tokenfile, cache_file=args.cachefile)
130
+
131
+ if args.command == 'shell':
132
+ try:
133
+ car_connectivity.startup()
134
+ CarConnectivityShell(car_connectivity).cmdloop()
135
+ except KeyboardInterrupt:
136
+ pass
137
+ elif args.command == 'list':
138
+ car_connectivity.fetch_all()
139
+ all_elements: List[GenericAttribute] = car_connectivity.get_attributes(recursive=True)
140
+ for element in all_elements:
141
+ if args.setters:
142
+ if isinstance(element, attributes.ChangeableAttribute):
143
+ print(element.get_absolute_path())
144
+ else:
145
+ print(element.get_absolute_path())
146
+ elif args.command == 'get':
147
+ car_connectivity.fetch_all()
148
+ element: carconnectivity.GenericObject | objects.GenericAttribute | bool = car_connectivity.get_by_path(args.id)
149
+ if element:
150
+ if args.format == Formats.STRING:
151
+ if isinstance(element, dict):
152
+ print('\n'.join([str(value) for value in element.values()]))
153
+ else:
154
+ print(element)
155
+ # elif args.format == Formats.JSON:
156
+ # print(element.toJSON())
157
+ else:
158
+ print('Unknown format')
159
+ sys.exit('Unknown format')
160
+ else:
161
+ print(f'id {args.id} not found', file=sys.stderr)
162
+ sys.exit('id not found')
163
+ elif args.command == 'set':
164
+ car_connectivity.fetch_all()
165
+ element: carconnectivity.GenericObject | objects.GenericAttribute | bool = car_connectivity.get_by_path(args.id)
166
+ if element:
167
+ try:
168
+ if isinstance(element, attributes.ChangeableAttribute):
169
+ element.value = args.value
170
+ else:
171
+ print(f'id {args.id} cannot be set. You can see all changeable entries with "list -s', file=sys.stderr)
172
+ except ValueError as value_error:
173
+ print(f'id {args.id} cannot be set: {value_error}', file=sys.stderr)
174
+ sys.exit('id cannot be set')
175
+ except NotImplementedError:
176
+ print(f'id {args.id} cannot be set. You can see all changeable entries with "list -s"', file=sys.stderr)
177
+ sys.exit('id cannot be set')
178
+ except errors.SetterError as err:
179
+ print(f'id {args.id} cannot be set: {err}', file=sys.stderr)
180
+ sys.exit('id cannot be set')
181
+ else:
182
+ print(f'id {args.id} not found', file=sys.stderr)
183
+ sys.exit('id not found')
184
+ elif args.command == 'events':
185
+ car_connectivity.startup()
186
+ def observer(element, flags):
187
+ if flags & observable.Observable.ObserverEvent.ENABLED:
188
+ print(str(datetime.now()) + ': ' + element.get_absolute_path() + ': new object created')
189
+ elif flags & observable.Observable.ObserverEvent.DISABLED:
190
+ print(str(datetime.now()) + ': ' + element.get_absolute_path() + ': object not available anymore')
191
+ elif flags & observable.Observable.ObserverEvent.VALUE_CHANGED:
192
+ print(str(datetime.now()) + ': ' + element.get_absolute_path() + ': new value: ' + str(element))
193
+ elif flags & observable.Observable.ObserverEvent.UPDATED_NEW_MEASUREMENT:
194
+ print(str(datetime.now()) + ': ' + element.get_absolute_path()
195
+ + ': was updated from vehicle but did not change: ' + str(element))
196
+ elif flags & observable.Observable.ObserverEvent.UPDATED:
197
+ print(str(datetime.now()) + ': ' + element.get_absolute_path()
198
+ + ': was updated from server but did not change: ' + str(element))
199
+ else:
200
+ print(str(datetime.now()) + ' (' + str(flags) + '): '
201
+ + element.get_absolute_path() + ': ' + str(element))
202
+ car_connectivity.add_observer(observer, observable.Observable.ObserverEvent.ALL,
203
+ priority=observable.Observable.ObserverPriority.USER_MID)
204
+ try:
205
+ while True:
206
+ time.sleep(1)
207
+ except KeyboardInterrupt:
208
+ LOG.info('Keyboard interrupt received, shutting down...')
209
+ else:
210
+ LOG.error('command not implemented')
211
+ sys.exit('command not implemented')
212
+
213
+ car_connectivity.shutdown()
214
+ except json.JSONDecodeError as e:
215
+ LOG.critical('Could not load configuration file %s (%s)', args.config, e)
216
+ sys.exit('Could not load configuration file')
217
+ except errors.AuthenticationError as e:
218
+ LOG.critical('There was a problem when authenticating with one or multiple services: %s', e)
219
+ sys.exit('There was a problem when communicating with one or multiple services')
220
+ except errors.APICompatibilityError as e:
221
+ LOG.critical('There was a problem when communicating with one or multiple services.'
222
+ ' If this problem persists please open a bug report: %s', e)
223
+ sys.exit('There was a problem when communicating with one or multiple services')
224
+ except errors.RetrievalError as e:
225
+ LOG.critical('There was a problem when communicating with one or multiple services: %s', e)
226
+ sys.exit('There was a problem when communicating with one or multiple services')
227
+ except errors.ConfigurationError as e:
228
+ LOG.critical('There was a problem with the configuration: %s', e)
229
+ sys.exit('There was a problem with the configuration')
230
+ except KeyboardInterrupt:
231
+ sys.exit("killed")
232
+
233
+
234
+ class CarConnectivityShell(cmd.Cmd):
235
+ """
236
+ CarConnectivityShell is a command-line interface (CLI) shell for interacting with car connectivity data.
237
+
238
+ Attributes:
239
+ prompt (str): The command prompt string.
240
+ intro (str): The introductory message displayed when the shell starts.
241
+ car_connectivity (Any): The car connectivity object to interact with.
242
+ pwd (Any): The current working directory within the car connectivity data.
243
+
244
+ Methods:
245
+ __init__(car_connectivity): Initializes the shell with the given car connectivity object.
246
+ set_prompt(path): Sets the command prompt based on the given path.
247
+ help_exit(): Displays help information for the 'exit' command.
248
+ do_exit(arguments): Exits the shell.
249
+ help_cd(): Displays help information for the 'cd' command.
250
+ do_cd(arguments): Changes the current working directory.
251
+ complete_cd(text, line, begidx, endidx): Provides tab completion for the 'cd' command.
252
+ help_ls(): Displays help information for the 'ls' command.
253
+ do_ls(arguments): Lists subelements of the current path.
254
+ help_pwd(): Displays help information for the 'pwd' command.
255
+ do_pwd(arguments): Displays the current path.
256
+ help_update(): Displays help information for the 'update' command.
257
+ do_update(arguments): Updates the data from the server.
258
+ help_cat(): Displays help information for the 'cat' command.
259
+ do_cat(arguments): Prints the content of the current or specified element.
260
+ help_find(): Displays help information for the 'find' command.
261
+ do_find(arguments): Lists all elements recursively.
262
+ default(line): Handles unrecognized commands.
263
+ do_EOF(): Exits the shell on EOF (Ctrl-D).
264
+ help_EOF(): Displays help information for the EOF command.
265
+ """
266
+ prompt = 'error'
267
+ intro = "Welcome! Type ? to list commands"
268
+
269
+ def __init__(self, car_connectivity: carconnectivity.CarConnectivity) -> None:
270
+ self.car_connectivity: carconnectivity.CarConnectivity = car_connectivity
271
+ self.pwd: GenericObject | GenericAttribute = car_connectivity
272
+
273
+ super().__init__()
274
+ # Set the prompt to the current path
275
+ self.set_prompt(self.car_connectivity.get_absolute_path())
276
+
277
+ def set_prompt(self, path) -> None:
278
+ """
279
+ Sets the command prompt for the CarConnectivityShell.
280
+
281
+ Args:
282
+ path (str): The current path to be displayed in the prompt. If an empty string is provided, it defaults to '/'.
283
+
284
+ """
285
+ if path == '':
286
+ path = '/'
287
+ CarConnectivityShell.prompt = f'ccs:{path}$'
288
+
289
+ def help_exit(self) -> None:
290
+ """
291
+ Prints the help message for the 'exit' command.
292
+
293
+ This method provides information on how to exit the application,
294
+ including the shorthand commands: 'x', 'q', and 'Ctrl-D'.
295
+ """
296
+ print('exit the application. Shorthand: x q Ctrl-D.')
297
+
298
+ def do_exit(self, arguments) -> Literal[True]:
299
+ """
300
+ Exits the CLI application.
301
+
302
+ Args:
303
+ arguments: The arguments passed to the command. This parameter is not used.
304
+
305
+ Returns:
306
+ bool: Always returns True to indicate the command should exit.
307
+ """
308
+ del arguments
309
+ print("Bye")
310
+ return True
311
+
312
+ def help_cd(self):
313
+ """
314
+ Prints the help message for the 'cd' command.
315
+
316
+ This method is used to provide help information about changing the location
317
+ in the tree structure.
318
+ """
319
+ print('change location in tree')
320
+
321
+ def do_cd(self, arguments):
322
+ """
323
+ Change the current directory to the specified path.
324
+
325
+ Args:
326
+ arguments (str): The path to change to. If None or an empty string is provided,
327
+ the path will default to '/'.
328
+
329
+ Behavior:
330
+ - If the provided path starts with '/', it is treated as an absolute path.
331
+ - If the provided path does not start with '/', it is treated as a relative path
332
+ from the current directory.
333
+ - If the specified path exists and is accessible, the current directory is updated
334
+ to the new path and the prompt is set accordingly.
335
+ - If the specified path does not exist or is not accessible, an error message is printed.
336
+
337
+ Example:
338
+ do_cd('/new/path')
339
+ do_cd('relative/path')
340
+ """
341
+ # If no arguments are provided, set the path to '/'
342
+ if arguments is None or arguments == '':
343
+ arguments = '/'
344
+ # If the path starts with '/', treat it as an absolute path
345
+ if arguments.startswith('/'):
346
+ path = arguments
347
+ else:
348
+ path = f'{self.pwd.get_absolute_path()}/{arguments}'
349
+ # Get the object at the specified path
350
+ new_pwd = self.car_connectivity.get_by_path(path)
351
+ # If the object exists and is accessible, update the current directory and prompt
352
+ if new_pwd is not None and new_pwd is not False:
353
+ self.pwd = new_pwd
354
+ path = self.pwd.get_absolute_path()
355
+ if path == '':
356
+ path = '/'
357
+ self.set_prompt(path)
358
+ else:
359
+ # Print an error message if the path does not exist or is not accessible
360
+ print(f'*** {arguments} does not exist or is not accessible')
361
+
362
+ def complete_cd(self, text, line, begidx, endidx):
363
+ """
364
+ Autocompletion method for the 'cd' command.
365
+
366
+ This method provides suggestions for directory names based on the current input text.
367
+ If the input text starts with '/', it suggests absolute paths from the root directory.
368
+ Otherwise, it suggests directory IDs from the current working directory.
369
+
370
+ Args:
371
+ text (str): The current input text for the 'cd' command.
372
+ line (str): The entire input line (unused).
373
+ begidx (int): The beginning index of the input text (unused).
374
+ endidx (int): The ending index of the input text (unused).
375
+
376
+ Returns:
377
+ list: A list of suggested directory names or paths.
378
+ """
379
+ del line
380
+ del begidx
381
+ del endidx
382
+ if text.startswith('/'):
383
+ # Return absolute paths from the root directory
384
+ root: carconnectivity.GenericObject | objects.GenericAttribute = self.pwd.get_root()
385
+ if isinstance(root, objects.GenericObject):
386
+ return [child.get_absolute_path() for child in root.children if child.get_absolute_path().startswith(text)]
387
+ # Return directory IDs from the current working directory
388
+ if isinstance(self.pwd, objects.GenericObject):
389
+ return [child.id for child in self.pwd.children if child.id.startswith(text)]
390
+ return []
391
+
392
+ def help_ls(self):
393
+ """
394
+ Prints the help message for the 'ls' command
395
+
396
+ This method is intended to provide help or guidance to the user about the 'ls' command,
397
+ which lists subelements of the current path.
398
+ """
399
+ print('list subelements of current path')
400
+
401
+ def do_ls(self, arguments):
402
+ """
403
+ Lists the contents of the current directory.
404
+
405
+ Args:
406
+ arguments: Command-line arguments (not used).
407
+
408
+ Prints:
409
+ The parent directory indicator ('..') if the current directory has a parent.
410
+ The IDs of the children of the current directory.
411
+ """
412
+ del arguments
413
+ if self.pwd.parent is not None:
414
+ print('..')
415
+ if isinstance(self.pwd, objects.GenericObject):
416
+ for child in self.pwd.children:
417
+ print(child.id)
418
+
419
+ def help_pwd(self):
420
+ """
421
+ Prints the help message for the 'pwd' command.
422
+
423
+ This method is intended to provide help or guidance to the user about the 'pwd' command,
424
+ which displays the current path.
425
+ """
426
+ print('show current path')
427
+
428
+ def do_pwd(self, arguments):
429
+ """
430
+ Prints the current working directory.
431
+
432
+ Args:
433
+ arguments: Command line arguments (not used).
434
+
435
+ Returns:
436
+ None
437
+ """
438
+ del arguments
439
+ path = self.pwd.get_absolute_path()
440
+ if path == '':
441
+ path = '/'
442
+ print(path)
443
+
444
+ def help_update(self):
445
+ """
446
+ Prints the help message for the 'update' command.
447
+
448
+ This method provides a simple help message for the update command.
449
+ """
450
+ print('update the data from the server')
451
+
452
+ def do_update(self, arguments):
453
+ """
454
+ Updates the car connectivity data by fetching all available data.
455
+
456
+ Args:
457
+ arguments: Command-line arguments passed to the update command.
458
+ """
459
+ del arguments
460
+ self.car_connectivity.fetch_all()
461
+ print('update done')
462
+
463
+ def help_cat(self):
464
+ """
465
+ Prints the help message for the 'cat' command.
466
+
467
+ This method is used to display the help information related to the cat command that prints content.
468
+ """
469
+ print('Print content')
470
+
471
+ def do_cat(self, arguments):
472
+ """
473
+ Display the content of a specified path.
474
+
475
+ If no arguments are provided, this method prints the content of the current working directory.
476
+ If a path is provided as an argument, it prints the content of the specified path
477
+ if it exists and is accessible. Otherwise, it prints an error message.
478
+
479
+ Args:
480
+ arguments (str): The path to the element to be displayed. If None or empty,
481
+ the current working directory is displayed.
482
+ """
483
+ if arguments is None or arguments.strip() == '':
484
+ print(str(self.pwd))
485
+ else:
486
+ element = self.pwd.get_by_path(arguments.strip())
487
+ if element is not None and element is not False:
488
+ print(str(element))
489
+ else:
490
+ print(f'*** {arguments} does not exist or is not accessible')
491
+
492
+ def help_find(self):
493
+ """
494
+ Prints a message describing the functionality of the 'find' command.
495
+
496
+ This method provides a brief description of what the 'find' command does,
497
+ which is to list all elements recursively.
498
+ """
499
+ print('Find lists all elements recursively')
500
+
501
+ def do_find(self, arguments):
502
+ """
503
+ Finds and prints the absolute paths of attributes in the current working directory.
504
+
505
+ Args:
506
+ arguments (str): Command line arguments. If '-s' is passed, only attributes
507
+ that are changeable will be printed.
508
+
509
+ Returns:
510
+ None
511
+ """
512
+ setters = bool(arguments.strip() == '-s')
513
+ all_elements = self.pwd.get_attributes(recursive=True)
514
+ for element in all_elements:
515
+ if setters:
516
+ if isinstance(element, attributes.ChangeableAttribute):
517
+ print(element.get_absolute_path())
518
+ else:
519
+ print(element.get_absolute_path())
520
+
521
+ def default(self, line):
522
+ """
523
+ Handle the default case for unrecognized commands.
524
+
525
+ If the input line is 'x' or 'q', it triggers the exit command.
526
+ Otherwise, it calls the default method of the superclass.
527
+
528
+ Args:
529
+ line (str): The input command line.
530
+
531
+ Returns:
532
+ The result of the exit command if 'x' or 'q' is input, otherwise the result of the superclass's default method.
533
+ """
534
+ if line in ('x', 'q'):
535
+ self.do_exit(line)
536
+ return None
537
+ return super().default(line)
538
+
539
+ do_EOF = do_exit
540
+ help_EOF = help_exit
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.1
2
+ Name: carconnectivity-cli
3
+ Version: 0.1a1
4
+ Summary: Library for retrieving information from car connectivity services
5
+ Author: Till Steinbach
6
+ License: MIT License
7
+
8
+ Copyright (c) 2021 Till Steinbach
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Classifier: Development Status :: 3 - Alpha
29
+ Classifier: Environment :: Console
30
+ Classifier: License :: OSI Approved :: MIT License
31
+ Classifier: Intended Audience :: End Users/Desktop
32
+ Classifier: Intended Audience :: System Administrators
33
+ Classifier: Programming Language :: Python :: 3.9
34
+ Classifier: Programming Language :: Python :: 3.10
35
+ Classifier: Programming Language :: Python :: 3.11
36
+ Classifier: Programming Language :: Python :: 3.12
37
+ Classifier: Programming Language :: Python :: 3.13
38
+ Classifier: Topic :: Utilities
39
+ Classifier: Topic :: System :: Monitoring
40
+ Requires-Python: >=3.9
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE
43
+ Requires-Dist: argparse
44
+
45
+
46
+
47
+ # CarConnectivity Command Line Interface
48
+ [![GitHub sourcecode](https://img.shields.io/badge/Source-GitHub-green)](https://github.com/tillsteinbach/CarConnectivity-cli/)
49
+ [![GitHub release (latest by date)](https://img.shields.io/github/v/release/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/releases/latest)
50
+ [![GitHub](https://img.shields.io/github/license/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/blob/master/LICENSE)
51
+ [![GitHub issues](https://img.shields.io/github/issues/tillsteinbach/CarConnectivity-cli)](https://github.com/tillsteinbach/CarConnectivity-cli/issues)
52
+ [![Donate at PayPal](https://img.shields.io/badge/Donate-PayPal-2997d8)](https://www.paypal.com/donate?hosted_button_id=2BVFF5GJ9SXAJ)
53
+ [![Sponsor at Github](https://img.shields.io/badge/Sponsor-GitHub-28a745)](https://github.com/sponsors/tillsteinbach)
54
+
55
+ ## CarConnectivity will become the successor of [WeConnect-python](https://github.com/tillsteinbach/WeConnect-python) in 2025 with similar functionality but support for other brands beyond Volkswagen!
56
+
57
+ ## Supported Car Brands
58
+ CarConenctivity uses a plugin architecture to enable access to the services of various brands. Currently known plugins are:
59
+
60
+ | Brand | Connector |
61
+ |------------|---------------------------------------------------------------------------------------------------------------|
62
+ | Skoda | [CarConnectivity-connector-skoda](https://github.com/tillsteinbach/CarConnectivity-connector-skoda) |
63
+ | Volkswagen | [CarConnectivity-connector-volkswagen](https://github.com/tillsteinbach/CarConnectivity-connector-volkswagen) |
64
+
65
+ If you know of a connector not listed here let me know and I will add it to the list.
66
+ If you are a python developer and willing to implement a connector for a brand not listed here, let me know and I try to support you as good as possible
67
+
68
+ ## Configuration
69
+ In your carconnectivity.json configuration add a section for the connectors you like to use like this:
70
+ ```
71
+ {
72
+ "carConnectivity": {
73
+ "connectors": [
74
+ {
75
+ "type": "volkswagen",
76
+ "config": {
77
+ "username": "test@test.de"
78
+ "password": "testpassword123"
79
+ }
80
+ },
81
+ {
82
+ "type": "skoda",
83
+ "config": {
84
+ "username": "test@test.de"
85
+ "password": "testpassword123"
86
+ }
87
+ }
88
+ ]
89
+ }
90
+ }
91
+ ```
92
+ The detailed configuration options of the connectors can be found in their README files.
@@ -0,0 +1,22 @@
1
+ .flake8
2
+ .gitignore
3
+ LICENSE
4
+ Makefile
5
+ README.md
6
+ pyproject.toml
7
+ setup_requirements.txt
8
+ .github/dependabot.yml
9
+ .github/ISSUE_TEMPLATE/bug_report.md
10
+ .github/ISSUE_TEMPLATE/feature_request.md
11
+ .github/workflows/build.yml
12
+ .github/workflows/build_and_publish.yml
13
+ .github/workflows/codeql-analysis.yml
14
+ src/carconnectivity_cli/__init__.py
15
+ src/carconnectivity_cli/_version.py
16
+ src/carconnectivity_cli/carconnectivity_cli_base.py
17
+ src/carconnectivity_cli.egg-info/PKG-INFO
18
+ src/carconnectivity_cli.egg-info/SOURCES.txt
19
+ src/carconnectivity_cli.egg-info/dependency_links.txt
20
+ src/carconnectivity_cli.egg-info/entry_points.txt
21
+ src/carconnectivity_cli.egg-info/requires.txt
22
+ src/carconnectivity_cli.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ carconnectivity-cli = carconnectivity_cli.carconnectivity_cli_base:main
@@ -0,0 +1 @@
1
+ carconnectivity_cli