supernote 0.10.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.
Files changed (86) hide show
  1. supernote-0.10.0/LICENSE +201 -0
  2. supernote-0.10.0/PKG-INFO +196 -0
  3. supernote-0.10.0/README.md +161 -0
  4. supernote-0.10.0/pyproject.toml +90 -0
  5. supernote-0.10.0/setup.cfg +4 -0
  6. supernote-0.10.0/supernote/__init__.py +28 -0
  7. supernote-0.10.0/supernote/cli/__init__.py +1 -0
  8. supernote-0.10.0/supernote/cli/admin.py +177 -0
  9. supernote-0.10.0/supernote/cli/client.py +285 -0
  10. supernote-0.10.0/supernote/cli/main.py +40 -0
  11. supernote-0.10.0/supernote/cli/notebook.py +313 -0
  12. supernote-0.10.0/supernote/cli/server.py +42 -0
  13. supernote-0.10.0/supernote/client/__init__.py +15 -0
  14. supernote-0.10.0/supernote/client/admin.py +76 -0
  15. supernote-0.10.0/supernote/client/api_model.py +231 -0
  16. supernote-0.10.0/supernote/client/auth.py +79 -0
  17. supernote-0.10.0/supernote/client/client.py +357 -0
  18. supernote-0.10.0/supernote/client/cloud_client.py +72 -0
  19. supernote-0.10.0/supernote/client/device.py +309 -0
  20. supernote-0.10.0/supernote/client/exceptions.py +33 -0
  21. supernote-0.10.0/supernote/client/hashing.py +50 -0
  22. supernote-0.10.0/supernote/client/login_client.py +154 -0
  23. supernote-0.10.0/supernote/client/schedule.py +149 -0
  24. supernote-0.10.0/supernote/client/web.py +208 -0
  25. supernote-0.10.0/supernote/models/__init__.py +14 -0
  26. supernote-0.10.0/supernote/models/auth.py +380 -0
  27. supernote-0.10.0/supernote/models/base.py +256 -0
  28. supernote-0.10.0/supernote/models/equipment.py +276 -0
  29. supernote-0.10.0/supernote/models/file_common.py +94 -0
  30. supernote-0.10.0/supernote/models/file_device.py +505 -0
  31. supernote-0.10.0/supernote/models/file_web.py +602 -0
  32. supernote-0.10.0/supernote/models/schedule.py +663 -0
  33. supernote-0.10.0/supernote/models/summary.py +591 -0
  34. supernote-0.10.0/supernote/models/system.py +433 -0
  35. supernote-0.10.0/supernote/models/user.py +638 -0
  36. supernote-0.10.0/supernote/notebook/__init__.py +67 -0
  37. supernote-0.10.0/supernote/notebook/color.py +93 -0
  38. supernote-0.10.0/supernote/notebook/converter.py +542 -0
  39. supernote-0.10.0/supernote/notebook/decoder.py +398 -0
  40. supernote-0.10.0/supernote/notebook/exceptions.py +43 -0
  41. supernote-0.10.0/supernote/notebook/fileformat.py +453 -0
  42. supernote-0.10.0/supernote/notebook/manipulator.py +420 -0
  43. supernote-0.10.0/supernote/notebook/parser.py +737 -0
  44. supernote-0.10.0/supernote/notebook/utils.py +49 -0
  45. supernote-0.10.0/supernote/py.typed +0 -0
  46. supernote-0.10.0/supernote/server/__init__.py +12 -0
  47. supernote-0.10.0/supernote/server/app.py +270 -0
  48. supernote-0.10.0/supernote/server/config.py +147 -0
  49. supernote-0.10.0/supernote/server/constants.py +19 -0
  50. supernote-0.10.0/supernote/server/db/__init__.py +9 -0
  51. supernote-0.10.0/supernote/server/db/base.py +8 -0
  52. supernote-0.10.0/supernote/server/db/models/__init__.py +12 -0
  53. supernote-0.10.0/supernote/server/db/models/device.py +17 -0
  54. supernote-0.10.0/supernote/server/db/models/file.py +104 -0
  55. supernote-0.10.0/supernote/server/db/models/kv.py +17 -0
  56. supernote-0.10.0/supernote/server/db/models/login_record.py +22 -0
  57. supernote-0.10.0/supernote/server/db/models/schedule.py +83 -0
  58. supernote-0.10.0/supernote/server/db/models/user.py +30 -0
  59. supernote-0.10.0/supernote/server/db/session.py +88 -0
  60. supernote-0.10.0/supernote/server/exceptions.py +140 -0
  61. supernote-0.10.0/supernote/server/routes/admin.py +109 -0
  62. supernote-0.10.0/supernote/server/routes/auth.py +336 -0
  63. supernote-0.10.0/supernote/server/routes/decorators.py +13 -0
  64. supernote-0.10.0/supernote/server/routes/file_device.py +515 -0
  65. supernote-0.10.0/supernote/server/routes/file_web.py +597 -0
  66. supernote-0.10.0/supernote/server/routes/oss.py +275 -0
  67. supernote-0.10.0/supernote/server/routes/schedule.py +223 -0
  68. supernote-0.10.0/supernote/server/routes/system.py +57 -0
  69. supernote-0.10.0/supernote/server/services/__init__.py +15 -0
  70. supernote-0.10.0/supernote/server/services/blob.py +147 -0
  71. supernote-0.10.0/supernote/server/services/coordination.py +176 -0
  72. supernote-0.10.0/supernote/server/services/file.py +954 -0
  73. supernote-0.10.0/supernote/server/services/integrity.py +91 -0
  74. supernote-0.10.0/supernote/server/services/schedule.py +161 -0
  75. supernote-0.10.0/supernote/server/services/user.py +475 -0
  76. supernote-0.10.0/supernote/server/services/vfs.py +468 -0
  77. supernote-0.10.0/supernote/server/utils/hashing.py +13 -0
  78. supernote-0.10.0/supernote/server/utils/rate_limit.py +52 -0
  79. supernote-0.10.0/supernote/server/utils/unique_id.py +48 -0
  80. supernote-0.10.0/supernote/server/utils/url_signer.py +193 -0
  81. supernote-0.10.0/supernote.egg-info/PKG-INFO +196 -0
  82. supernote-0.10.0/supernote.egg-info/SOURCES.txt +84 -0
  83. supernote-0.10.0/supernote.egg-info/dependency_links.txt +1 -0
  84. supernote-0.10.0/supernote.egg-info/entry_points.txt +3 -0
  85. supernote-0.10.0/supernote.egg-info/requires.txt +26 -0
  86. supernote-0.10.0/supernote.egg-info/top_level.txt +1 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,196 @@
