supynote 0.8.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.
- supynote-0.8.0/.github/ISSUE_TEMPLATE/bug_report.md +36 -0
- supynote-0.8.0/.github/ISSUE_TEMPLATE/feature_request.md +31 -0
- supynote-0.8.0/.github/PULL_REQUEST_TEMPLATE.md +40 -0
- supynote-0.8.0/.github/workflows/ci.yml +61 -0
- supynote-0.8.0/.github/workflows/publish.yml +32 -0
- supynote-0.8.0/.gitignore +187 -0
- supynote-0.8.0/CHANGELOG.md +65 -0
- supynote-0.8.0/CLAUDE.md +89 -0
- supynote-0.8.0/CODE_OF_CONDUCT.md +131 -0
- supynote-0.8.0/CONTRIBUTING.md +123 -0
- supynote-0.8.0/LICENSE +21 -0
- supynote-0.8.0/PKG-INFO +248 -0
- supynote-0.8.0/README.md +206 -0
- supynote-0.8.0/changelog/DDD_REFACTORING.md +218 -0
- supynote-0.8.0/changelog/MIGRATION_PLAN.md +216 -0
- supynote-0.8.0/examples/automation/.env.example +48 -0
- supynote-0.8.0/examples/automation/README.md +179 -0
- supynote-0.8.0/examples/automation/com.supynote.sync.plist.example +40 -0
- supynote-0.8.0/examples/automation/sync_from_lan.sh +139 -0
- supynote-0.8.0/examples/automation/sync_from_server.sh +77 -0
- supynote-0.8.0/pyproject.toml +66 -0
- supynote-0.8.0/supynote/__init__.py +0 -0
- supynote-0.8.0/supynote/application/__init__.py +0 -0
- supynote-0.8.0/supynote/application/dtos/browse_dto.py +40 -0
- supynote-0.8.0/supynote/application/dtos/device_dto.py +42 -0
- supynote-0.8.0/supynote/application/dtos/device_info_dto.py +50 -0
- supynote-0.8.0/supynote/application/dtos/download_dto.py +96 -0
- supynote-0.8.0/supynote/application/dtos/list_files_dto.py +50 -0
- supynote-0.8.0/supynote/application/use_cases/browse_device.py +69 -0
- supynote-0.8.0/supynote/application/use_cases/download_use_case.py +250 -0
- supynote-0.8.0/supynote/application/use_cases/find_device.py +101 -0
- supynote-0.8.0/supynote/application/use_cases/get_device_info.py +73 -0
- supynote-0.8.0/supynote/application/use_cases/list_files.py +91 -0
- supynote-0.8.0/supynote/cli.py +153 -0
- supynote-0.8.0/supynote/converter.py +364 -0
- supynote-0.8.0/supynote/device_finder.py +94 -0
- supynote-0.8.0/supynote/domain/__init__.py +0 -0
- supynote-0.8.0/supynote/domain/device_management/__init__.py +0 -0
- supynote-0.8.0/supynote/domain/device_management/entities/device.py +152 -0
- supynote-0.8.0/supynote/domain/device_management/repositories/device_repository.py +51 -0
- supynote-0.8.0/supynote/domain/device_management/value_objects/device_connection.py +134 -0
- supynote-0.8.0/supynote/domain/note_management/__init__.py +0 -0
- supynote-0.8.0/supynote/domain/note_management/entities/note.py +201 -0
- supynote-0.8.0/supynote/domain/note_management/repositories/note_repository.py +72 -0
- supynote-0.8.0/supynote/domain/note_management/services/conversion_service.py +97 -0
- supynote-0.8.0/supynote/domain/note_management/value_objects/note_id.py +41 -0
- supynote-0.8.0/supynote/domain/note_management/value_objects/note_path.py +93 -0
- supynote-0.8.0/supynote/domain/note_management/value_objects/time_range_filter.py +81 -0
- supynote-0.8.0/supynote/domain/shared/__init__.py +0 -0
- supynote-0.8.0/supynote/domain/shared/base_entity.py +62 -0
- supynote-0.8.0/supynote/domain/shared/base_value_object.py +64 -0
- supynote-0.8.0/supynote/infrastructure/__init__.py +0 -0
- supynote-0.8.0/supynote/infrastructure/network/network_discovery_service.py +60 -0
- supynote-0.8.0/supynote/infrastructure/repositories/memory_device_repository.py +39 -0
- supynote-0.8.0/supynote/infrastructure/repositories/supernote_remote_repository.py +203 -0
- supynote-0.8.0/supynote/merger.py +517 -0
- supynote-0.8.0/supynote/ocr/__init__.py +6 -0
- supynote-0.8.0/supynote/ocr/entities.py +51 -0
- supynote-0.8.0/supynote/ocr/llava_service.py +212 -0
- supynote-0.8.0/supynote/ocr/native_service.py +581 -0
- supynote-0.8.0/supynote/ocr/pdf_processor.py +128 -0
- supynote-0.8.0/supynote/ocr/services.py +191 -0
- supynote-0.8.0/supynote/ocr/trocr_service.py +290 -0
- supynote-0.8.0/supynote/pdf_merger.py +196 -0
- supynote-0.8.0/supynote/presentation/__init__.py +0 -0
- supynote-0.8.0/supynote/presentation/cli/__init__.py +0 -0
- supynote-0.8.0/supynote/presentation/cli/commands/browse_command.py +33 -0
- supynote-0.8.0/supynote/presentation/cli/commands/commands.py +64 -0
- supynote-0.8.0/supynote/presentation/cli/commands/find_command.py +50 -0
- supynote-0.8.0/supynote/presentation/cli/commands/info_command.py +42 -0
- supynote-0.8.0/supynote/presentation/cli/commands/list_command.py +41 -0
- supynote-0.8.0/supynote/presentation/cli/container.py +114 -0
- supynote-0.8.0/supynote/presentation/cli/dispatcher.py +68 -0
- supynote-0.8.0/supynote/presentation/cli/main_refactored.py +74 -0
- supynote-0.8.0/supynote/services/post_processing_service.py +115 -0
- supynote-0.8.0/supynote/supernote.py +507 -0
- supynote-0.8.0/tests/integration/test_ddd_commands.py +201 -0
- supynote-0.8.0/tests/unit/test_use_cases.py +181 -0
- supynote-0.8.0/uv.lock +4842 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Report a bug or unexpected behavior
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Describe the Bug
|
|
10
|
+
A clear and concise description of what the bug is.
|
|
11
|
+
|
|
12
|
+
## To Reproduce
|
|
13
|
+
Steps to reproduce the behavior:
|
|
14
|
+
1. Run command '...'
|
|
15
|
+
2. See error '...'
|
|
16
|
+
|
|
17
|
+
## Expected Behavior
|
|
18
|
+
A clear and concise description of what you expected to happen.
|
|
19
|
+
|
|
20
|
+
## Environment
|
|
21
|
+
- OS: [e.g., macOS 14.0, Ubuntu 22.04, Windows 11]
|
|
22
|
+
- Python version: [e.g., 3.11.5]
|
|
23
|
+
- supynote-cli version: [e.g., 1.0.0]
|
|
24
|
+
- Supernote Device: [e.g., A5X, A6X, Nomad]
|
|
25
|
+
- Installation method: [pip, uv, from source]
|
|
26
|
+
|
|
27
|
+
## Logs/Error Messages
|
|
28
|
+
```
|
|
29
|
+
Paste error messages or relevant logs here
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Additional Context
|
|
33
|
+
Add any other context about the problem here. Screenshots can be helpful for UI-related issues.
|
|
34
|
+
|
|
35
|
+
## Possible Solution (Optional)
|
|
36
|
+
If you have ideas on how to fix this, please share them here.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest a new feature or enhancement
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Feature Description
|
|
10
|
+
A clear and concise description of the feature you'd like to see.
|
|
11
|
+
|
|
12
|
+
## Use Case
|
|
13
|
+
Explain how this feature would be used and why it's valuable. What problem does it solve?
|
|
14
|
+
|
|
15
|
+
## Proposed Solution
|
|
16
|
+
If you have ideas on how to implement this feature, share them here. Include:
|
|
17
|
+
- API/CLI interface design
|
|
18
|
+
- Expected behavior
|
|
19
|
+
- Configuration options (if applicable)
|
|
20
|
+
|
|
21
|
+
## Alternatives Considered
|
|
22
|
+
Describe any alternative solutions or features you've considered.
|
|
23
|
+
|
|
24
|
+
## Additional Context
|
|
25
|
+
Add any other context, screenshots, or examples about the feature request here.
|
|
26
|
+
|
|
27
|
+
## Would you be willing to contribute this feature?
|
|
28
|
+
- [ ] Yes, I'd like to implement this
|
|
29
|
+
- [ ] Yes, with guidance
|
|
30
|
+
- [ ] No, but I'd be happy to test it
|
|
31
|
+
- [ ] Just suggesting
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
Brief description of changes made in this PR.
|
|
3
|
+
|
|
4
|
+
Fixes #(issue number)
|
|
5
|
+
|
|
6
|
+
## Type of Change
|
|
7
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
8
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
9
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
10
|
+
- [ ] Documentation update
|
|
11
|
+
- [ ] Code refactoring
|
|
12
|
+
- [ ] Performance improvement
|
|
13
|
+
- [ ] Other (please describe)
|
|
14
|
+
|
|
15
|
+
## Testing
|
|
16
|
+
- [ ] Tests added/updated for new functionality
|
|
17
|
+
- [ ] All tests pass locally (`pytest`)
|
|
18
|
+
- [ ] Manually tested the changes
|
|
19
|
+
- [ ] Tested on multiple Python versions (if applicable)
|
|
20
|
+
- [ ] Tested with actual Supernote device (if applicable)
|
|
21
|
+
|
|
22
|
+
## Documentation
|
|
23
|
+
- [ ] Code documentation (docstrings) added/updated
|
|
24
|
+
- [ ] README updated (if needed)
|
|
25
|
+
- [ ] CHANGELOG.md updated
|
|
26
|
+
- [ ] Examples added/updated (if applicable)
|
|
27
|
+
|
|
28
|
+
## Checklist
|
|
29
|
+
- [ ] Code follows project style guidelines (PEP 8)
|
|
30
|
+
- [ ] Self-reviewed my own code
|
|
31
|
+
- [ ] Commented code in hard-to-understand areas
|
|
32
|
+
- [ ] No new warnings introduced
|
|
33
|
+
- [ ] Commit messages are clear and descriptive
|
|
34
|
+
- [ ] No personal data or credentials in code
|
|
35
|
+
|
|
36
|
+
## Screenshots (if applicable)
|
|
37
|
+
Add screenshots or terminal output to help explain your changes.
|
|
38
|
+
|
|
39
|
+
## Additional Notes
|
|
40
|
+
Any additional information that reviewers should know about this PR.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, macos-latest]
|
|
15
|
+
python-version: ['3.9', '3.10', '3.11', '3.12']
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
run: pip install uv
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
uv sync
|
|
31
|
+
pip install -e .
|
|
32
|
+
|
|
33
|
+
- name: Run tests
|
|
34
|
+
run: pytest tests/ -v --tb=short
|
|
35
|
+
|
|
36
|
+
- name: Check code formatting (Python 3.11 only)
|
|
37
|
+
if: matrix.python-version == '3.11'
|
|
38
|
+
run: |
|
|
39
|
+
pip install black
|
|
40
|
+
black --check supynote/ || echo "Code formatting check skipped"
|
|
41
|
+
|
|
42
|
+
lint:
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
- name: Set up Python
|
|
48
|
+
uses: actions/setup-python@v5
|
|
49
|
+
with:
|
|
50
|
+
python-version: '3.11'
|
|
51
|
+
|
|
52
|
+
- name: Install linting tools
|
|
53
|
+
run: |
|
|
54
|
+
pip install flake8
|
|
55
|
+
|
|
56
|
+
- name: Lint with flake8
|
|
57
|
+
run: |
|
|
58
|
+
# Stop the build if there are Python syntax errors or undefined names
|
|
59
|
+
flake8 supynote/ --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
60
|
+
# Exit-zero treats all errors as warnings
|
|
61
|
+
flake8 supynote/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
id-token: write # Required for trusted publishing to PyPI
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout code
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: '3.11'
|
|
22
|
+
|
|
23
|
+
- name: Install uv
|
|
24
|
+
uses: astral-sh/setup-uv@v4
|
|
25
|
+
|
|
26
|
+
- name: Build package
|
|
27
|
+
run: uv build
|
|
28
|
+
|
|
29
|
+
- name: Publish to PyPI
|
|
30
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
31
|
+
with:
|
|
32
|
+
verbose: true
|
|
@@ -0,0 +1,187 @@
|
|
|
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
|
+
# poetry
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
+
#poetry.lock
|
|
103
|
+
|
|
104
|
+
# pdm
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
+
#pdm.lock
|
|
107
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
+
# in version control.
|
|
109
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
+
.pdm.toml
|
|
111
|
+
|
|
112
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
+
__pypackages__/
|
|
114
|
+
|
|
115
|
+
# Celery stuff
|
|
116
|
+
celerybeat-schedule
|
|
117
|
+
celerybeat.pid
|
|
118
|
+
|
|
119
|
+
# SageMath parsed files
|
|
120
|
+
*.sage.py
|
|
121
|
+
|
|
122
|
+
# Environments
|
|
123
|
+
.env
|
|
124
|
+
.venv
|
|
125
|
+
env/
|
|
126
|
+
venv/
|
|
127
|
+
ENV/
|
|
128
|
+
env.bak/
|
|
129
|
+
venv.bak/
|
|
130
|
+
|
|
131
|
+
# Personal configuration
|
|
132
|
+
.claude/settings.local.json
|
|
133
|
+
.claude/*.local.json
|
|
134
|
+
|
|
135
|
+
# Spyder project settings
|
|
136
|
+
.spyderproject
|
|
137
|
+
.spyproject
|
|
138
|
+
|
|
139
|
+
# Rope project settings
|
|
140
|
+
.ropeproject
|
|
141
|
+
|
|
142
|
+
# mkdocs documentation
|
|
143
|
+
/site
|
|
144
|
+
|
|
145
|
+
# mypy
|
|
146
|
+
.mypy_cache/
|
|
147
|
+
.dmypy.json
|
|
148
|
+
dmypy.json
|
|
149
|
+
|
|
150
|
+
# Pyre type checker
|
|
151
|
+
.pyre/
|
|
152
|
+
|
|
153
|
+
# pytype static type analyzer
|
|
154
|
+
.pytype/
|
|
155
|
+
|
|
156
|
+
# Cython debug symbols
|
|
157
|
+
cython_debug/
|
|
158
|
+
|
|
159
|
+
# PyCharm
|
|
160
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
161
|
+
# be added to the global gitignore or merged into this project gitignore. For a PyCharm
|
|
162
|
+
# project, please select 'PyCharm Community' from the 'Select gitignore template' option.
|
|
163
|
+
# See https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
164
|
+
.idea/
|
|
165
|
+
|
|
166
|
+
# VS Code
|
|
167
|
+
.vscode/
|
|
168
|
+
|
|
169
|
+
# macOS
|
|
170
|
+
.DS_Store
|
|
171
|
+
.AppleDouble
|
|
172
|
+
.LSOverride
|
|
173
|
+
|
|
174
|
+
# Windows
|
|
175
|
+
Thumbs.db
|
|
176
|
+
ehthumbs.db
|
|
177
|
+
Desktop.ini
|
|
178
|
+
|
|
179
|
+
data/
|
|
180
|
+
|
|
181
|
+
*.swp
|
|
182
|
+
*.plist
|
|
183
|
+
|
|
184
|
+
# Examples - local configurations
|
|
185
|
+
examples/automation/.env
|
|
186
|
+
examples/automation/*.plist
|
|
187
|
+
examples/**/*.swp
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2025-12-05
|
|
9
|
+
|
|
10
|
+
### Initial Release
|
|
11
|
+
|
|
12
|
+
This is the first public release of supynote-cli, a command-line tool for interacting with Supernote e-ink tablets over local network.
|
|
13
|
+
|
|
14
|
+
#### Features
|
|
15
|
+
- **Device Discovery**: Auto-discovery of Supernote devices on local network
|
|
16
|
+
- **File Management**: List and browse files on device
|
|
17
|
+
- **High-Performance Downloads**: Parallel async downloads with configurable workers (20-30x faster than sync)
|
|
18
|
+
- **PDF Conversion**: Convert .note files to high-quality vector PDFs using supernotelib
|
|
19
|
+
- **OCR Support**: Multiple OCR engines for handwritten text recognition
|
|
20
|
+
- Native text extraction (default, fast)
|
|
21
|
+
- TrOCR (Microsoft, handwriting-optimized)
|
|
22
|
+
- LLaVA (via Ollama, advanced)
|
|
23
|
+
- Gemini API integration
|
|
24
|
+
- **Date-Based Merging**: Automatically merge PDFs by date with markdown generation
|
|
25
|
+
- **Apple Silicon Support**: MPS acceleration for OCR on M1/M2/M3/M4 Macs
|
|
26
|
+
- **CLI Commands**: find, list, download, convert, ocr, merge, browse, info, validate
|
|
27
|
+
|
|
28
|
+
#### Architecture
|
|
29
|
+
- Domain-Driven Design (DDD) layered architecture
|
|
30
|
+
- Separation of concerns: domain, application, infrastructure, presentation layers
|
|
31
|
+
- Repository pattern for data access
|
|
32
|
+
- Use case driven design
|
|
33
|
+
- Type hints throughout codebase
|
|
34
|
+
|
|
35
|
+
#### Performance
|
|
36
|
+
- Async HTTP with connection pooling and keep-alive
|
|
37
|
+
- Configurable worker concurrency for downloads and conversions
|
|
38
|
+
- Streaming file I/O for memory efficiency with large files
|
|
39
|
+
- Parallel PDF conversion with ThreadPoolExecutor
|
|
40
|
+
- Smart file size checking to skip unnecessary downloads
|
|
41
|
+
|
|
42
|
+
#### Documentation
|
|
43
|
+
- Comprehensive README with installation, usage, and troubleshooting
|
|
44
|
+
- Example automation scripts for Alfred (macOS) and remote sync
|
|
45
|
+
- Contributing guidelines and Code of Conduct
|
|
46
|
+
- GitHub issue and PR templates
|
|
47
|
+
- CI/CD with GitHub Actions
|
|
48
|
+
|
|
49
|
+
#### Developer Experience
|
|
50
|
+
- Modern Python tooling with uv support
|
|
51
|
+
- Optional dependencies for OCR features
|
|
52
|
+
- Comprehensive test suite (unit and integration)
|
|
53
|
+
- Pre-commit hooks compatible
|
|
54
|
+
- Multiple Python version support (3.8-3.12)
|
|
55
|
+
|
|
56
|
+
### Security
|
|
57
|
+
- No hardcoded credentials or personal data
|
|
58
|
+
- Environment variable support for configuration
|
|
59
|
+
- Secure network communication over local network only
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Future Releases
|
|
64
|
+
|
|
65
|
+
See [GitHub Issues](https://github.com/r4tb/supynote-cli/issues) for planned features and improvements.
|
supynote-0.8.0/CLAUDE.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Development Commands
|
|
6
|
+
|
|
7
|
+
### Installation and Setup
|
|
8
|
+
```bash
|
|
9
|
+
# Install with uv (recommended)
|
|
10
|
+
uv sync
|
|
11
|
+
pip install -e .
|
|
12
|
+
|
|
13
|
+
# Or with pip
|
|
14
|
+
pip install -e .
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Testing the CLI
|
|
18
|
+
```bash
|
|
19
|
+
# Run the CLI directly
|
|
20
|
+
python -m supynote.cli find
|
|
21
|
+
supynote find
|
|
22
|
+
|
|
23
|
+
# Test specific commands
|
|
24
|
+
supynote list
|
|
25
|
+
supynote download Note
|
|
26
|
+
supynote download Note --async --workers 30 # High-performance async download
|
|
27
|
+
supynote download Note --convert-pdf --workers 20 --conversion-workers 8 # Parallel download + conversion
|
|
28
|
+
supynote convert Note/ --workers 8 # Parallel PDF conversion
|
|
29
|
+
supynote convert file.note
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Code Architecture
|
|
33
|
+
|
|
34
|
+
This is a Python CLI tool for interacting with Supernote e-ink tablet devices over the local network.
|
|
35
|
+
|
|
36
|
+
### Core Components
|
|
37
|
+
|
|
38
|
+
**CLI Entry Point (`cli.py:main`)**
|
|
39
|
+
- Main command parser using argparse with subcommands: find, list, download, convert, browse, info
|
|
40
|
+
- Handles global options: --ip, --port, --output
|
|
41
|
+
- Device discovery via `find_device()` before most operations
|
|
42
|
+
|
|
43
|
+
**Device Interface (`supernote.py:Supernote`)**
|
|
44
|
+
- Core class for device communication via HTTP requests
|
|
45
|
+
- Methods: `list_files()`, `download_file()`, `download_directory()`, `get_device_info()`
|
|
46
|
+
- **High-performance async methods**: `download_directory_async()` with connection pooling and semaphore-controlled concurrency
|
|
47
|
+
- Uses BeautifulSoup to parse device web interface HTML and extract JSON data
|
|
48
|
+
- Supports both multithreaded (sync) and async/await (high-performance) downloads
|
|
49
|
+
- Async version uses aiohttp with TCP connection pooling, keep-alive, and streaming file I/O
|
|
50
|
+
|
|
51
|
+
**Network Discovery (`device_finder.py`)**
|
|
52
|
+
- Scans local /24 network for devices listening on port 8089
|
|
53
|
+
- Uses concurrent socket connections for fast network scanning
|
|
54
|
+
- Function: `find_device()` returns IP address or None
|
|
55
|
+
|
|
56
|
+
**PDF Conversion (`converter.py:PDFConverter`)**
|
|
57
|
+
- Converts Supernote .note files to PDF using `supernotelib` dependency
|
|
58
|
+
- **Parallel processing**: `convert_directory()` with ThreadPoolExecutor for batch conversions
|
|
59
|
+
- Supports vector (high-quality) and raster formats
|
|
60
|
+
- Options for hyperlinks, recursive directory processing
|
|
61
|
+
- Methods: `convert_file()`, `convert_directory()`, `convert_files_batch()`
|
|
62
|
+
|
|
63
|
+
### Data Flow
|
|
64
|
+
|
|
65
|
+
1. **Device Discovery**: CLI → `find_device()` → network scan → IP address
|
|
66
|
+
2. **File Operations**: CLI → `Supernote(ip)` → HTTP requests → device web interface
|
|
67
|
+
3. **Downloads**: Device listing → parallel file downloads → local filesystem
|
|
68
|
+
4. **Conversion**: Local .note files → `supernotelib` → PDF output
|
|
69
|
+
|
|
70
|
+
### Key Dependencies
|
|
71
|
+
|
|
72
|
+
- `requests` + `beautifulsoup4`: Device HTTP communication and HTML parsing
|
|
73
|
+
- `aiohttp` + `aiofiles`: High-performance async HTTP with connection pooling (optional but recommended)
|
|
74
|
+
- `supernotelib>=0.6.0`: Proprietary .note file format conversion to PDF
|
|
75
|
+
- Built-in: `concurrent.futures`, `pathlib`, `argparse`, `asyncio`
|
|
76
|
+
|
|
77
|
+
### Performance Notes
|
|
78
|
+
|
|
79
|
+
- **Default async mode**: Downloads use async by default with 20 concurrent connections
|
|
80
|
+
- **Connection pooling**: Async version reuses HTTP connections for better performance
|
|
81
|
+
- **Memory efficient streaming**: Large files are streamed to disk rather than loaded into memory
|
|
82
|
+
- **Configurable concurrency**: Use `--workers N` to control concurrent download limit
|
|
83
|
+
|
|
84
|
+
### File Structure Patterns
|
|
85
|
+
|
|
86
|
+
- Downloads default to `./data/` directory
|
|
87
|
+
- Maintains remote directory structure in local downloads
|
|
88
|
+
- PDF conversion preserves relative paths when processing directories
|
|
89
|
+
- All paths use `pathlib.Path` for cross-platform compatibility
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
+
any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement via GitHub issues.
|
|
63
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
64
|
+
|
|
65
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
66
|
+
reporter of any incident.
|
|
67
|
+
|
|
68
|
+
## Enforcement Guidelines
|
|
69
|
+
|
|
70
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
71
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
72
|
+
|
|
73
|
+
### 1. Correction
|
|
74
|
+
|
|
75
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
76
|
+
unprofessional or unwelcome in the community.
|
|
77
|
+
|
|
78
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
79
|
+
clarity around the nature of the violation and an explanation of why the
|
|
80
|
+
behavior was inappropriate. A public apology may be requested.
|
|
81
|
+
|
|
82
|
+
### 2. Warning
|
|
83
|
+
|
|
84
|
+
**Community Impact**: A violation through a single incident or series of
|
|
85
|
+
actions.
|
|
86
|
+
|
|
87
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
88
|
+
interaction with the people involved, including unsolicited interaction with
|
|
89
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
90
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
91
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
|
92
|
+
ban.
|
|
93
|
+
|
|
94
|
+
### 3. Temporary Ban
|
|
95
|
+
|
|
96
|
+
**Community Impact**: A serious violation of community standards, including
|
|
97
|
+
sustained inappropriate behavior.
|
|
98
|
+
|
|
99
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
100
|
+
communication with the community for a specified period of time. No public or
|
|
101
|
+
private interaction with the people involved, including unsolicited interaction
|
|
102
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
103
|
+
Violating these terms may lead to a permanent ban.
|
|
104
|
+
|
|
105
|
+
### 4. Permanent Ban
|
|
106
|
+
|
|
107
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
108
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
109
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
110
|
+
|
|
111
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
112
|
+
community.
|
|
113
|
+
|
|
114
|
+
## Attribution
|
|
115
|
+
|
|
116
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
117
|
+
version 2.1, available at
|
|
118
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
119
|
+
|
|
120
|
+
Community Impact Guidelines were inspired by
|
|
121
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
122
|
+
|
|
123
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
124
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
125
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
126
|
+
|
|
127
|
+
[homepage]: https://www.contributor-covenant.org
|
|
128
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
129
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
130
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
131
|
+
[translations]: https://www.contributor-covenant.org/translations
|