boxyard 0.2.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.
- boxyard-0.2.0/.gitignore +186 -0
- boxyard-0.2.0/LICENSE +21 -0
- boxyard-0.2.0/PKG-INFO +65 -0
- boxyard-0.2.0/README.md +51 -0
- boxyard-0.2.0/pyproject.toml +101 -0
- boxyard-0.2.0/src/boxyard/__init__.py +0 -0
- boxyard-0.2.0/src/boxyard/_cli/__init__.py +3 -0
- boxyard-0.2.0/src/boxyard/_cli/app.py +10 -0
- boxyard-0.2.0/src/boxyard/_cli/main.py +1656 -0
- boxyard-0.2.0/src/boxyard/_cli/multi_sync.py +246 -0
- boxyard-0.2.0/src/boxyard/_enums.py +34 -0
- boxyard-0.2.0/src/boxyard/_models.py +679 -0
- boxyard-0.2.0/src/boxyard/_remote_index.py +209 -0
- boxyard-0.2.0/src/boxyard/_tombstones.py +228 -0
- boxyard-0.2.0/src/boxyard/_utils/__init__.py +10 -0
- boxyard-0.2.0/src/boxyard/_utils/base.py +255 -0
- boxyard-0.2.0/src/boxyard/_utils/locking.py +317 -0
- boxyard-0.2.0/src/boxyard/_utils/logical_expressions.py +159 -0
- boxyard-0.2.0/src/boxyard/_utils/rclone.py +489 -0
- boxyard-0.2.0/src/boxyard/_utils/sync_helper.py +308 -0
- boxyard-0.2.0/src/boxyard/cmds/__init__.py +25 -0
- boxyard-0.2.0/src/boxyard/cmds/_copy_from_remote.py +168 -0
- boxyard-0.2.0/src/boxyard/cmds/_create_user_symlinks.py +27 -0
- boxyard-0.2.0/src/boxyard/cmds/_delete_box.py +80 -0
- boxyard-0.2.0/src/boxyard/cmds/_exclude_box.py +65 -0
- boxyard-0.2.0/src/boxyard/cmds/_force_push_to_remote.py +193 -0
- boxyard-0.2.0/src/boxyard/cmds/_get_box_sync_status.py +39 -0
- boxyard-0.2.0/src/boxyard/cmds/_include_box.py +65 -0
- boxyard-0.2.0/src/boxyard/cmds/_init_boxyard.py +69 -0
- boxyard-0.2.0/src/boxyard/cmds/_modify_boxmeta.py +61 -0
- boxyard-0.2.0/src/boxyard/cmds/_new_box.py +217 -0
- boxyard-0.2.0/src/boxyard/cmds/_rename_box.py +177 -0
- boxyard-0.2.0/src/boxyard/cmds/_sync_box.py +235 -0
- boxyard-0.2.0/src/boxyard/cmds/_sync_missing_boxmetas.py +134 -0
- boxyard-0.2.0/src/boxyard/cmds/_sync_name.py +104 -0
- boxyard-0.2.0/src/boxyard/config.py +192 -0
- boxyard-0.2.0/src/boxyard/const.py +79 -0
boxyard-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Ignore nbs
|
|
2
|
+
nbs/
|
|
3
|
+
|
|
4
|
+
tmp_tests/
|
|
5
|
+
__scratch/
|
|
6
|
+
|
|
7
|
+
envname
|
|
8
|
+
_proc/
|
|
9
|
+
_docs/
|
|
10
|
+
index_files/
|
|
11
|
+
|
|
12
|
+
.DS_Store
|
|
13
|
+
|
|
14
|
+
*.bak
|
|
15
|
+
.gitattributes
|
|
16
|
+
.last_checked
|
|
17
|
+
.gitconfig
|
|
18
|
+
*.bak
|
|
19
|
+
*.log
|
|
20
|
+
*~
|
|
21
|
+
~*
|
|
22
|
+
_tmp*
|
|
23
|
+
tmp*
|
|
24
|
+
tags
|
|
25
|
+
*.pkg
|
|
26
|
+
|
|
27
|
+
# Byte-compiled / optimized / DLL files
|
|
28
|
+
__pycache__/
|
|
29
|
+
*.py[cod]
|
|
30
|
+
*$py.class
|
|
31
|
+
|
|
32
|
+
# C extensions
|
|
33
|
+
*.so
|
|
34
|
+
|
|
35
|
+
# Distribution / packaging
|
|
36
|
+
.Python
|
|
37
|
+
build/
|
|
38
|
+
develop-eggs/
|
|
39
|
+
dist/
|
|
40
|
+
downloads/
|
|
41
|
+
eggs/
|
|
42
|
+
.eggs/
|
|
43
|
+
lib/
|
|
44
|
+
lib64/
|
|
45
|
+
parts/
|
|
46
|
+
sdist/
|
|
47
|
+
var/
|
|
48
|
+
wheels/
|
|
49
|
+
share/python-wheels/
|
|
50
|
+
*.egg-info/
|
|
51
|
+
.installed.cfg
|
|
52
|
+
*.egg
|
|
53
|
+
MANIFEST
|
|
54
|
+
|
|
55
|
+
# PyInstaller
|
|
56
|
+
# Usually these files are written by a python script from a template
|
|
57
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
58
|
+
*.manifest
|
|
59
|
+
*.spec
|
|
60
|
+
|
|
61
|
+
# Installer logs
|
|
62
|
+
pip-log.txt
|
|
63
|
+
pip-delete-this-directory.txt
|
|
64
|
+
|
|
65
|
+
# Unit test / coverage reports
|
|
66
|
+
htmlcov/
|
|
67
|
+
.tox/
|
|
68
|
+
.nox/
|
|
69
|
+
.coverage
|
|
70
|
+
.coverage.*
|
|
71
|
+
.cache
|
|
72
|
+
nosetests.xml
|
|
73
|
+
coverage.xml
|
|
74
|
+
*.cover
|
|
75
|
+
*.py,cover
|
|
76
|
+
.hypothesis/
|
|
77
|
+
.pytest_cache/
|
|
78
|
+
cover/
|
|
79
|
+
|
|
80
|
+
# Translations
|
|
81
|
+
*.mo
|
|
82
|
+
*.pot
|
|
83
|
+
|
|
84
|
+
# Django stuff:
|
|
85
|
+
*.log
|
|
86
|
+
local_settings.py
|
|
87
|
+
db.sqlite3
|
|
88
|
+
db.sqlite3-journal
|
|
89
|
+
|
|
90
|
+
# Flask stuff:
|
|
91
|
+
instance/
|
|
92
|
+
.webassets-cache
|
|
93
|
+
|
|
94
|
+
# Scrapy stuff:
|
|
95
|
+
.scrapy
|
|
96
|
+
|
|
97
|
+
# Sphinx documentation
|
|
98
|
+
docs/_build/
|
|
99
|
+
|
|
100
|
+
# PyBuilder
|
|
101
|
+
.pybuilder/
|
|
102
|
+
target/
|
|
103
|
+
|
|
104
|
+
# Jupyter Notebook
|
|
105
|
+
.ipynb_checkpoints
|
|
106
|
+
|
|
107
|
+
# IPython
|
|
108
|
+
profile_default/
|
|
109
|
+
ipython_config.py
|
|
110
|
+
|
|
111
|
+
# pyenv
|
|
112
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
113
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
114
|
+
# .python-version
|
|
115
|
+
|
|
116
|
+
# pipenv
|
|
117
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
118
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
119
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
120
|
+
# install all needed dependencies.
|
|
121
|
+
#Pipfile.lock
|
|
122
|
+
|
|
123
|
+
# poetry
|
|
124
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
125
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
126
|
+
# commonly ignored for libraries.
|
|
127
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
128
|
+
#poetry.lock
|
|
129
|
+
|
|
130
|
+
# pdm
|
|
131
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
132
|
+
#pdm.lock
|
|
133
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
134
|
+
# in version control.
|
|
135
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
136
|
+
.pdm.toml
|
|
137
|
+
|
|
138
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
139
|
+
__pypackages__/
|
|
140
|
+
|
|
141
|
+
# Celery stuff
|
|
142
|
+
celerybeat-schedule
|
|
143
|
+
celerybeat.pid
|
|
144
|
+
|
|
145
|
+
# SageMath parsed files
|
|
146
|
+
*.sage.py
|
|
147
|
+
|
|
148
|
+
# Environments
|
|
149
|
+
.env
|
|
150
|
+
.venv
|
|
151
|
+
env/
|
|
152
|
+
venv/
|
|
153
|
+
ENV/
|
|
154
|
+
env.bak/
|
|
155
|
+
venv.bak/
|
|
156
|
+
|
|
157
|
+
# Spyder project settings
|
|
158
|
+
.spyderproject
|
|
159
|
+
.spyproject
|
|
160
|
+
|
|
161
|
+
# Rope project settings
|
|
162
|
+
.ropeproject
|
|
163
|
+
|
|
164
|
+
# mkdocs documentation
|
|
165
|
+
/site
|
|
166
|
+
|
|
167
|
+
# mypy
|
|
168
|
+
.mypy_cache/
|
|
169
|
+
.dmypy.json
|
|
170
|
+
dmypy.json
|
|
171
|
+
|
|
172
|
+
# Pyre type checker
|
|
173
|
+
.pyre/
|
|
174
|
+
|
|
175
|
+
# pytype static type analyzer
|
|
176
|
+
.pytype/
|
|
177
|
+
|
|
178
|
+
# Cython debug symbols
|
|
179
|
+
cython_debug/
|
|
180
|
+
|
|
181
|
+
# PyCharm
|
|
182
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
183
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
184
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
185
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
186
|
+
#.idea/
|
boxyard-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Lukas Kikuchi
|
|
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.
|
boxyard-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: boxyard
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: filelock>=3.12.0
|
|
8
|
+
Requires-Dist: pydantic>=2.12.4
|
|
9
|
+
Requires-Dist: python-ulid[pydantic]>=3.1.0
|
|
10
|
+
Requires-Dist: rich>=14.2.0
|
|
11
|
+
Requires-Dist: toml>=0.10.2
|
|
12
|
+
Requires-Dist: typer>=0.20.0
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# boxyard
|
|
16
|
+
|
|
17
|
+
<!-- #region -->
|
|
18
|
+
# Usage
|
|
19
|
+
|
|
20
|
+
To run all all scripts in `core` in sequence, run
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
boxyard.core.run_all()
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
from within Python, or
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
boxyard run-core
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
from the terminal.
|
|
33
|
+
<!-- #endregion -->
|
|
34
|
+
|
|
35
|
+
<!-- #region -->
|
|
36
|
+
# Development install instructions
|
|
37
|
+
|
|
38
|
+
## Prerequisites
|
|
39
|
+
|
|
40
|
+
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/).
|
|
41
|
+
- Install [direnv](https://direnv.net/) to automatically load the project virtual environment when entering it.
|
|
42
|
+
- Mac: `brew install direnv`
|
|
43
|
+
- Linux: `curl -sfL https://direnv.net/install.sh | bash`
|
|
44
|
+
|
|
45
|
+
## Setting up the environment
|
|
46
|
+
|
|
47
|
+
Run the following:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# In the root of the project folder
|
|
51
|
+
uv sync # Installs the virtual environment at './.venv'
|
|
52
|
+
direnv allow # Allows the automatic running of the script './.envrc'
|
|
53
|
+
nbl install-hooks # Installs a git hooks that ensures that notebooks are added properly
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
You are now set up to develop the codebase.
|
|
57
|
+
|
|
58
|
+
Further instructions:
|
|
59
|
+
|
|
60
|
+
- To export notebooks run `nbl export`.
|
|
61
|
+
- To clean notebooks run `nbl clean`.
|
|
62
|
+
- To see other available commands run just `nbl`.
|
|
63
|
+
- To add a new dependency run `uv add package-name`. See the the [uv documentation](https://docs.astral.sh/uv/) for more details.
|
|
64
|
+
- You need to `git add` all 'twinned' notebooks for the commit to be validated by the git-hook. For example, if you add `nbs/my-nb.ipynb`, you must also add `pts/my-nb.pct.py`.
|
|
65
|
+
<!-- #endregion -->
|
boxyard-0.2.0/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# boxyard
|
|
2
|
+
|
|
3
|
+
<!-- #region -->
|
|
4
|
+
# Usage
|
|
5
|
+
|
|
6
|
+
To run all all scripts in `core` in sequence, run
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
boxyard.core.run_all()
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
from within Python, or
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
boxyard run-core
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
from the terminal.
|
|
19
|
+
<!-- #endregion -->
|
|
20
|
+
|
|
21
|
+
<!-- #region -->
|
|
22
|
+
# Development install instructions
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/).
|
|
27
|
+
- Install [direnv](https://direnv.net/) to automatically load the project virtual environment when entering it.
|
|
28
|
+
- Mac: `brew install direnv`
|
|
29
|
+
- Linux: `curl -sfL https://direnv.net/install.sh | bash`
|
|
30
|
+
|
|
31
|
+
## Setting up the environment
|
|
32
|
+
|
|
33
|
+
Run the following:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# In the root of the project folder
|
|
37
|
+
uv sync # Installs the virtual environment at './.venv'
|
|
38
|
+
direnv allow # Allows the automatic running of the script './.envrc'
|
|
39
|
+
nbl install-hooks # Installs a git hooks that ensures that notebooks are added properly
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You are now set up to develop the codebase.
|
|
43
|
+
|
|
44
|
+
Further instructions:
|
|
45
|
+
|
|
46
|
+
- To export notebooks run `nbl export`.
|
|
47
|
+
- To clean notebooks run `nbl clean`.
|
|
48
|
+
- To see other available commands run just `nbl`.
|
|
49
|
+
- To add a new dependency run `uv add package-name`. See the the [uv documentation](https://docs.astral.sh/uv/) for more details.
|
|
50
|
+
- You need to `git add` all 'twinned' notebooks for the commit to be validated by the git-hook. For example, if you add `nbs/my-nb.ipynb`, you must also add `pts/my-nb.pct.py`.
|
|
51
|
+
<!-- #endregion -->
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "boxyard"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "Add your description here"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"filelock>=3.12.0",
|
|
9
|
+
"pydantic>=2.12.4",
|
|
10
|
+
"python-ulid[pydantic]>=3.1.0",
|
|
11
|
+
"rich>=14.2.0",
|
|
12
|
+
"toml>=0.10.2",
|
|
13
|
+
"typer>=0.20.0",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[build-system]
|
|
17
|
+
requires = ["hatchling"]
|
|
18
|
+
build-backend = "hatchling.build"
|
|
19
|
+
|
|
20
|
+
[tool.hatch.build.targets.wheel]
|
|
21
|
+
packages = ["src/boxyard"]
|
|
22
|
+
|
|
23
|
+
[tool.hatch.build.targets.sdist]
|
|
24
|
+
include = ["src/boxyard/**", "LICENSE", "README.md"]
|
|
25
|
+
|
|
26
|
+
[dependency-groups]
|
|
27
|
+
dev = [
|
|
28
|
+
"git-cliff>=2.10.1",
|
|
29
|
+
"ipywidgets>=8.1.8",
|
|
30
|
+
"jupyterlab>=4.4.0",
|
|
31
|
+
"nblite>=1.1.10",
|
|
32
|
+
"pytest>=9.0.0",
|
|
33
|
+
"python-dotenv>=1.2.1",
|
|
34
|
+
"ruff>=0.14.13",
|
|
35
|
+
"twine>=6.2.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
boxyard = "boxyard._cli.app:app"
|
|
40
|
+
|
|
41
|
+
[tool.pytest.ini_options]
|
|
42
|
+
testpaths = ["src/tests"]
|
|
43
|
+
python_files = ["test_*.py"]
|
|
44
|
+
python_functions = ["test_*"]
|
|
45
|
+
pythonpath = ["src"]
|
|
46
|
+
markers = [
|
|
47
|
+
"integration: marks tests as integration tests (require external resources like rclone)",
|
|
48
|
+
"remote: marks tests that require remote storage credentials (skipped if not configured)",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
[tool.ruff]
|
|
52
|
+
target-version = "py311"
|
|
53
|
+
line-length = 120
|
|
54
|
+
exclude = []
|
|
55
|
+
extend-exclude = [
|
|
56
|
+
"__*.pct.py",
|
|
57
|
+
"*.ipynb", # ruff does not play nice with nblite
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.ruff.lint]
|
|
61
|
+
select = [
|
|
62
|
+
"E", # pycodestyle errors
|
|
63
|
+
"W", # pycodestyle warnings
|
|
64
|
+
"F", # pyflakes
|
|
65
|
+
"I", # isort
|
|
66
|
+
"B", # flake8-bugbear
|
|
67
|
+
"C4", # flake8-comprehensions
|
|
68
|
+
"UP", # pyupgrade
|
|
69
|
+
]
|
|
70
|
+
ignore = [
|
|
71
|
+
"E501", # line too long (handled by formatter)
|
|
72
|
+
"B008", # do not perform function calls in argument defaults
|
|
73
|
+
"E402", # Module level import not at top (module-level-import-not-at-top)
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
[tool.ruff.lint.per-file-ignores]
|
|
77
|
+
"*.pct.py" = [
|
|
78
|
+
"I001", # Unsorted imports
|
|
79
|
+
"E701", # Multiple statements on one line newline (no-multiple-statements)
|
|
80
|
+
"E702", # Multiple statements on one line semicolon (no-multiple-statements)
|
|
81
|
+
"E703", # useless-semicolon
|
|
82
|
+
"E265", # Block comment should start with '# ' (nblite uses #|directive)
|
|
83
|
+
]
|
|
84
|
+
# All src/boxyard/ files are autogenerated from notebooks via nblite.
|
|
85
|
+
# They have patterns that are intentional in notebook-driven development
|
|
86
|
+
# but trigger ruff warnings (unsorted imports, lambda assignments, etc.)
|
|
87
|
+
"src/boxyard/**/*.py" = [
|
|
88
|
+
"I001", "E731", "B904", "B905", "B018", "B006", "B007", "B020", "B023",
|
|
89
|
+
"C401", "C408", "C416", "C419",
|
|
90
|
+
"F401", "F403", "F405", "F541", "F841",
|
|
91
|
+
"E721",
|
|
92
|
+
"UP017", "UP024", "UP035", "UP041",
|
|
93
|
+
"W293",
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
[tool.ruff.lint.isort]
|
|
97
|
+
known-first-party = ["nblite"]
|
|
98
|
+
|
|
99
|
+
[tool.ruff.format]
|
|
100
|
+
quote-style = "double"
|
|
101
|
+
indent-style = "space"
|
|
File without changes
|