treeviewex 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.
@@ -0,0 +1,14 @@
1
+ [report]
2
+ exclude_lines =
3
+ def column
4
+ def combined_handler
5
+ def bind
6
+ def pack
7
+ def grid
8
+ def get_clicked_cell_id_pair
9
+ def on_double_click
10
+ def _on_return
11
+ def _on_focus_out
12
+ def _on_escape
13
+ pragma: no cover
14
+
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: fangface-hub
@@ -0,0 +1,43 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: write
8
+
9
+ jobs:
10
+ build-and-publish:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Extract version from pyproject.toml
17
+ id: version
18
+ run: |
19
+ VERSION=$(grep -m1 '^version = "' pyproject.toml | sed -E 's/^version = "([^"]+)"$/\1/')
20
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
21
+ echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v3
25
+
26
+ - name: Build distribution
27
+ run: uv build
28
+
29
+ - name: Publish to PyPI
30
+ uses: pypa/gh-action-pypi-publish@release/v1
31
+ with:
32
+ password: ${{ secrets.PYPI_API_TOKEN }}
33
+ packages-dir: dist
34
+
35
+ - name: Create GitHub release and upload artifacts
36
+ uses: softprops/action-gh-release@v2
37
+ with:
38
+ tag_name: ${{ steps.version.outputs.tag }}
39
+ name: ${{ steps.version.outputs.tag }}
40
+ generate_release_notes: true
41
+ files: |
42
+ dist/*.tar.gz
43
+ dist/*.whl
@@ -0,0 +1,24 @@
1
+ name: Publish to TestPyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ build-and-publish:
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+
13
+ - name: Install uv
14
+ uses: astral-sh/setup-uv@v3
15
+
16
+ - name: Build wheel
17
+ run: uv build
18
+
19
+ - name: Publish to TestPyPI
20
+ uses: pypa/gh-action-pypi-publish@release/v1
21
+ with:
22
+ password: ${{ secrets.TEST_PYPI_API_TOKEN }}
23
+ repository-url: https://test.pypi.org/legacy/
24
+ packages-dir: dist
@@ -0,0 +1,30 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.9", "3.11"]
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: ${{ matrix.python-version }}
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v3
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --group dev
28
+
29
+ - name: Run tests
30
+ run: uv run pytest -q
@@ -0,0 +1,175 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
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
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+ .uv/
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ #poetry.lock
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ #pdm.lock
114
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
115
+ # in version control.
116
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
117
+ .pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
122
+ __pypackages__/
123
+
124
+ # Celery stuff
125
+ celerybeat-schedule
126
+ celerybeat.pid
127
+
128
+ # SageMath parsed files
129
+ *.sage.py
130
+
131
+ # Environments
132
+ .env
133
+ .venv
134
+ env/
135
+ venv/
136
+ ENV/
137
+ env.bak/
138
+ venv.bak/
139
+
140
+ # Spyder project settings
141
+ .spyderproject
142
+ .spyproject
143
+
144
+ # Rope project settings
145
+ .ropeproject
146
+
147
+ # mkdocs documentation
148
+ /site
149
+
150
+ # mypy
151
+ .mypy_cache/
152
+ .dmypy.json
153
+ dmypy.json
154
+
155
+ # Pyre type checker
156
+ .pyre/
157
+
158
+ # pytype static type analyzer
159
+ .pytype/
160
+
161
+ # Cython debug symbols
162
+ cython_debug/
163
+
164
+ # PyCharm
165
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
166
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
167
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
168
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
169
+ #.idea/
170
+
171
+ # Ruff stuff:
172
+ .ruff_cache/
173
+
174
+ # PyPI configuration file
175
+ .pypirc
@@ -0,0 +1,4 @@
1
+ {
2
+ "MD033": false,
3
+ "MD013": false
4
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "python.testing.unittestArgs": [
3
+ "-v",
4
+ "-s",
5
+ ".",
6
+ "-p",
7
+ "test_*.py"
8
+ ],
9
+ "python.testing.pytestEnabled": false,
10
+ "python.testing.unittestEnabled": true,
11
+ // Python フォーマッター設定
12
+ "[python]": {
13
+ "editor.defaultFormatter": "ms-python.black-formatter",
14
+ "editor.formatOnSave": true,
15
+ "editor.formatOnPaste": false,
16
+ "editor.codeActionsOnSave": {
17
+ "source.organizeImports": "explicit"
18
+ }
19
+ },
20
+
21
+ // Flake8 設定
22
+ "flake8.args": [
23
+ "--max-line-length=80",
24
+ "--extend-ignore=E203,W503"
25
+ ],
26
+
27
+ // Pylance 分析設定
28
+ "python.analysis.typeCheckingMode": "basic",
29
+
30
+ // ファイル除外設定
31
+ "files.exclude": {
32
+ "**/__pycache__": true,
33
+ "**/*.pyc": true,
34
+ "**/build": true,
35
+ "**/.pytest_cache": true,
36
+ "**/.venv": true
37
+ }
38
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 fangface
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,158 @@
1
+ Metadata-Version: 2.4
2
+ Name: treeviewex
3
+ Version: 1.0.0
4
+ Summary: A TreeView extension for Tkinter
5
+ Project-URL: Homepage, https://github.com/fangface-hub/treeviewex
6
+ Project-URL: Repository, https://github.com/fangface-hub/treeviewex
7
+ Project-URL: Issues, https://github.com/fangface-hub/treeviewex/issues
8
+ Author: fangface
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: tkinter,treeview,ui
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+
15
+ # TreeviewEx
16
+
17
+ [日本語](README_ja.md)
18
+
19
+ Treeview extension for Tkinter.
20
+
21
+ This package adds the following features to the standard tkinter Treeview:
22
+
23
+ - Vertical and horizontal scroll bars
24
+ - Cell editing
25
+ - Read-only settings for rows, columns, and cells
26
+
27
+ All other behavior is the same as the standard tkinter Treeview.
28
+
29
+ ---
30
+
31
+ ## Testing
32
+
33
+ 1. Install dependencies
34
+
35
+ ```bash
36
+ uv sync --group dev
37
+ ```
38
+
39
+ 2. Run the tests
40
+
41
+ ```bash
42
+ uv run pytest -q
43
+ ```
44
+
45
+ 3. Show coverage report
46
+
47
+ ```bash
48
+ uv run coverage run -m pytest -q
49
+ uv run coverage report -m
50
+ ```
51
+
52
+ 4. Generate an HTML report (optional)
53
+
54
+ ```bash
55
+ uv run coverage html
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Build
61
+
62
+ 1. Install dependencies
63
+
64
+ ```bash
65
+ uv sync --group dev
66
+ ```
67
+
68
+ 2. Build the package
69
+
70
+ ```bash
71
+ uv build
72
+ ```
73
+
74
+ 3. Check the generated wheel in the dist folder
75
+
76
+ ---
77
+
78
+ ## Usage
79
+
80
+ 1. Install the package
81
+
82
+ ```bash
83
+ uv pip install path/to/TreeviewEx.whl
84
+ ```
85
+
86
+ 2. Run the sample
87
+
88
+ ```bash
89
+ uv run python sample/sample.py
90
+ ```
91
+
92
+ Example:
93
+
94
+ ```python
95
+ from treeviewex import TreeviewEx
96
+ from tkinter import Tk
97
+
98
+ root = Tk()
99
+ root.title("TreeviewEx Example")
100
+
101
+ treeview_ex = TreeviewEx(root)
102
+ treeview_ex.grid(row=0, column=0, sticky="nsew")
103
+
104
+ columns = ("col1", "col2", "col3", "col4")
105
+ treeview_ex["columns"] = columns
106
+ treeview_ex.heading("#0", text="", anchor="w")
107
+ treeview_ex.column("#0", width=0, stretch=False)
108
+ for col in columns:
109
+ treeview_ex.heading(col, text=f"{col.capitalize()}")
110
+ treeview_ex.column(col, width=100)
111
+
112
+ for i in range(100):
113
+ treeview_ex.insert(
114
+ "",
115
+ "end",
116
+ text="",
117
+ values=(f"Value {i}A", f"Value {i}B", f"Value {i}C", f"Value {i}D"),
118
+ )
119
+
120
+ root.grid_rowconfigure(0, weight=1)
121
+ root.grid_columnconfigure(0, weight=1)
122
+
123
+ root.mainloop()
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Public interfaces
129
+
130
+ ### set_readonly_row(row_id: str, readonly: bool = True) -> None
131
+
132
+ Set the specified row to readonly.
133
+
134
+ ### set_readonly_column(column_id: str, readonly: bool = True) -> None
135
+
136
+ Set the specified column to readonly.
137
+
138
+ ### set_readonly_cell(cell_id_pair: tuple, readonly: bool = True) -> None
139
+
140
+ Set the specified cell to readonly.
141
+
142
+ ### set_combobox_row(row_id: str, values: list = None, is_combobox: bool = True) -> None
143
+
144
+ Set the specified row to be editable with a Combobox.
145
+
146
+ ### set_combobox_column(column_id: str, values: list = None, is_combobox: bool = True) -> None
147
+
148
+ Set the specified column to be editable with a Combobox.
149
+
150
+ ### set_combobox_cell(cell_id_pair: tuple, values: list = None, is_combobox: bool = True) -> None
151
+
152
+ Set the specified cell to be editable with a Combobox.
153
+
154
+ ---
155
+
156
+ ## License
157
+
158
+ This project is licensed under the MIT License.
@@ -0,0 +1,144 @@
1
+ # TreeviewEx
2
+
3
+ [日本語](README_ja.md)
4
+
5
+ Treeview extension for Tkinter.
6
+
7
+ This package adds the following features to the standard tkinter Treeview:
8
+
9
+ - Vertical and horizontal scroll bars
10
+ - Cell editing
11
+ - Read-only settings for rows, columns, and cells
12
+
13
+ All other behavior is the same as the standard tkinter Treeview.
14
+
15
+ ---
16
+
17
+ ## Testing
18
+
19
+ 1. Install dependencies
20
+
21
+ ```bash
22
+ uv sync --group dev
23
+ ```
24
+
25
+ 2. Run the tests
26
+
27
+ ```bash
28
+ uv run pytest -q
29
+ ```
30
+
31
+ 3. Show coverage report
32
+
33
+ ```bash
34
+ uv run coverage run -m pytest -q
35
+ uv run coverage report -m
36
+ ```
37
+
38
+ 4. Generate an HTML report (optional)
39
+
40
+ ```bash
41
+ uv run coverage html
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Build
47
+
48
+ 1. Install dependencies
49
+
50
+ ```bash
51
+ uv sync --group dev
52
+ ```
53
+
54
+ 2. Build the package
55
+
56
+ ```bash
57
+ uv build
58
+ ```
59
+
60
+ 3. Check the generated wheel in the dist folder
61
+
62
+ ---
63
+
64
+ ## Usage
65
+
66
+ 1. Install the package
67
+
68
+ ```bash
69
+ uv pip install path/to/TreeviewEx.whl
70
+ ```
71
+
72
+ 2. Run the sample
73
+
74
+ ```bash
75
+ uv run python sample/sample.py
76
+ ```
77
+
78
+ Example:
79
+
80
+ ```python
81
+ from treeviewex import TreeviewEx
82
+ from tkinter import Tk
83
+
84
+ root = Tk()
85
+ root.title("TreeviewEx Example")
86
+
87
+ treeview_ex = TreeviewEx(root)
88
+ treeview_ex.grid(row=0, column=0, sticky="nsew")
89
+
90
+ columns = ("col1", "col2", "col3", "col4")
91
+ treeview_ex["columns"] = columns
92
+ treeview_ex.heading("#0", text="", anchor="w")
93
+ treeview_ex.column("#0", width=0, stretch=False)
94
+ for col in columns:
95
+ treeview_ex.heading(col, text=f"{col.capitalize()}")
96
+ treeview_ex.column(col, width=100)
97
+
98
+ for i in range(100):
99
+ treeview_ex.insert(
100
+ "",
101
+ "end",
102
+ text="",
103
+ values=(f"Value {i}A", f"Value {i}B", f"Value {i}C", f"Value {i}D"),
104
+ )
105
+
106
+ root.grid_rowconfigure(0, weight=1)
107
+ root.grid_columnconfigure(0, weight=1)
108
+
109
+ root.mainloop()
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Public interfaces
115
+
116
+ ### set_readonly_row(row_id: str, readonly: bool = True) -> None
117
+
118
+ Set the specified row to readonly.
119
+
120
+ ### set_readonly_column(column_id: str, readonly: bool = True) -> None
121
+
122
+ Set the specified column to readonly.
123
+
124
+ ### set_readonly_cell(cell_id_pair: tuple, readonly: bool = True) -> None
125
+
126
+ Set the specified cell to readonly.
127
+
128
+ ### set_combobox_row(row_id: str, values: list = None, is_combobox: bool = True) -> None
129
+
130
+ Set the specified row to be editable with a Combobox.
131
+
132
+ ### set_combobox_column(column_id: str, values: list = None, is_combobox: bool = True) -> None
133
+
134
+ Set the specified column to be editable with a Combobox.
135
+
136
+ ### set_combobox_cell(cell_id_pair: tuple, values: list = None, is_combobox: bool = True) -> None
137
+
138
+ Set the specified cell to be editable with a Combobox.
139
+
140
+ ---
141
+
142
+ ## License
143
+
144
+ This project is licensed under the MIT License.