1
+ Metadata-Version: 2.4
2
+ Name: supernote
3
+ Version: 0.10.0
4
+ Summary: All-in-one toolkit for Supernote devices: parse notebooks, self-host services, access services
5
+ Author-email: jya <jya@wizmy.net>, Allen Porter <allen.porter@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Source, https://github.com/allenporter/supernote
8
+ Requires-Python: >=3.13
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: colour>=0.1.5
12
+ Requires-Dist: numpy>=1.19.0
13
+ Requires-Dist: Pillow>=7.2.0
14
+ Requires-Dist: potracer>=0.0.1
15
+ Requires-Dist: pypng>=0.0.20
16
+ Requires-Dist: reportlab>=3.6.1
17
+ Requires-Dist: svgwrite>=1.4
18
+ Provides-Extra: client
19
+ Requires-Dist: aiohttp; extra == "client"
20
+ Requires-Dist: requests; extra == "client"
21
+ Requires-Dist: tqdm; extra == "client"
22
+ Provides-Extra: server
23
+ Requires-Dist: aiohttp>=3.13.2; extra == "server"
24
+ Requires-Dist: mashumaro>=3.17; extra == "server"
25
+ Requires-Dist: pyyaml>=6.0; extra == "server"
26
+ Requires-Dist: PyJWT>=2.10.1; extra == "server"
27
+ Requires-Dist: SQLAlchemy[asyncio]>=2.0.0; extra == "server"
28
+ Requires-Dist: alembic>=1.13.0; extra == "server"
29
+ Requires-Dist: aiosqlite>=0.19.0; extra == "server"
30
+ Requires-Dist: aiofiles>=25.1.0; extra == "server"
31
+ Requires-Dist: aiohttp-remotes>=1.3.0; extra == "server"
32
+ Provides-Extra: all
33
+ Requires-Dist: supernote[client,server]; extra == "all"
34
+ Dynamic: license-file
35
+
36
+ # supernote
37
+
38
+ All-in-one toolkit for Supernote devices: parse notebooks, self host, and access services.
39
+
40
+ This content is shared between the [documentation](https://allenporter.github.io/supernote-lite/) and github repository at [github.com/allenporter/supernote-lite](https://github.com/allenporter/supernote-lite).
41
+
42
+ ## Features
43
+
44
+ - **Notebook Parsing**: Convert `.note` files to PDF, PNG, SVG, or text
45
+ - **Private Server**: Self-hosted Supernote Private Cloud implementation
46
+ - **Client**: Interact with Supernote (Private) Cloud API
47
+
48
+ ## Installation
49
+
50
+ ```bash
51
+
52
+ # Install specific components
53
+ pip install supernote # Notebook parsing only
54
+ pip install supernote[server] # + Private server
55
+ pip install supernote[client] # + Client
56
+
57
+ # Full installation (recommended for server users)
58
+ pip install supernote[all]
59
+ ```
60
+
61
+ ## Local Development Setup
62
+
63
+ To set up the project for development, please refer to the [Contributing Guide](docs/CONTRIBUTING.md).
64
+
65
+ ## Quick Start
66
+
67
+ ### Parse a Notebook
68
+
69
+ ```python
70
+ from supernote.notebook import parse_notebook
71
+
72
+ notebook = parse_notebook("mynote.note")
73
+ notebook.to_pdf("output.pdf")
74
+ ```
75
+
76
+ The notebook parser is a fork and slightly lighter dependency version of [supernote-tool](https://github.com/jya-dev/supernote-tool) that drops svg dependencies not found in some containers. Generally, you should probably prefer to use that original library unless there is a specific reason you're also having a similar dependency
77
+ limitation. All credit goes to the original authors of [supernote-tool](https://github.com/jya-dev/supernote-tool) for providing an amazing low level utility.
78
+
79
+
80
+ ### Server Setup & Bootstrap
81
+
82
+ 1. **Start the Server**:
83
+ ```bash
84
+ supernote serve
85
+ ```
86
+
87
+ 2. **Register the Admin**:
88
+ The first user registered becomes the system administrator.
89
+ ```bash
90
+ supernote admin user add email@example.com --url http://localhost:8080
91
+ ```
92
+
93
+ 3. **Login to CLI**:
94
+ ```bash
95
+ supernote cloud-login email@example.com --url http://localhost:8080
96
+ ```
97
+
98
+ See the [Bootstrap Guide](docs/bootstrap_guide.md) for detailed deployment and security instructions.
99
+
100
+ ### Run with Docker
101
+
102
+ ```bash
103
+ # Build image
104
+ docker build -t supernote .
105
+
106
+ # Run server
107
+ docker run -d -p 8080:8080 -v $(pwd)/storage:/storage supernote serve
108
+ ```
109
+
110
+ See [Server Documentation](https://github.com/allenporter/supernote-lite/blob/main/supernote/server/README.mdd) for details.
111
+
112
+
113
+ ### Access Supernote Services
114
+
115
+ ```python
116
+
117
+ from supernote.client import SupernoteClient
118
+
119
+ async with SupernoteClient.from_credentials(email, password) as client:
120
+ files = await client.list_files()
121
+ ```
122
+
123
+
124
+ ## CLI Usage
125
+
126
+ ```bash
127
+ # Notebook operations
128
+ supernote notebook convert input.note output.pdf
129
+ supernote notebook analyze input.note
130
+
131
+ # Server operations
132
+ supernote serve
133
+ supernote admin user list
134
+ supernote admin user add email@example.com
135
+
136
+ # Client operations
137
+ supernote cloud-login --url http://localhost:8080 email@example.com
138
+ supernote cloud-ls
139
+ ```
140
+
141
+ ## Contributing
142
+
143
+ We welcome contributions! Please see our [Contributing Guide](docs/CONTRIBUTING.md) for details on:
144
+ - Local development setup
145
+ - Project architecture
146
+ - Coding standards
147
+ - Running tests
148
+
149
+ ## Credits
150
+
151
+ The `supernote` library is a fork and slightly lighter dependency version of [supernote-tool](https://github.com/jya-dev/supernote-tool) that drops svg dependencies not found in some containers. Generally, you should probably prefer to use that library unless there is a specific reason you're also having a similar dependency limitation.
152
+
153
+ ## Acknowledgments
154
+
155
+ This project is in support of the amazing [Ratta Supernote](https://supernote.com/) product and community. This project aims to be a complementary, unofficial offering that is compatible with the [Private Cloud feature](https://support.supernote.com/Whats-New/setting-up-your-own-supernote-private-cloud-beta), helping to support their open ecosystem, helping to reduce load on their servers etc (e.g. for AI
156
+ powered personal assistant integrations that need to process notebooks, etc)
157
+
158
+ ### Comparison with Official Private Cloud
159
+
160
+ Ratta offers an [official Private Cloud solution](https://support.supernote.com/Whats-New/setting-up-your-own-supernote-private-cloud-beta) based on Docker. You
161
+ should generally prefer that solution, unless you are interested in lower level
162
+ integrations and are comfortable managing your own security, SSL, etc.
163
+
164
+ Here is how this project compares:
165
+
166
+ | Feature | Official Private Cloud | Supernote-Lite (This Project) |
167
+ |---------|------------------------|-------------------------------|
168
+ | **Type** | Official Product | Community Project |
169
+ | **Technology** | Docker Container (Java/Spring) | Python Package |
170
+ | **Source** | Closed Source | Open Source |
171
+ | **Focus** | Stability & End-Users | Hackability & Developers |
172
+ | **Requirements** | Docker Environment | Python 3.10+ |
173
+ | **Extensibility** | Low (Black Box) | High (Modular Codebase) |
174
+ | **Security/SSL** | Documented Guides Included | DIY (Bring Your Own Proxy) |
175
+
176
+ **Use the Official Private Cloud if:**
177
+ - You want a supported, "set-and-forget" solution.
178
+ - You prefer using Docker containers.
179
+
180
+ **Use Supernote-Lite if:**
181
+ - You want to understand how the protocol works.
182
+ - You want to run on low-power hardware without Docker overhead.
183
+ - You want to integrate Supernote sync into your own Python applications.
184
+ - You want to customize the server behavior.
185
+
186
+ ### Community Projects
187
+
188
+ - [github.com/jya-dev/supernote-tool](https://github.com/jya-dev/supernote-tool) - Unofficial python tool for Ratta Supernote for parsing notebook files, which this projects notebook module is based on.
189
+ - [github.com/philips/supernote-typescript](https://github.com/philips/supernote-typescript) - Supernote file-format support in typescript
190
+ - [github.com/julianprester/sncloud](https://github.com/julianprester/sncloud) - Supernote Cloud API for Python
191
+ - [github.com/fharper/awesome-supernote](https://github.com/fharper/awesome-supernote) - A curated list of Supernote resources
192
+ - [github.com/philips/supernote-obsidian-plugin](https://github.com/philips/supernote-obsidian-plugin) - Obsidian plugin for Supernote
193
+ - [github.com/jbchouinard/supernote-sync](https://github.com/jbchouinard/supernote-sync) - Tool to automatically backup files from the Supernote using local WiFi using the Supernote Browse & Access feature
194
+ - [github.com/theburningbush/snbackup](https://github.com/theburningbush/snbackup) - CLI tool for wireless Supernote backups using the Browse & Access feature
195
+ - [github.com/dsummersl/sn2md](https://github.com/dsummersl/sn2md) - Supernote to text/image converter (sn2md)
196
+ - [github.com/calebc42/eink-template-gen](https://github.com/calebc42/eink-template-gen) - Generates pixel-perfect page templates for e-ink devices.
@@ -0,0 +1,161 @@
1
+ # supernote
2
+
3
+ All-in-one toolkit for Supernote devices: parse notebooks, self host, and access services.
4
+
5
+ This content is shared between the [documentation](https://allenporter.github.io/supernote-lite/) and github repository at [github.com/allenporter/supernote-lite](https://github.com/allenporter/supernote-lite).
6
+
7
+ ## Features
8
+
9
+ - **Notebook Parsing**: Convert `.note` files to PDF, PNG, SVG, or text
10
+ - **Private Server**: Self-hosted Supernote Private Cloud implementation
11
+ - **Client**: Interact with Supernote (Private) Cloud API
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+
17
+ # Install specific components
18
+ pip install supernote # Notebook parsing only
19
+ pip install supernote[server] # + Private server
20
+ pip install supernote[client] # + Client
21
+
22
+ # Full installation (recommended for server users)
23
+ pip install supernote[all]
24
+ ```
25
+
26
+ ## Local Development Setup
27
+
28
+ To set up the project for development, please refer to the [Contributing Guide](docs/CONTRIBUTING.md).
29
+
30
+ ## Quick Start
31
+
32
+ ### Parse a Notebook
33
+
34
+ ```python
35
+ from supernote.notebook import parse_notebook
36
+
37
+ notebook = parse_notebook("mynote.note")
38
+ notebook.to_pdf("output.pdf")
39
+ ```
40
+
41
+ The notebook parser is a fork and slightly lighter dependency version of [supernote-tool](https://github.com/jya-dev/supernote-tool) that drops svg dependencies not found in some containers. Generally, you should probably prefer to use that original library unless there is a specific reason you're also having a similar dependency
42
+ limitation. All credit goes to the original authors of [supernote-tool](https://github.com/jya-dev/supernote-tool) for providing an amazing low level utility.
43
+
44
+
45
+ ### Server Setup & Bootstrap
46
+
47
+ 1. **Start the Server**:
48
+ ```bash
49
+ supernote serve
50
+ ```
51
+
52
+ 2. **Register the Admin**:
53
+ The first user registered becomes the system administrator.
54
+ ```bash
55
+ supernote admin user add email@example.com --url http://localhost:8080
56
+ ```
57
+
58
+ 3. **Login to CLI**:
59
+ ```bash
60
+ supernote cloud-login email@example.com --url http://localhost:8080
61
+ ```
62
+
63
+ See the [Bootstrap Guide](docs/bootstrap_guide.md) for detailed deployment and security instructions.
64
+
65
+ ### Run with Docker
66
+
67
+ ```bash
68
+ # Build image
69
+ docker build -t supernote .
70
+
71
+ # Run server
72
+ docker run -d -p 8080:8080 -v $(pwd)/storage:/storage supernote serve
73
+ ```
74
+
75
+ See [Server Documentation](https://github.com/allenporter/supernote-lite/blob/main/supernote/server/README.mdd) for details.
76
+
77
+
78
+ ### Access Supernote Services
79
+
80
+ ```python
81
+
82
+ from supernote.client import SupernoteClient
83
+
84
+ async with SupernoteClient.from_credentials(email, password) as client:
85
+ files = await client.list_files()
86
+ ```
87
+
88
+
89
+ ## CLI Usage
90
+
91
+ ```bash
92
+ # Notebook operations
93
+ supernote notebook convert input.note output.pdf
94
+ supernote notebook analyze input.note
95
+
96
+ # Server operations
97
+ supernote serve
98
+ supernote admin user list
99
+ supernote admin user add email@example.com
100
+
101
+ # Client operations
102
+ supernote cloud-login --url http://localhost:8080 email@example.com
103
+ supernote cloud-ls
104
+ ```
105
+
106
+ ## Contributing
107
+
108
+ We welcome contributions! Please see our [Contributing Guide](docs/CONTRIBUTING.md) for details on:
109
+ - Local development setup
110
+ - Project architecture
111
+ - Coding standards
112
+ - Running tests
113
+
114
+ ## Credits
115
+
116
+ The `supernote` library is a fork and slightly lighter dependency version of [supernote-tool](https://github.com/jya-dev/supernote-tool) that drops svg dependencies not found in some containers. Generally, you should probably prefer to use that library unless there is a specific reason you're also having a similar dependency limitation.
117
+
118
+ ## Acknowledgments
119
+
120
+ This project is in support of the amazing [Ratta Supernote](https://supernote.com/) product and community. This project aims to be a complementary, unofficial offering that is compatible with the [Private Cloud feature](https://support.supernote.com/Whats-New/setting-up-your-own-supernote-private-cloud-beta), helping to support their open ecosystem, helping to reduce load on their servers etc (e.g. for AI
121
+ powered personal assistant integrations that need to process notebooks, etc)
122
+
123
+ ### Comparison with Official Private Cloud
124
+
125
+ Ratta offers an [official Private Cloud solution](https://support.supernote.com/Whats-New/setting-up-your-own-supernote-private-cloud-beta) based on Docker. You
126
+ should generally prefer that solution, unless you are interested in lower level
127
+ integrations and are comfortable managing your own security, SSL, etc.
128
+
129
+ Here is how this project compares:
130
+
131
+ | Feature | Official Private Cloud | Supernote-Lite (This Project) |
132
+ |---------|------------------------|-------------------------------|
133
+ | **Type** | Official Product | Community Project |
134
+ | **Technology** | Docker Container (Java/Spring) | Python Package |
135
+ | **Source** | Closed Source | Open Source |
136
+ | **Focus** | Stability & End-Users | Hackability & Developers |
137
+ | **Requirements** | Docker Environment | Python 3.10+ |
138
+ | **Extensibility** | Low (Black Box) | High (Modular Codebase) |
139
+ | **Security/SSL** | Documented Guides Included | DIY (Bring Your Own Proxy) |
140
+
141
+ **Use the Official Private Cloud if:**
142
+ - You want a supported, "set-and-forget" solution.
143
+ - You prefer using Docker containers.
144
+
145
+ **Use Supernote-Lite if:**
146
+ - You want to understand how the protocol works.
147
+ - You want to run on low-power hardware without Docker overhead.
148
+ - You want to integrate Supernote sync into your own Python applications.
149
+ - You want to customize the server behavior.
150
+
151
+ ### Community Projects
152
+
153
+ - [github.com/jya-dev/supernote-tool](https://github.com/jya-dev/supernote-tool) - Unofficial python tool for Ratta Supernote for parsing notebook files, which this projects notebook module is based on.
154
+ - [github.com/philips/supernote-typescript](https://github.com/philips/supernote-typescript) - Supernote file-format support in typescript
155
+ - [github.com/julianprester/sncloud](https://github.com/julianprester/sncloud) - Supernote Cloud API for Python
156
+ - [github.com/fharper/awesome-supernote](https://github.com/fharper/awesome-supernote) - A curated list of Supernote resources
157
+ - [github.com/philips/supernote-obsidian-plugin](https://github.com/philips/supernote-obsidian-plugin) - Obsidian plugin for Supernote
158
+ - [github.com/jbchouinard/supernote-sync](https://github.com/jbchouinard/supernote-sync) - Tool to automatically backup files from the Supernote using local WiFi using the Supernote Browse & Access feature
159
+ - [github.com/theburningbush/snbackup](https://github.com/theburningbush/snbackup) - CLI tool for wireless Supernote backups using the Browse & Access feature
160
+ - [github.com/dsummersl/sn2md](https://github.com/dsummersl/sn2md) - Supernote to text/image converter (sn2md)
161
+ - [github.com/calebc42/eink-template-gen](https://github.com/calebc42/eink-template-gen) - Generates pixel-perfect page templates for e-ink devices.
@@ -0,0 +1,90 @@
1
+ [build-system]
2
+ build-backend = "setuptools.build_meta"
3
+ requires = ["setuptools>=77.0"]
4
+
5
+ [project]
6
+ name = "supernote"
7
+ version = "0.10.0"
8
+ license = "Apache-2.0"
9
+ license-files = ["LICENSE"]
10
+ description = "All-in-one toolkit for Supernote devices: parse notebooks, self-host services, access services"
11
+ readme = "README.md"
12
+ authors = [
13
+ { name = "jya", email = "jya@wizmy.net" },
14
+ { name = "Allen Porter", email = "allen.porter@gmail.com" }
15
+ ]
16
+ requires-python = ">=3.13"
17
+ classifiers = []
18
+ dependencies = [
19
+ # Core notebook dependencies (always installed)
20
+ "colour>=0.1.5",
21
+ "numpy>=1.19.0",
22
+ "Pillow>=7.2.0",
23
+ "potracer>=0.0.1",
24
+ "pypng>=0.0.20",
25
+ "reportlab>=3.6.1",
26
+ "svgwrite>=1.4",
27
+ ]
28
+
29
+ [project.optional-dependencies]
30
+ client = [
31
+ "aiohttp",
32
+ "requests",
33
+ "tqdm",
34
+ ]
35
+ server = [
36
+ "aiohttp>=3.13.2",
37
+ "mashumaro>=3.17",
38
+ "pyyaml>=6.0",
39
+ "PyJWT>=2.10.1",
40
+ "SQLAlchemy[asyncio]>=2.0.0",
41
+ "alembic>=1.13.0",
42
+ "aiosqlite>=0.19.0",
43
+ "aiofiles>=25.1.0",
44
+ "aiohttp-remotes>=1.3.0",
45
+ ]
46
+ all = ["supernote[client,server]"]
47
+
48
+ [project.urls]
49
+ Source = "https://github.com/allenporter/supernote"
50
+
51
+ [tool.setuptools.packages.find]
52
+ include = ["supernote*"]
53
+
54
+ [project.entry-points."console_scripts"]
55
+ supernote = "supernote.cli.main:main"
56
+ supernote-server = "supernote.cli.server:main"
57
+
58
+ [tool.mypy]
59
+ exclude = [
60
+ "venv/",
61
+ "data",
62
+ # TODO: Fix mypy errors and then remove this
63
+ "supernote/notebook/",
64
+ "supernote/cli/",
65
+ ]
66
+ platform = "linux"
67
+ show_error_codes = true
68
+ follow_imports = "silent"
69
+ local_partial_types = true
70
+ strict_equality = true
71
+ no_implicit_optional = true
72
+ warn_incomplete_stub = true
73
+ warn_redundant_casts = true
74
+ warn_unused_configs = true
75
+ warn_unused_ignores = true
76
+ disable_error_code = [
77
+ "import-untyped",
78
+ ]
79
+ extra_checks = false
80
+ check_untyped_defs = true
81
+ disallow_incomplete_defs = true
82
+ disallow_subclassing_any = true
83
+ disallow_untyped_calls = true
84
+ disallow_untyped_decorators = true
85
+ disallow_untyped_defs = true
86
+ warn_return_any = true
87
+ warn_unreachable = true
88
+
89
+ [tool.pytest.ini_options]
90
+ asyncio_mode = "auto"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,28 @@
1
+ """
2
+ .. include:: ../README.md
3
+ """
4
+
5
+ # Core notebook parsing (always available)
6
+ from . import notebook # noqa: F401
7
+
8
+ __all__ = [
9
+ "models",
10
+ ]
11
+
12
+ # Optional: Client library
13
+ try:
14
+ from . import client # noqa: F401
15
+
16
+ __all__.extend(["client"])
17
+ except ImportError:
18
+ pass
19
+
20
+ # Optional: Server
21
+ try:
22
+ from . import server # noqa: F401
23
+
24
+ __all__.extend(["server"])
25
+ except ImportError:
26
+ pass
27
+
28
+ __all__.extend(["notebook"])
@@ -0,0 +1 @@
1
+ """Supernote command line tool."""