take-note-cli 1.1.0__tar.gz → 1.2.1__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.
- {take-note-cli-1.1.0/src/take_note_cli.egg-info → take_note_cli-1.2.1}/PKG-INFO +39 -51
- {take-note-cli-1.1.0 → take_note_cli-1.2.1}/README.md +28 -35
- take_note_cli-1.2.1/pyproject.toml +52 -0
- {take-note-cli-1.1.0/src/takenote → take_note_cli-1.2.1/src/take_note_cli}/__main__.py +1 -3
- {take-note-cli-1.1.0/src/takenote → take_note_cli-1.2.1/src/take_note_cli}/core/notes.py +25 -9
- take_note_cli-1.2.1/src/take_note_cli/utils/__init__.py +0 -0
- {take-note-cli-1.1.0/src/takenote → take_note_cli-1.2.1/src/take_note_cli}/utils/args.py +10 -7
- {take-note-cli-1.1.0/src/takenote → take_note_cli-1.2.1/src/take_note_cli}/utils/dates.py +4 -5
- {take-note-cli-1.1.0/src/takenote → take_note_cli-1.2.1/src/take_note_cli}/utils/paths.py +1 -1
- take-note-cli-1.1.0/MANIFEST.in +0 -1
- take-note-cli-1.1.0/PKG-INFO +0 -181
- take-note-cli-1.1.0/pyproject.toml +0 -8
- take-note-cli-1.1.0/setup.cfg +0 -54
- take-note-cli-1.1.0/src/take_note_cli.egg-info/SOURCES.txt +0 -20
- take-note-cli-1.1.0/src/take_note_cli.egg-info/dependency_links.txt +0 -1
- take-note-cli-1.1.0/src/take_note_cli.egg-info/entry_points.txt +0 -2
- take-note-cli-1.1.0/src/take_note_cli.egg-info/requires.txt +0 -5
- take-note-cli-1.1.0/src/take_note_cli.egg-info/top_level.txt +0 -1
- take-note-cli-1.1.0/src/takenote/__init__.py +0 -1
- take-note-cli-1.1.0/src/takenote/__version__.py +0 -1
- {take-note-cli-1.1.0 → take_note_cli-1.2.1}/LICENSE +0 -0
- {take-note-cli-1.1.0/src/takenote/core → take_note_cli-1.2.1/src/take_note_cli}/__init__.py +0 -0
- {take-note-cli-1.1.0/src/takenote/utils → take_note_cli-1.2.1/src/take_note_cli/core}/__init__.py +0 -0
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: take-note-cli
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Create and open notes in your favourite editor.
|
|
5
5
|
Home-page: https://github.com/wsinned/take-note
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: note,tool,utility,cli
|
|
6
8
|
Author: wsinned
|
|
7
9
|
Author-email: wsinned@tutanota.com
|
|
8
|
-
|
|
9
|
-
Keywords: note tool utility cli
|
|
10
|
+
Requires-Python: >=3.8,<4.0
|
|
10
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
12
|
Classifier: Environment :: Console
|
|
12
|
-
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Topic :: Utilities
|
|
16
14
|
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier:
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
18
17
|
Classifier: Programming Language :: Python :: 3
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.8
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
-
Classifier: Programming Language :: Python :: 3
|
|
24
|
-
Classifier:
|
|
25
|
-
|
|
26
|
-
Description-Content-Type: text/markdown
|
|
27
|
-
License-File: LICENSE
|
|
28
|
-
Provides-Extra: test
|
|
29
|
-
Requires-Dist: pytest; extra == "test"
|
|
30
|
-
Requires-Dist: dateutils; extra == "test"
|
|
31
|
-
Requires-Dist: black; extra == "test"
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Utilities
|
|
24
|
+
Project-URL: Repository, https://github.com/wsinned/take-note
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
32
26
|
|
|
33
27
|
# Take Note
|
|
34
28
|
|
|
@@ -41,6 +35,7 @@ Requires-Dist: black; extra == "test"
|
|
|
41
35
|
- Open notes files for specified week using the `code` command line for VS Code.
|
|
42
36
|
- --thisWeek, --lastWeek and --nextWeek are supported.
|
|
43
37
|
- Organises notes in a date based folder structure from your root notes folder, e.g. 2023/08
|
|
38
|
+
- The default folder is $HOME/Notes
|
|
44
39
|
- set the root notes folder using --notesFolder
|
|
45
40
|
- Choose which editor to use with --editor
|
|
46
41
|
- Specify a VS Code workspace to open along with the note file with --workspace
|
|
@@ -84,12 +79,11 @@ A note will be created in the under the MyNotes/YYYY/mm folder named with the da
|
|
|
84
79
|
Setting up aliases in you preferred shell is a great way to make accessing your notes quick and easy.
|
|
85
80
|
|
|
86
81
|
```bash
|
|
87
|
-
|
|
88
|
-
args="--notesFolder $notes_folder --workspace notes.code-workspace --template Home-weekly-log-template.md"
|
|
82
|
+
NOTES_FOLDER="$HOME/SomePath/MyNotes"
|
|
89
83
|
|
|
90
|
-
alias thisWeek="take-note --thisWeek $
|
|
91
|
-
alias nextWeek="take-note --nextWeek $
|
|
92
|
-
alias lastWeek="take-note --lastWeek
|
|
84
|
+
alias thisWeek="take-note --thisWeek --notesFolder $NOTES_FOLDER --workspace notes.code-workspace"
|
|
85
|
+
alias nextWeek="take-note --nextWeek --notesFolder $NOTES_FOLDER --workspace notes.code-workspace --batch 5"
|
|
86
|
+
alias lastWeek="take-note --lastWeek --editor hx"
|
|
93
87
|
```
|
|
94
88
|
|
|
95
89
|
All you have to do now is type one of the following to open the desired note file.
|
|
@@ -122,60 +116,54 @@ venv/bin/pip install -e .
|
|
|
122
116
|
|
|
123
117
|
The supplied shell.nix definition provides support for entering a nix-shell directly in the repository with all dependencies.
|
|
124
118
|
|
|
125
|
-
```
|
|
119
|
+
```bash
|
|
126
120
|
nix-shell --run zsh # ensure using zsh over default bash session
|
|
121
|
+
```
|
|
127
122
|
|
|
128
|
-
|
|
129
|
-
python -m venv venv
|
|
123
|
+
Then follow the instructions for other OS.
|
|
130
124
|
|
|
131
|
-
|
|
125
|
+
### Other Linux or macOS
|
|
132
126
|
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
```bash
|
|
128
|
+
# only needed once, or to recreate the virtual environment
|
|
129
|
+
# install dependencies
|
|
130
|
+
poetry install
|
|
135
131
|
|
|
136
|
-
# run
|
|
132
|
+
# enter an activated shell and run tests
|
|
133
|
+
poetry shell
|
|
137
134
|
pytest
|
|
135
|
+
ruff . --config pyproject.toml
|
|
138
136
|
|
|
139
|
-
#
|
|
140
|
-
|
|
137
|
+
# run the tests without activating a shell
|
|
138
|
+
poetry run pytest
|
|
139
|
+
|
|
140
|
+
# exit the shell
|
|
141
141
|
exit
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
```zsh
|
|
147
|
-
# only needed once, or to recreate the virtual environment
|
|
148
|
-
python -m venv venv
|
|
149
|
-
|
|
150
|
-
source venv/bin/activate
|
|
151
|
-
|
|
152
|
-
venv/bin/pip install -r requirements.txt -r requirements.dev.txt
|
|
153
|
-
|
|
154
|
-
# install with tests as editable src
|
|
155
|
-
venv/bin/pip install -e '.[test]'
|
|
144
|
+
## Linting
|
|
156
145
|
|
|
157
|
-
|
|
158
|
-
venv/bin/pytest
|
|
146
|
+
The project uses [ruff](https://github.com/charliermarsh/ruff) for linting and optionally for formatting.
|
|
159
147
|
|
|
160
|
-
|
|
161
|
-
|
|
148
|
+
```bash
|
|
149
|
+
poetry run ruff . --config pyproject.toml
|
|
162
150
|
```
|
|
163
151
|
|
|
164
152
|
## Build & Publish
|
|
165
153
|
|
|
166
154
|
From an installed and tested venv, do the following:
|
|
167
155
|
|
|
168
|
-
|
|
169
|
-
# check the version:
|
|
170
|
-
cat src/takenote/__version__.py
|
|
156
|
+
Bump the version inpyproject.tom
|
|
171
157
|
|
|
158
|
+
```bash
|
|
172
159
|
# build the package
|
|
173
|
-
|
|
160
|
+
poetry build
|
|
174
161
|
|
|
175
162
|
# publish the package
|
|
176
|
-
|
|
163
|
+
poetry publish
|
|
177
164
|
```
|
|
178
165
|
|
|
179
166
|
Credentials for twine should be either:
|
|
180
167
|
- stored in .pypirc in the [pypi] section
|
|
181
168
|
- entered at the prompt, username = **token** and password = your_api_key
|
|
169
|
+
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
- Open notes files for specified week using the `code` command line for VS Code.
|
|
10
10
|
- --thisWeek, --lastWeek and --nextWeek are supported.
|
|
11
11
|
- Organises notes in a date based folder structure from your root notes folder, e.g. 2023/08
|
|
12
|
+
- The default folder is $HOME/Notes
|
|
12
13
|
- set the root notes folder using --notesFolder
|
|
13
14
|
- Choose which editor to use with --editor
|
|
14
15
|
- Specify a VS Code workspace to open along with the note file with --workspace
|
|
@@ -52,12 +53,11 @@ A note will be created in the under the MyNotes/YYYY/mm folder named with the da
|
|
|
52
53
|
Setting up aliases in you preferred shell is a great way to make accessing your notes quick and easy.
|
|
53
54
|
|
|
54
55
|
```bash
|
|
55
|
-
|
|
56
|
-
args="--notesFolder $notes_folder --workspace notes.code-workspace --template Home-weekly-log-template.md"
|
|
56
|
+
NOTES_FOLDER="$HOME/SomePath/MyNotes"
|
|
57
57
|
|
|
58
|
-
alias thisWeek="take-note --thisWeek $
|
|
59
|
-
alias nextWeek="take-note --nextWeek $
|
|
60
|
-
alias lastWeek="take-note --lastWeek
|
|
58
|
+
alias thisWeek="take-note --thisWeek --notesFolder $NOTES_FOLDER --workspace notes.code-workspace"
|
|
59
|
+
alias nextWeek="take-note --nextWeek --notesFolder $NOTES_FOLDER --workspace notes.code-workspace --batch 5"
|
|
60
|
+
alias lastWeek="take-note --lastWeek --editor hx"
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
All you have to do now is type one of the following to open the desired note file.
|
|
@@ -90,58 +90,51 @@ venv/bin/pip install -e .
|
|
|
90
90
|
|
|
91
91
|
The supplied shell.nix definition provides support for entering a nix-shell directly in the repository with all dependencies.
|
|
92
92
|
|
|
93
|
-
```
|
|
93
|
+
```bash
|
|
94
94
|
nix-shell --run zsh # ensure using zsh over default bash session
|
|
95
|
+
```
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
python -m venv venv
|
|
97
|
+
Then follow the instructions for other OS.
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
### Other Linux or macOS
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
```bash
|
|
102
|
+
# only needed once, or to recreate the virtual environment
|
|
103
|
+
# install dependencies
|
|
104
|
+
poetry install
|
|
103
105
|
|
|
104
|
-
# run
|
|
106
|
+
# enter an activated shell and run tests
|
|
107
|
+
poetry shell
|
|
105
108
|
pytest
|
|
109
|
+
ruff . --config pyproject.toml
|
|
106
110
|
|
|
107
|
-
#
|
|
108
|
-
|
|
111
|
+
# run the tests without activating a shell
|
|
112
|
+
poetry run pytest
|
|
113
|
+
|
|
114
|
+
# exit the shell
|
|
109
115
|
exit
|
|
110
116
|
```
|
|
111
117
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```zsh
|
|
115
|
-
# only needed once, or to recreate the virtual environment
|
|
116
|
-
python -m venv venv
|
|
117
|
-
|
|
118
|
-
source venv/bin/activate
|
|
118
|
+
## Linting
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
The project uses [ruff](https://github.com/charliermarsh/ruff) for linting and optionally for formatting.
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
# run the tests
|
|
126
|
-
venv/bin/pytest
|
|
127
|
-
|
|
128
|
-
# close the virtual environment when done
|
|
129
|
-
deactivate
|
|
122
|
+
```bash
|
|
123
|
+
poetry run ruff . --config pyproject.toml
|
|
130
124
|
```
|
|
131
125
|
|
|
132
126
|
## Build & Publish
|
|
133
127
|
|
|
134
128
|
From an installed and tested venv, do the following:
|
|
135
129
|
|
|
136
|
-
|
|
137
|
-
# check the version:
|
|
138
|
-
cat src/takenote/__version__.py
|
|
130
|
+
Bump the version inpyproject.tom
|
|
139
131
|
|
|
132
|
+
```bash
|
|
140
133
|
# build the package
|
|
141
|
-
|
|
134
|
+
poetry build
|
|
142
135
|
|
|
143
136
|
# publish the package
|
|
144
|
-
|
|
137
|
+
poetry publish
|
|
145
138
|
```
|
|
146
139
|
|
|
147
140
|
Credentials for twine should be either:
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "take-note-cli"
|
|
3
|
+
version = "1.2.1"
|
|
4
|
+
description = "Create and open notes in your favourite editor."
|
|
5
|
+
license = "MIT"
|
|
6
|
+
authors = [
|
|
7
|
+
"wsinned <wsinned@tutanota.com>",
|
|
8
|
+
]
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
homepage = "https://github.com/wsinned/take-note"
|
|
11
|
+
repository = "https://github.com/wsinned/take-note"
|
|
12
|
+
keywords = ["note", "tool", "utility", "cli"]
|
|
13
|
+
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Natural Language :: English",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Topic :: Utilities",
|
|
21
|
+
"License :: OSI Approved :: MIT License",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
packages = [
|
|
25
|
+
{ include = "take_note_cli", from = "src" },
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[tool.poetry.dependencies]
|
|
29
|
+
python = "^3.8"
|
|
30
|
+
|
|
31
|
+
[tool.poetry.group.dev.dependencies]
|
|
32
|
+
pytest = "^7.4.3"
|
|
33
|
+
dateutils = "^0.6.12"
|
|
34
|
+
ruff = "^0.1.4"
|
|
35
|
+
|
|
36
|
+
[tool.poetry.scripts]
|
|
37
|
+
take-note = "take_note_cli.__main__:main"
|
|
38
|
+
|
|
39
|
+
[build-system]
|
|
40
|
+
requires = ["poetry-core"]
|
|
41
|
+
build-backend = "poetry.core.masonry.api"
|
|
42
|
+
|
|
43
|
+
[tool.pytest.ini_options]
|
|
44
|
+
pythonpath = [
|
|
45
|
+
"src"
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[tool.ruff]
|
|
49
|
+
src = ["src"]
|
|
50
|
+
|
|
51
|
+
[tool.ruff.per-file-ignores]
|
|
52
|
+
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
from datetime import date
|
|
1
|
+
from datetime import date
|
|
2
2
|
import sys
|
|
3
|
-
from
|
|
3
|
+
from take_note_cli.utils.paths import (
|
|
4
4
|
generate_note_folder,
|
|
5
5
|
generate_note_path,
|
|
6
6
|
generate_template_path,
|
|
7
7
|
)
|
|
8
|
-
from
|
|
8
|
+
from take_note_cli.utils.dates import (
|
|
9
9
|
get_monday,
|
|
10
10
|
get_time_delta_from_options,
|
|
11
11
|
format_header_date,
|
|
12
12
|
get_weeks_delta,
|
|
13
13
|
)
|
|
14
|
-
from
|
|
14
|
+
from take_note_cli.utils.args import process_args
|
|
15
15
|
from subprocess import call
|
|
16
16
|
|
|
17
17
|
|
|
@@ -50,35 +50,51 @@ def get_path_for_file(week: date, folder_path):
|
|
|
50
50
|
def create_batch_of_files(options, week, template_path):
|
|
51
51
|
initial_note_path = None
|
|
52
52
|
if options.batch is not None:
|
|
53
|
-
for i in range(
|
|
53
|
+
for i in range(options.batch):
|
|
54
54
|
batch_week = week + get_weeks_delta(i)
|
|
55
55
|
note_path, file_exists = get_path_for_file(batch_week, options.notesFolder)
|
|
56
|
-
if i ==
|
|
56
|
+
if i == 0:
|
|
57
57
|
initial_note_path = note_path
|
|
58
58
|
|
|
59
59
|
if not file_exists:
|
|
60
60
|
if options.verbose:
|
|
61
61
|
print(f"Creating file: {note_path}")
|
|
62
62
|
create_file(note_path, template_path, batch_week)
|
|
63
|
+
else:
|
|
64
|
+
initial_note_path, file_exists = get_path_for_file(week, options.notesFolder)
|
|
65
|
+
if not file_exists:
|
|
66
|
+
if options.verbose:
|
|
67
|
+
print(f"Creating file: {initial_note_path}")
|
|
68
|
+
create_file(initial_note_path, template_path, week)
|
|
69
|
+
|
|
63
70
|
return initial_note_path
|
|
64
71
|
|
|
65
72
|
|
|
66
|
-
def open_file(folder_path, editor, note_file, workspace=None):
|
|
73
|
+
def open_file(folder_path, editor, note_file, verbose, workspace=None):
|
|
67
74
|
args = [editor, note_file]
|
|
68
75
|
if workspace:
|
|
69
76
|
args.append(folder_path.joinpath(workspace))
|
|
70
77
|
|
|
78
|
+
if verbose:
|
|
79
|
+
print(f"Opening file with args: {args}")
|
|
80
|
+
|
|
71
81
|
call(args)
|
|
72
82
|
|
|
73
83
|
|
|
74
84
|
def main(argv):
|
|
85
|
+
template_path = None
|
|
75
86
|
options, parser = process_args(argv)
|
|
87
|
+
|
|
76
88
|
if options.verbose:
|
|
89
|
+
print("Welcome to take-note-cli")
|
|
77
90
|
print(options)
|
|
78
91
|
|
|
79
92
|
delta = calculate_week_offset(options, parser)
|
|
80
93
|
week = get_monday(date.today()) + delta
|
|
81
|
-
|
|
94
|
+
|
|
95
|
+
if options.template is not None:
|
|
96
|
+
template_path = generate_template_path(options.notesFolder, options.template)
|
|
97
|
+
|
|
82
98
|
note_path = create_batch_of_files(options, week, template_path)
|
|
83
99
|
|
|
84
|
-
open_file(options.notesFolder, options.editor, note_path, options.workspace)
|
|
100
|
+
open_file(options.notesFolder, options.editor, note_path, options.verbose, options.workspace)
|
|
File without changes
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import pathlib
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import importlib.metadata
|
|
4
|
+
|
|
5
|
+
__version__ = importlib.metadata.version("take-note-cli")
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
def init_argparse() -> argparse.ArgumentParser:
|
|
8
|
-
help_text = """Create a notes file for the requested
|
|
9
|
-
|
|
9
|
+
help_text = """Create a notes file for the requested
|
|
10
|
+
week."""
|
|
10
11
|
|
|
11
12
|
parser = argparse.ArgumentParser(usage="%(prog)s [OPTIONS]", description=help_text)
|
|
12
13
|
parser.add_argument(
|
|
13
14
|
"-v",
|
|
14
15
|
"--version",
|
|
15
16
|
action="version",
|
|
16
|
-
version=f"{parser.prog} version {
|
|
17
|
+
version=f"{parser.prog} version {__version__}",
|
|
17
18
|
)
|
|
18
19
|
parser.add_argument(
|
|
19
20
|
"--verbose",
|
|
@@ -26,7 +27,8 @@ def init_argparse() -> argparse.ArgumentParser:
|
|
|
26
27
|
default=pathlib.Path.home().joinpath("Notes"),
|
|
27
28
|
type=pathlib.Path,
|
|
28
29
|
help="""The root path for the notes folder.
|
|
29
|
-
If not supplied this defaults to the Notes
|
|
30
|
+
If not supplied this defaults to the Notes
|
|
31
|
+
folder in the users home folder.""",
|
|
30
32
|
)
|
|
31
33
|
parser.add_argument(
|
|
32
34
|
"--editor",
|
|
@@ -38,7 +40,8 @@ def init_argparse() -> argparse.ArgumentParser:
|
|
|
38
40
|
"--workspace",
|
|
39
41
|
default=None,
|
|
40
42
|
help="""The VSCode workspace to open along with the notes.
|
|
41
|
-
If supplied this overrides the --editor option to 'code'
|
|
43
|
+
If supplied this overrides the --editor option to 'code'
|
|
44
|
+
for Visual Studio Code""",
|
|
42
45
|
)
|
|
43
46
|
parser.add_argument(
|
|
44
47
|
"--thisWeek",
|
|
@@ -16,9 +16,8 @@ def format_file_date(the_date: date):
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
def get_time_delta_from_options(options):
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
elif options.lastWeek:
|
|
19
|
+
delta = timedelta(0)
|
|
20
|
+
if options.lastWeek:
|
|
22
21
|
delta = timedelta(-WEEK)
|
|
23
22
|
elif options.nextWeek:
|
|
24
23
|
delta = timedelta(WEEK)
|
|
@@ -27,7 +26,7 @@ def get_time_delta_from_options(options):
|
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
def get_weeks_delta(weeks: int):
|
|
30
|
-
if weeks >=
|
|
29
|
+
if weeks >= 0:
|
|
31
30
|
return timedelta(WEEK * weeks)
|
|
32
31
|
else:
|
|
33
|
-
raise ValueError("Batch size must be
|
|
32
|
+
raise ValueError("Batch size must be 0 or greater.")
|
take-note-cli-1.1.0/MANIFEST.in
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
include LICENSE *.md
|
take-note-cli-1.1.0/PKG-INFO
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: take-note-cli
|
|
3
|
-
Version: 1.1.0
|
|
4
|
-
Summary: Create and open notes in your favourite editor.
|
|
5
|
-
Home-page: https://github.com/wsinned/take-note
|
|
6
|
-
Author: wsinned
|
|
7
|
-
Author-email: wsinned@tutanota.com
|
|
8
|
-
Project-URL: Source, https://github.com/wsinned/take-note
|
|
9
|
-
Keywords: note tool utility cli
|
|
10
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
-
Classifier: Environment :: Console
|
|
12
|
-
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Topic :: Utilities
|
|
16
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
-
Classifier: Programming Language :: Python
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
25
|
-
Requires-Python: <4,>=3.8
|
|
26
|
-
Description-Content-Type: text/markdown; charset=UTF-8
|
|
27
|
-
License-File: LICENSE
|
|
28
|
-
Provides-Extra: test
|
|
29
|
-
Requires-Dist: pytest; extra == "test"
|
|
30
|
-
Requires-Dist: dateutils; extra == "test"
|
|
31
|
-
Requires-Dist: black; extra == "test"
|
|
32
|
-
|
|
33
|
-
# Take Note
|
|
34
|
-
|
|
35
|
-
**Create and open notes in your favourite editor.**
|
|
36
|
-
|
|
37
|
-
## Features
|
|
38
|
-
|
|
39
|
-
- Written in Python with no runtime dependencies.
|
|
40
|
-
- Works on Python 3.8 - 3.11.
|
|
41
|
-
- Open notes files for specified week using the `code` command line for VS Code.
|
|
42
|
-
- --thisWeek, --lastWeek and --nextWeek are supported.
|
|
43
|
-
- Organises notes in a date based folder structure from your root notes folder, e.g. 2023/08
|
|
44
|
-
- set the root notes folder using --notesFolder
|
|
45
|
-
- Choose which editor to use with --editor
|
|
46
|
-
- Specify a VS Code workspace to open along with the note file with --workspace
|
|
47
|
-
- This will override the --editor setting to `code`
|
|
48
|
-
- Specify a template file relative to the root notes folder to use when a new file is created using --template. This also performs a simple replacement of the text HEADER_DATE with the date formatted as "%A %d %B %Y" to use in the document title.
|
|
49
|
-
- Support for batch creation of files in advance. This is useful if you use a device where you can edit files, but can't easily create them. Use --batch 5 along with any of the --*Week options to create that week and the following 4 weeks too.
|
|
50
|
-
|
|
51
|
-
## Future features
|
|
52
|
-
|
|
53
|
-
- Support for daily notes options.
|
|
54
|
-
|
|
55
|
-
## Installation
|
|
56
|
-
|
|
57
|
-
### pipx
|
|
58
|
-
|
|
59
|
-
The recommended way to install the published package is through [pipx](https://pypa.github.io/pipx/).
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
# from PyPI
|
|
63
|
-
pipx install take-note-cli
|
|
64
|
-
|
|
65
|
-
# direct from github
|
|
66
|
-
pipx install git+https://github.com/wsinned/take-note
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Usage
|
|
70
|
-
|
|
71
|
-
### Command Line
|
|
72
|
-
|
|
73
|
-
Specify a folder using the --notesFolder option, otherwise $HOME/Notes will be used
|
|
74
|
-
A week option must be supplied from --thisWeek, --lastWeek or --nextWeek
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
take-note --notesFolder=$HOME/MyNotes --thisWeek
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
A note will be created in the under the MyNotes/YYYY/mm folder named with the date of the Monday of this week, e.g. 2023-08-07-Weekly-log.md
|
|
81
|
-
|
|
82
|
-
### Aliases
|
|
83
|
-
|
|
84
|
-
Setting up aliases in you preferred shell is a great way to make accessing your notes quick and easy.
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
notes_folder="$HOME/SomePath/MyNotes"
|
|
88
|
-
args="--notesFolder $notes_folder --workspace notes.code-workspace --template Home-weekly-log-template.md"
|
|
89
|
-
|
|
90
|
-
alias thisWeek="take-note --thisWeek $args"
|
|
91
|
-
alias nextWeek="take-note --nextWeek $args"
|
|
92
|
-
alias lastWeek="take-note --lastWeek $args"
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
All you have to do now is type one of the following to open the desired note file.
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
> thisWeek
|
|
99
|
-
> lastWeek
|
|
100
|
-
> nextWeek
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Other Installation Methods
|
|
104
|
-
|
|
105
|
-
### Virtual Environment
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
python -m venv venv
|
|
109
|
-
|
|
110
|
-
source venv/bin/activate
|
|
111
|
-
|
|
112
|
-
venv/bin/pip install -r requirements.txt
|
|
113
|
-
|
|
114
|
-
# install with tests as editable src
|
|
115
|
-
venv/bin/pip install -e .
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Development
|
|
120
|
-
|
|
121
|
-
### Nix & NixOS
|
|
122
|
-
|
|
123
|
-
The supplied shell.nix definition provides support for entering a nix-shell directly in the repository with all dependencies.
|
|
124
|
-
|
|
125
|
-
```zsh
|
|
126
|
-
nix-shell --run zsh # ensure using zsh over default bash session
|
|
127
|
-
|
|
128
|
-
# only needed once, or to recreate the virtual environment
|
|
129
|
-
python -m venv venv
|
|
130
|
-
|
|
131
|
-
source venv/bin/activate
|
|
132
|
-
|
|
133
|
-
# install with tests as editable src
|
|
134
|
-
venv/bin/pip install -e '.[test]'
|
|
135
|
-
|
|
136
|
-
# run the tests
|
|
137
|
-
pytest
|
|
138
|
-
|
|
139
|
-
# close the virtual environment and exit the shell when done
|
|
140
|
-
deactivate
|
|
141
|
-
exit
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Other Linux or macOS
|
|
145
|
-
|
|
146
|
-
```zsh
|
|
147
|
-
# only needed once, or to recreate the virtual environment
|
|
148
|
-
python -m venv venv
|
|
149
|
-
|
|
150
|
-
source venv/bin/activate
|
|
151
|
-
|
|
152
|
-
venv/bin/pip install -r requirements.txt -r requirements.dev.txt
|
|
153
|
-
|
|
154
|
-
# install with tests as editable src
|
|
155
|
-
venv/bin/pip install -e '.[test]'
|
|
156
|
-
|
|
157
|
-
# run the tests
|
|
158
|
-
venv/bin/pytest
|
|
159
|
-
|
|
160
|
-
# close the virtual environment when done
|
|
161
|
-
deactivate
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Build & Publish
|
|
165
|
-
|
|
166
|
-
From an installed and tested venv, do the following:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
# check the version:
|
|
170
|
-
cat src/takenote/__version__.py
|
|
171
|
-
|
|
172
|
-
# build the package
|
|
173
|
-
venv/bin/pyproject-build
|
|
174
|
-
|
|
175
|
-
# publish the package
|
|
176
|
-
venv/bin/twine upload dist/*
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Credentials for twine should be either:
|
|
180
|
-
- stored in .pypirc in the [pypi] section
|
|
181
|
-
- entered at the prompt, username = **token** and password = your_api_key
|
take-note-cli-1.1.0/setup.cfg
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
[metadata]
|
|
2
|
-
name = take-note-cli
|
|
3
|
-
version = attr: takenote.__version__
|
|
4
|
-
description = Create and open notes in your favourite editor.
|
|
5
|
-
long_description = file: README.md
|
|
6
|
-
long_description_content_type = text/markdown; charset=UTF-8
|
|
7
|
-
license_files = LICENSE
|
|
8
|
-
author = wsinned
|
|
9
|
-
author_email = wsinned@tutanota.com
|
|
10
|
-
url = https://github.com/wsinned/take-note
|
|
11
|
-
project_urls =
|
|
12
|
-
Source = https://github.com/wsinned/take-note
|
|
13
|
-
keywords = note tool utility cli
|
|
14
|
-
classifiers =
|
|
15
|
-
Development Status :: 5 - Production/Stable
|
|
16
|
-
Environment :: Console
|
|
17
|
-
Natural Language :: English
|
|
18
|
-
Operating System :: OS Independent
|
|
19
|
-
Intended Audience :: Developers
|
|
20
|
-
Topic :: Utilities
|
|
21
|
-
License :: OSI Approved :: MIT License
|
|
22
|
-
Programming Language :: Python
|
|
23
|
-
Programming Language :: Python :: 3
|
|
24
|
-
Programming Language :: Python :: 3.8
|
|
25
|
-
Programming Language :: Python :: 3.9
|
|
26
|
-
Programming Language :: Python :: 3.10
|
|
27
|
-
Programming Language :: Python :: 3.11
|
|
28
|
-
Programming Language :: Python :: 3 :: Only
|
|
29
|
-
Programming Language :: Python :: Implementation :: CPython
|
|
30
|
-
|
|
31
|
-
[options.packages.find]
|
|
32
|
-
where = src
|
|
33
|
-
|
|
34
|
-
[options]
|
|
35
|
-
package_dir =
|
|
36
|
-
= src
|
|
37
|
-
packages = find:
|
|
38
|
-
include_package_data = True
|
|
39
|
-
python_requires = >=3.8, <4
|
|
40
|
-
|
|
41
|
-
[options.extras_require]
|
|
42
|
-
test =
|
|
43
|
-
pytest
|
|
44
|
-
dateutils
|
|
45
|
-
black
|
|
46
|
-
|
|
47
|
-
[options.entry_points]
|
|
48
|
-
console_scripts =
|
|
49
|
-
take-note = takenote.__main__:main
|
|
50
|
-
|
|
51
|
-
[egg_info]
|
|
52
|
-
tag_build =
|
|
53
|
-
tag_date = 0
|
|
54
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
MANIFEST.in
|
|
3
|
-
README.md
|
|
4
|
-
pyproject.toml
|
|
5
|
-
setup.cfg
|
|
6
|
-
src/take_note_cli.egg-info/PKG-INFO
|
|
7
|
-
src/take_note_cli.egg-info/SOURCES.txt
|
|
8
|
-
src/take_note_cli.egg-info/dependency_links.txt
|
|
9
|
-
src/take_note_cli.egg-info/entry_points.txt
|
|
10
|
-
src/take_note_cli.egg-info/requires.txt
|
|
11
|
-
src/take_note_cli.egg-info/top_level.txt
|
|
12
|
-
src/takenote/__init__.py
|
|
13
|
-
src/takenote/__main__.py
|
|
14
|
-
src/takenote/__version__.py
|
|
15
|
-
src/takenote/core/__init__.py
|
|
16
|
-
src/takenote/core/notes.py
|
|
17
|
-
src/takenote/utils/__init__.py
|
|
18
|
-
src/takenote/utils/args.py
|
|
19
|
-
src/takenote/utils/dates.py
|
|
20
|
-
src/takenote/utils/paths.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
takenote
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from . __version__ import __version__
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.1.0'
|
|
File without changes
|
|
File without changes
|
{take-note-cli-1.1.0/src/takenote/utils → take_note_cli-1.2.1/src/take_note_cli/core}/__init__.py
RENAMED
|
File without changes
|