desertislandutils 0.1.0__tar.gz → 0.4.3__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.
- desertislandutils-0.4.3/.github/workflows/main.yml +47 -0
- desertislandutils-0.4.3/.github/workflows/release.yml +71 -0
- desertislandutils-0.4.3/.github/workflows/test.yml +77 -0
- desertislandutils-0.4.3/.gitignore +148 -0
- desertislandutils-0.4.3/PKG-INFO +179 -0
- desertislandutils-0.4.3/README.md +159 -0
- desertislandutils-0.4.3/__init__.py +0 -0
- desertislandutils-0.4.3/base.justfile +46 -0
- desertislandutils-0.4.3/justfile +78 -0
- desertislandutils-0.4.3/notes/CICD-notes.md +102 -0
- desertislandutils-0.4.3/notes/GHA.actions-handy.yml +179 -0
- desertislandutils-0.4.3/notes/example-gha-workflow.on-push.yaml +84 -0
- desertislandutils-0.4.3/notes/package-log.md +101 -0
- desertislandutils-0.4.3/notes/poetry-packaging-notes.md +60 -0
- desertislandutils-0.4.3/notes/toobigdatadoc-dev-log.md +334 -0
- desertislandutils-0.4.3/notes/toobigdatadoc-packaging-log.md +195 -0
- desertislandutils-0.4.3/notes/toobigdatadoc.poetry-pytest-problem.md +85 -0
- desertislandutils-0.4.3/notes/weeknumber/weeknumber.md +128 -0
- desertislandutils-0.4.3/notes/why-parallel-file-systems.md +74 -0
- desertislandutils-0.4.3/notes/workflow.publish-update.md +87 -0
- desertislandutils-0.4.3/notes/workflow.unit-testing.md +68 -0
- desertislandutils-0.4.3/notes/workflows/archive/github-actions-demo.yml +23 -0
- desertislandutils-0.4.3/notes/workflows/github.actions.auto-merge-back-to-dev.yml +30 -0
- desertislandutils-0.4.3/notes/workflows/github.actions.setup-python.yml +42 -0
- desertislandutils-0.4.3/notes/workflows/github.example.python-simple.yml +32 -0
- desertislandutils-0.4.3/notes/workflows/github.python-app.yml +41 -0
- desertislandutils-0.4.3/notes/workflows/github.python-package.yml +42 -0
- desertislandutils-0.4.3/notes/workflows/poetry.abatilo.CI-actions.yml +26 -0
- desertislandutils-0.4.3/notes/workflows/poetry.abatilo.release-on-push.yml +37 -0
- desertislandutils-0.4.3/pyproject.toml +38 -0
- desertislandutils-0.4.3/src/__init__.py +0 -0
- desertislandutils-0.4.3/src/toobigdatadoc/__init__.py +0 -0
- desertislandutils-0.4.3/src/toobigdatadoc/too.py +87 -0
- desertislandutils-0.4.3/src/weeknumber/__init__.py +0 -0
- desertislandutils-0.4.3/src/weeknumber/wn.py +85 -0
- desertislandutils-0.4.3/tests/README.md +38 -0
- desertislandutils-0.4.3/tests/__init__.py +0 -0
- desertislandutils-0.4.3/tests/test_unit.py +18 -0
- desertislandutils-0.4.3/tests/toobigdatadoc/test_pytest.py +11 -0
- desertislandutils-0.4.3/tests/toobigdatadoc/test_too.py +93 -0
- desertislandutils-0.4.3/tests/wn/test_wn.py +106 -0
- desertislandutils-0.4.3/todo/RESUME.manual-build-bump-formula.md +84 -0
- desertislandutils-0.4.3/todo/TODO.md +77 -0
- desertislandutils-0.4.3/todo/bash-to-python-migrate.md +13 -0
- desertislandutils-0.4.3/todo/desertislandutils.markdowner.md +13 -0
- desertislandutils-0.4.3/todo/poetry-build-github-actions.md +136 -0
- desertislandutils-0.1.0/PKG-INFO +0 -14
- desertislandutils-0.1.0/pyproject.toml +0 -24
- desertislandutils-0.1.0/setup.py +0 -34
- desertislandutils-0.1.0/src/toobigdatadoc/__init__.py +0 -1
- desertislandutils-0.1.0/src/toobigdatadoc/too.py +0 -88
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Merge Release Branch and Tag
|
|
2
|
+
|
|
3
|
+
env:
|
|
4
|
+
ACTIONS_STEP_DEBUG: true
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
pull_request:
|
|
8
|
+
types: [closed]
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
tag-release:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
if: |
|
|
16
|
+
github.event.pull_request.merged == true &&
|
|
17
|
+
startsWith(github.event.pull_request.head.ref, 'release/')
|
|
18
|
+
steps:
|
|
19
|
+
- name: Show PR info
|
|
20
|
+
run: |
|
|
21
|
+
echo "PR merged from: ${{ github.event.pull_request.head.ref }}"
|
|
22
|
+
echo "PR merged to: ${{ github.event.pull_request.base.ref }}"
|
|
23
|
+
|
|
24
|
+
- name: Checkout the repo
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
with:
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: Generate tag name
|
|
30
|
+
id: tag
|
|
31
|
+
run: |
|
|
32
|
+
release_branch="${{ github.event.pull_request.head.ref }}"
|
|
33
|
+
tag_name=$(echo "$release_branch" | sed -E 's/.*release.*([0-9]+\.[0-9]+\.[0-9]+).*/v\1/')
|
|
34
|
+
echo "release_tag_name=$tag_name" >> $GITHUB_OUTPUT
|
|
35
|
+
echo "Generated tag: $tag_name"
|
|
36
|
+
|
|
37
|
+
- name: Create and push tag
|
|
38
|
+
run: |
|
|
39
|
+
git config user.name gha-bot
|
|
40
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
41
|
+
git tag --annotate "${{ steps.tag.outputs.release_tag_name }}" -m "release ${{ steps.tag.outputs.release_tag_name }}"
|
|
42
|
+
git push origin "${{ steps.tag.outputs.release_tag_name }}"
|
|
43
|
+
echo
|
|
44
|
+
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
|
45
|
+
git log --graph --all -n10 --pretty=format:'%h %as %cn %x09%s %d'
|
|
46
|
+
echo "Tag "${{ steps.tag.outputs.release_tag_name }}" created and pushed"
|
|
47
|
+
echo "YOU CAN DELETE RELEASE BRANCH: $RELEASE_BRANCH"
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Publish Release
|
|
2
|
+
# create a release from the latest tag on MAIN or something
|
|
3
|
+
|
|
4
|
+
env:
|
|
5
|
+
ACTIONS_STEP_DEBUG: true
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
workflow_run:
|
|
9
|
+
workflows: [Merge Release Branch and Tag]
|
|
10
|
+
types: [completed]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
release:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: '3.11'
|
|
23
|
+
|
|
24
|
+
- name: Install UV
|
|
25
|
+
uses: astral-sh/setup-uv@v5
|
|
26
|
+
|
|
27
|
+
- name: Get Latest Tag
|
|
28
|
+
id: get_tag
|
|
29
|
+
run: |
|
|
30
|
+
git branch --list
|
|
31
|
+
git log --oneline --tags -n10 --pretty=format:'%h %as %cn %x09%s %d'
|
|
32
|
+
echo
|
|
33
|
+
echo "current ref is ${{ github.ref_name }}"
|
|
34
|
+
latest_tag="$(git describe --tags --abbrev=0)"
|
|
35
|
+
echo "latest tag: ${latest_tag}"
|
|
36
|
+
echo latest_tag="${latest_tag}" >> $GITHUB_OUTPUT
|
|
37
|
+
|
|
38
|
+
- name: Build UV Distribution from Latest Tag
|
|
39
|
+
run: |
|
|
40
|
+
git checkout "${{ steps.get_tag.outputs.latest_tag }}"
|
|
41
|
+
uv build
|
|
42
|
+
|
|
43
|
+
- name: Validate Tag Matches Version
|
|
44
|
+
run: |
|
|
45
|
+
tag="${{ steps.get_tag.outputs.latest_tag }}"
|
|
46
|
+
app_version="v$(uv version | awk '{print $2}')"
|
|
47
|
+
echo "Git tag: ${tag}"
|
|
48
|
+
echo "App version: ${app_version}"
|
|
49
|
+
if [[ "${tag}" != "${app_version}" ]]; then
|
|
50
|
+
echo "ERROR: Git tag '${tag}' does not match pyproject.toml version '${app_version}'"
|
|
51
|
+
echo "Developer must ensure release branch has matching version in pyproject.toml"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
echo "Tag and version match"
|
|
55
|
+
|
|
56
|
+
- name: Create release from tag
|
|
57
|
+
id: create_release
|
|
58
|
+
uses: ncipollo/release-action@v1
|
|
59
|
+
with:
|
|
60
|
+
artifacts: "dist/*"
|
|
61
|
+
generateReleaseNotes: true
|
|
62
|
+
allowUpdates: true
|
|
63
|
+
tag: ${{ steps.get_tag.outputs.latest_tag }}
|
|
64
|
+
|
|
65
|
+
- name: Publish to PyPI
|
|
66
|
+
run: uv publish --token ${{ secrets.PYPI_TOKEN }}
|
|
67
|
+
|
|
68
|
+
- name: Release URL Output
|
|
69
|
+
run: |
|
|
70
|
+
echo release URL: ${{ steps.create_release.outputs.html_url }}
|
|
71
|
+
echo PyPI: https://pypi.org/project/desertislandutils/
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: Test desertislandutils
|
|
2
|
+
|
|
3
|
+
env:
|
|
4
|
+
ACTIONS_STEP_DEBUG: true
|
|
5
|
+
|
|
6
|
+
concurrency:
|
|
7
|
+
group: test-${{ github.ref }}
|
|
8
|
+
cancel-in-progress: true
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
branches:
|
|
13
|
+
- '**'
|
|
14
|
+
paths-ignore:
|
|
15
|
+
- '**.md'
|
|
16
|
+
pull_request:
|
|
17
|
+
branches: [main]
|
|
18
|
+
paths-ignore: ['**.md']
|
|
19
|
+
|
|
20
|
+
# NOTE: workflow_dispatch only work on main
|
|
21
|
+
workflow_dispatch:
|
|
22
|
+
inputs:
|
|
23
|
+
note:
|
|
24
|
+
description: 'Describe why you are doing this'
|
|
25
|
+
required: false
|
|
26
|
+
default: 'no message'
|
|
27
|
+
manual_workflow_conclusion:
|
|
28
|
+
description: 'Insert success/failure for downstream'
|
|
29
|
+
required: false
|
|
30
|
+
default: ''
|
|
31
|
+
type: choice
|
|
32
|
+
options:
|
|
33
|
+
- ' '
|
|
34
|
+
- failure
|
|
35
|
+
- success
|
|
36
|
+
|
|
37
|
+
jobs:
|
|
38
|
+
uv-run-tests:
|
|
39
|
+
runs-on: macos-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
- uses: actions/setup-python@v5
|
|
43
|
+
with:
|
|
44
|
+
python-version: '3.11'
|
|
45
|
+
|
|
46
|
+
- name: Install UV
|
|
47
|
+
uses: astral-sh/setup-uv@v5
|
|
48
|
+
|
|
49
|
+
- name: UV Sync and Test
|
|
50
|
+
run: |
|
|
51
|
+
python --version
|
|
52
|
+
uv --version
|
|
53
|
+
uv sync --all-extras
|
|
54
|
+
uv run pytest --disable-warnings --verbose
|
|
55
|
+
echo "WARNING: Pytest Warnings are disabled"
|
|
56
|
+
|
|
57
|
+
- name: Get Latest Tag
|
|
58
|
+
id: get_tag
|
|
59
|
+
run: |
|
|
60
|
+
latest_tag="$(git ls-remote origin 'refs/tags/v*[0-9]' | awk -F'refs/tags/' '{print $2}' | sort -V | tail -1)"
|
|
61
|
+
echo latest_tag="${latest_tag}" >> $GITHUB_OUTPUT
|
|
62
|
+
|
|
63
|
+
- name: Get desertislandutils Version
|
|
64
|
+
id: app_version
|
|
65
|
+
run: |
|
|
66
|
+
app_version="$(uv version | awk '{print $2}')"
|
|
67
|
+
echo app_version="v${app_version}" >> $GITHUB_OUTPUT
|
|
68
|
+
|
|
69
|
+
- name: REFERENCE - Variables and Workflow Contexts
|
|
70
|
+
run: |
|
|
71
|
+
echo "workflow: ${{ github.workflow }}"
|
|
72
|
+
echo "job_id: ${{ github.job }}"
|
|
73
|
+
echo "job status: ${{ job.status }}"
|
|
74
|
+
echo "commit ref name: ${{ github.ref_name }}"
|
|
75
|
+
echo "branch name: ${{ github.ref }}"
|
|
76
|
+
echo "latest tag: ${{ steps.get_tag.outputs.latest_tag }}"
|
|
77
|
+
echo "app version: ${{ steps.app_version.outputs.app_version }}"
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# python gitignore standards
|
|
2
|
+
# https://github.com/github/gitignore/blob/main/Python.gitignore
|
|
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
|
+
share/python-wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
cover/
|
|
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
|
+
.pybuilder/
|
|
79
|
+
target/
|
|
80
|
+
|
|
81
|
+
# Jupyter Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
83
|
+
|
|
84
|
+
# IPython
|
|
85
|
+
profile_default/
|
|
86
|
+
ipython_config.py
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
90
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
91
|
+
# .python-version
|
|
92
|
+
|
|
93
|
+
# pipenv
|
|
94
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
95
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
96
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
97
|
+
# install all needed dependencies.
|
|
98
|
+
#Pipfile.lock
|
|
99
|
+
|
|
100
|
+
# poetry
|
|
101
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
102
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
103
|
+
# commonly ignored for libraries.
|
|
104
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
105
|
+
#poetry.lock
|
|
106
|
+
|
|
107
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
108
|
+
__pypackages__/
|
|
109
|
+
|
|
110
|
+
# Celery stuff
|
|
111
|
+
celerybeat-schedule
|
|
112
|
+
celerybeat.pid
|
|
113
|
+
|
|
114
|
+
# SageMath parsed files
|
|
115
|
+
*.sage.py
|
|
116
|
+
|
|
117
|
+
# Environments
|
|
118
|
+
.env
|
|
119
|
+
.venv
|
|
120
|
+
env/
|
|
121
|
+
venv/
|
|
122
|
+
ENV/
|
|
123
|
+
env.bak/
|
|
124
|
+
venv.bak/
|
|
125
|
+
|
|
126
|
+
# Spyder project settings
|
|
127
|
+
.spyderproject
|
|
128
|
+
.spyproject
|
|
129
|
+
|
|
130
|
+
# Rope project settings
|
|
131
|
+
.ropeproject
|
|
132
|
+
|
|
133
|
+
# mkdocs documentation
|
|
134
|
+
/site
|
|
135
|
+
|
|
136
|
+
# mypy
|
|
137
|
+
.mypy_cache/
|
|
138
|
+
.dmypy.json
|
|
139
|
+
dmypy.json
|
|
140
|
+
|
|
141
|
+
# Pyre type checker
|
|
142
|
+
.pyre/
|
|
143
|
+
|
|
144
|
+
# pytype static type analyzer
|
|
145
|
+
.pytype/
|
|
146
|
+
|
|
147
|
+
# Cython debug symbols
|
|
148
|
+
cython_debug/
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: desertislandutils
|
|
3
|
+
Version: 0.4.3
|
|
4
|
+
Summary: A collection of personal convenience utilities
|
|
5
|
+
Project-URL: Homepage, https://github.com/mahiki/desertislandutils
|
|
6
|
+
Project-URL: Repository, https://github.com/mahiki/desertislandutils
|
|
7
|
+
Project-URL: Issues, https://github.com/mahiki/desertislandutils/issues
|
|
8
|
+
Author-email: mahiki <mahiki@users.noreply.github.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Requires-Dist: argparse>=1.4.0
|
|
12
|
+
Requires-Dist: gitpython>=3.1.27
|
|
13
|
+
Requires-Dist: pendulum>=3.0.0
|
|
14
|
+
Requires-Dist: typer>=0.12.0
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: ptpython>=3.0.23; extra == 'dev'
|
|
17
|
+
Provides-Extra: test
|
|
18
|
+
Requires-Dist: pytest>=7.2.2; extra == 'test'
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# desertislandutils
|
|
22
|
+
|
|
23
|
+
A collection of personal convenience utilities for managing parallel directory structures and ISO week numbers. Written in Python because it's far better than shell scripting!
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
Install globally using `uv`:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
uv tool install desertislandutils
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Update to the latest version:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
uv tool upgrade desertislandutils
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## The Utils
|
|
40
|
+
|
|
41
|
+
### toobigdatadoc (`too`)
|
|
42
|
+
|
|
43
|
+
Manage parallel directory structures for separating text files from large binary files and datasets. Creates symlinked folders under `HOME/{toobig|toodata|toodoc}`:
|
|
44
|
+
|
|
45
|
+
- `toobig` - Large files excluded from backups
|
|
46
|
+
- `toodata` - Small-ish data files
|
|
47
|
+
- `toodoc` - Binary files like PDFs and images
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
$HOME
|
|
51
|
+
|-- toobig
|
|
52
|
+
|-- # replicated folder paths with large files here, assume not to be backed up
|
|
53
|
+
|-- toodata
|
|
54
|
+
|-- # small-ish data files in support of the parallel root
|
|
55
|
+
|-- toodoc
|
|
56
|
+
|-- # usually pdfs or image files
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Usage:**
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
too --help
|
|
63
|
+
|
|
64
|
+
usage: too [-h] {big,data,doc}
|
|
65
|
+
|
|
66
|
+
Create symlinked parallel folders under HOME/{toobig|toodata|toodoc}, to
|
|
67
|
+
contain data/binary files outside of git repo or away from source/text files.
|
|
68
|
+
|
|
69
|
+
positional arguments:
|
|
70
|
+
{big,data,doc} large files to exclude from backup, smallish datasets,
|
|
71
|
+
binary files like pdf
|
|
72
|
+
|
|
73
|
+
options:
|
|
74
|
+
-h, --help show this help message and exit
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### weeknumber (`wn`)
|
|
78
|
+
|
|
79
|
+
Get ISO year week numbers in YYYY-WDD format. Default weekend day is Saturday.
|
|
80
|
+
|
|
81
|
+
**Usage:**
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
wn --help
|
|
85
|
+
|
|
86
|
+
Usage: wn [OPTIONS] [DATE]
|
|
87
|
+
|
|
88
|
+
ISO year week number of a date as YYYY-"W"WW. Default weekend day is Saturday.
|
|
89
|
+
|
|
90
|
+
Example:
|
|
91
|
+
|
|
92
|
+
$> wn 'Jul 22 2020' --last
|
|
93
|
+
|
|
94
|
+
2020-W29
|
|
95
|
+
|
|
96
|
+
╭─ Arguments ────────────────────────────────────────────────────────────────╮
|
|
97
|
+
│ date [DATE] A text expression of date, ex: 'November 27', or │
|
|
98
|
+
│ 2112-07-29. Default is today's in current TZ. │
|
|
99
|
+
│ [default: (dynamic)] │
|
|
100
|
+
╰────────────────────────────────────────────────────────────────────────────╯
|
|
101
|
+
╭─ Options ──────────────────────────────────────────────────────────────────╮
|
|
102
|
+
│ --sunday Week end is Saturday by default, this flag sets │
|
|
103
|
+
│ Sunday weekend day (ISO standard). │
|
|
104
|
+
│ --last Give week number of most recently completed week │
|
|
105
|
+
│ (overrides DATE argument). │
|
|
106
|
+
│ --verbose -v Full parsed date details for verification. │
|
|
107
|
+
│ --install-completion Install completion for the current shell. │
|
|
108
|
+
│ --show-completion Show completion for the current shell, to copy it │
|
|
109
|
+
│ or customize the installation. │
|
|
110
|
+
│ --help Show this message and exit. │
|
|
111
|
+
╰────────────────────────────────────────────────────────────────────────────╯
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Examples:**
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
# Get current week number
|
|
118
|
+
wn
|
|
119
|
+
|
|
120
|
+
# Get week number for a specific date
|
|
121
|
+
wn 'Jul 22'
|
|
122
|
+
|
|
123
|
+
# Get last completed week number
|
|
124
|
+
wn --last
|
|
125
|
+
|
|
126
|
+
# Parse a specific date with details
|
|
127
|
+
wn 'November 27 2024' --verbose
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Development
|
|
133
|
+
|
|
134
|
+
Built with modern Python tooling:
|
|
135
|
+
|
|
136
|
+
- **Build system:** `uv`
|
|
137
|
+
- **Deploy:** PyPI via GitHub Actions CI/CD
|
|
138
|
+
- **Package manager:** `uv`
|
|
139
|
+
|
|
140
|
+
### Setup
|
|
141
|
+
|
|
142
|
+
```sh
|
|
143
|
+
# Clone the repository
|
|
144
|
+
git clone https://github.com/mahiki/desertislandutils.git
|
|
145
|
+
cd desertislandutils
|
|
146
|
+
|
|
147
|
+
# Install dependencies (including dev extras)
|
|
148
|
+
uv sync --all-extras
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Testing
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
# Run tests
|
|
155
|
+
just test
|
|
156
|
+
|
|
157
|
+
# Or directly with uv
|
|
158
|
+
uv run --extra test pytest --disable-warnings --verbose
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Local Development
|
|
162
|
+
|
|
163
|
+
```sh
|
|
164
|
+
# Run commands directly from source
|
|
165
|
+
uv run wn --help
|
|
166
|
+
uv run too --help
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Project Tasks
|
|
170
|
+
|
|
171
|
+
See the `justfile` for available commands:
|
|
172
|
+
|
|
173
|
+
```sh
|
|
174
|
+
just --list
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
MIT
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# desertislandutils
|
|
2
|
+
|
|
3
|
+
A collection of personal convenience utilities for managing parallel directory structures and ISO week numbers. Written in Python because it's far better than shell scripting!
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install globally using `uv`:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
uv tool install desertislandutils
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Update to the latest version:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
uv tool upgrade desertislandutils
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## The Utils
|
|
20
|
+
|
|
21
|
+
### toobigdatadoc (`too`)
|
|
22
|
+
|
|
23
|
+
Manage parallel directory structures for separating text files from large binary files and datasets. Creates symlinked folders under `HOME/{toobig|toodata|toodoc}`:
|
|
24
|
+
|
|
25
|
+
- `toobig` - Large files excluded from backups
|
|
26
|
+
- `toodata` - Small-ish data files
|
|
27
|
+
- `toodoc` - Binary files like PDFs and images
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
$HOME
|
|
31
|
+
|-- toobig
|
|
32
|
+
|-- # replicated folder paths with large files here, assume not to be backed up
|
|
33
|
+
|-- toodata
|
|
34
|
+
|-- # small-ish data files in support of the parallel root
|
|
35
|
+
|-- toodoc
|
|
36
|
+
|-- # usually pdfs or image files
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Usage:**
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
too --help
|
|
43
|
+
|
|
44
|
+
usage: too [-h] {big,data,doc}
|
|
45
|
+
|
|
46
|
+
Create symlinked parallel folders under HOME/{toobig|toodata|toodoc}, to
|
|
47
|
+
contain data/binary files outside of git repo or away from source/text files.
|
|
48
|
+
|
|
49
|
+
positional arguments:
|
|
50
|
+
{big,data,doc} large files to exclude from backup, smallish datasets,
|
|
51
|
+
binary files like pdf
|
|
52
|
+
|
|
53
|
+
options:
|
|
54
|
+
-h, --help show this help message and exit
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### weeknumber (`wn`)
|
|
58
|
+
|
|
59
|
+
Get ISO year week numbers in YYYY-WDD format. Default weekend day is Saturday.
|
|
60
|
+
|
|
61
|
+
**Usage:**
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
wn --help
|
|
65
|
+
|
|
66
|
+
Usage: wn [OPTIONS] [DATE]
|
|
67
|
+
|
|
68
|
+
ISO year week number of a date as YYYY-"W"WW. Default weekend day is Saturday.
|
|
69
|
+
|
|
70
|
+
Example:
|
|
71
|
+
|
|
72
|
+
$> wn 'Jul 22 2020' --last
|
|
73
|
+
|
|
74
|
+
2020-W29
|
|
75
|
+
|
|
76
|
+
╭─ Arguments ────────────────────────────────────────────────────────────────╮
|
|
77
|
+
│ date [DATE] A text expression of date, ex: 'November 27', or │
|
|
78
|
+
│ 2112-07-29. Default is today's in current TZ. │
|
|
79
|
+
│ [default: (dynamic)] │
|
|
80
|
+
╰────────────────────────────────────────────────────────────────────────────╯
|
|
81
|
+
╭─ Options ──────────────────────────────────────────────────────────────────╮
|
|
82
|
+
│ --sunday Week end is Saturday by default, this flag sets │
|
|
83
|
+
│ Sunday weekend day (ISO standard). │
|
|
84
|
+
│ --last Give week number of most recently completed week │
|
|
85
|
+
│ (overrides DATE argument). │
|
|
86
|
+
│ --verbose -v Full parsed date details for verification. │
|
|
87
|
+
│ --install-completion Install completion for the current shell. │
|
|
88
|
+
│ --show-completion Show completion for the current shell, to copy it │
|
|
89
|
+
│ or customize the installation. │
|
|
90
|
+
│ --help Show this message and exit. │
|
|
91
|
+
╰────────────────────────────────────────────────────────────────────────────╯
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Examples:**
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
# Get current week number
|
|
98
|
+
wn
|
|
99
|
+
|
|
100
|
+
# Get week number for a specific date
|
|
101
|
+
wn 'Jul 22'
|
|
102
|
+
|
|
103
|
+
# Get last completed week number
|
|
104
|
+
wn --last
|
|
105
|
+
|
|
106
|
+
# Parse a specific date with details
|
|
107
|
+
wn 'November 27 2024' --verbose
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Development
|
|
113
|
+
|
|
114
|
+
Built with modern Python tooling:
|
|
115
|
+
|
|
116
|
+
- **Build system:** `uv`
|
|
117
|
+
- **Deploy:** PyPI via GitHub Actions CI/CD
|
|
118
|
+
- **Package manager:** `uv`
|
|
119
|
+
|
|
120
|
+
### Setup
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
# Clone the repository
|
|
124
|
+
git clone https://github.com/mahiki/desertislandutils.git
|
|
125
|
+
cd desertislandutils
|
|
126
|
+
|
|
127
|
+
# Install dependencies (including dev extras)
|
|
128
|
+
uv sync --all-extras
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Testing
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
# Run tests
|
|
135
|
+
just test
|
|
136
|
+
|
|
137
|
+
# Or directly with uv
|
|
138
|
+
uv run --extra test pytest --disable-warnings --verbose
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Local Development
|
|
142
|
+
|
|
143
|
+
```sh
|
|
144
|
+
# Run commands directly from source
|
|
145
|
+
uv run wn --help
|
|
146
|
+
uv run too --help
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Project Tasks
|
|
150
|
+
|
|
151
|
+
See the `justfile` for available commands:
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
just --list
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT
|
|
File without changes
|