cloudnoteslib 0.1.0__tar.gz → 0.1.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.
- cloudnoteslib-0.1.1/PKG-INFO +190 -0
- cloudnoteslib-0.1.1/README.md +171 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/__init__.py +1 -1
- cloudnoteslib-0.1.1/cloudnoteslib.egg-info/PKG-INFO +190 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/pyproject.toml +1 -1
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/setup.py +1 -1
- cloudnoteslib-0.1.0/PKG-INFO +0 -37
- cloudnoteslib-0.1.0/README.md +0 -18
- cloudnoteslib-0.1.0/cloudnoteslib.egg-info/PKG-INFO +0 -37
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/analyzers/__init__.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/analyzers/content_analyzer.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/analyzers/search.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/analyzers/statistics.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/config.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/exceptions.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/exporters/__init__.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/exporters/base.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/exporters/json_exporter.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/exporters/markdown_exporter.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/models/__init__.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/models/note.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/models/note_collection.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/models/tag.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/processors/__init__.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/processors/base.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/processors/markdown_processor.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/processors/plaintext_processor.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/processors/richtext_processor.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/security/__init__.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/security/encryptor.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib/security/sanitizer.py +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib.egg-info/SOURCES.txt +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib.egg-info/dependency_links.txt +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib.egg-info/requires.txt +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/cloudnoteslib.egg-info/top_level.txt +0 -0
- {cloudnoteslib-0.1.0 → cloudnoteslib-0.1.1}/setup.cfg +0 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cloudnoteslib
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A reusable Object-Oriented generic library for note processing, analysis, and security.
|
|
5
|
+
Home-page: https://github.com/Kavyavegunta04/Cloudnote
|
|
6
|
+
Author: Kavya
|
|
7
|
+
Author-email: Kavya <kavyavegunta27@gmail.com>
|
|
8
|
+
Project-URL: Homepage, https://github.com/Kavyavegunta04/Cloudnote
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
Requires-Dist: cryptography>=41.0.0
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: requires-python
|
|
19
|
+
|
|
20
|
+
# 📝 cloudnoteslib
|
|
21
|
+
|
|
22
|
+
[](https://badge.fury.io/py/cloudnoteslib)
|
|
23
|
+
[](https://www.python.org/downloads/)
|
|
24
|
+
[](https://opensource.org/licenses/MIT)
|
|
25
|
+
|
|
26
|
+
**A comprehensive, reusable Python OOP library designed for text note processing, content analysis, security, and formats exporting.**
|
|
27
|
+
|
|
28
|
+
`cloudnoteslib` provides a clean, object-oriented interface for extracting, sanitizing, analyzing, and structuring text notes securely across formats (Markdown, Plain Text, Rich Text). It strictly incorporates deep software engineering principles, serving as a standalone business logic processor suitable for both backend and script integration.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 🏗️ Architecture & OOP Principles
|
|
33
|
+
|
|
34
|
+
| OOP Pillar | Implementation | Class(es) |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| **Abstraction** | Abstract base class defines the processor contract | `NoteProcessor` (ABC) |
|
|
37
|
+
| **Inheritance** | Concrete processors extend the abstract base | `MarkdownProcessor`, `PlainTextProcessor`, `RichTextProcessor` |
|
|
38
|
+
| **Encapsulation** | Private attributes with validated property accessors | `Note`, `Tag`, `NoteCollection` |
|
|
39
|
+
| **Polymorphism** | Interchangeable format processors with identical interfaces | Swap `markdown` ↔ `richtext` without code changes |
|
|
40
|
+
|
|
41
|
+
### Design Patterns Used
|
|
42
|
+
|
|
43
|
+
- **Facade Pattern** — `CloudNotesClient` acts as the single point of entry
|
|
44
|
+
- **Factory Method** — `_create_processor()` instantiates the correct text parser
|
|
45
|
+
- **Strategy Pattern** — `SearchEngine` uses interchangeable search rules (Exact, Fuzzy, Regex)
|
|
46
|
+
- **Template Method** — Base `NoteProcessor` establishes the master cleaning algorithm framework
|
|
47
|
+
- **Singleton Pattern** — `NoteConfig` for global configuration load
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 📦 Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install cloudnoteslib
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 🚀 Quick Start
|
|
60
|
+
|
|
61
|
+
### Basic Usage — Create and Process a Note
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from cloudnoteslib import CloudNotesClient, Note
|
|
65
|
+
|
|
66
|
+
# Initialize the client supporting 'markdown' format parsing
|
|
67
|
+
client = CloudNotesClient(processor_type="markdown")
|
|
68
|
+
|
|
69
|
+
# Initialize a Note (models use strict Property Encapsulation)
|
|
70
|
+
my_note = Note(
|
|
71
|
+
title="Project Ideas",
|
|
72
|
+
content="# Main Goals\\n\\nWe need to deploy to **AWS** and use PostgreSQL.",
|
|
73
|
+
tags=["work", "cloud"]
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# Process note content (sanitizes and parses formatting depending on the Processor)
|
|
77
|
+
processed = client.process_note(my_note)
|
|
78
|
+
|
|
79
|
+
print(f"Title: {processed.title}")
|
|
80
|
+
print(f"Word Count: {processed.word_count}")
|
|
81
|
+
print(f"Clean Content Snippet: {processed.content[:30]}")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Content Analytics
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
# Extract analytical insights directly from note content
|
|
88
|
+
analytics = client.analyze_content(my_note)
|
|
89
|
+
|
|
90
|
+
print(f"Vocabulary Richness: {analytics['vocabulary_richness']}")
|
|
91
|
+
print(f"Reading Time (mins): {analytics['reading_time']}")
|
|
92
|
+
print(f"Paragraph Count: {analytics['paragraph_count']}")
|
|
93
|
+
print(f"Top Used Words: {analytics['top_words']}")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Search Using Strategies
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from cloudnoteslib import NoteCollection
|
|
100
|
+
|
|
101
|
+
collection = NoteCollection([my_note, Note("Meeting", "Met with team about the project.")])
|
|
102
|
+
|
|
103
|
+
# Default Exact Match Strategy
|
|
104
|
+
exact_results = client.search_notes(collection, query="project")
|
|
105
|
+
|
|
106
|
+
# Swap to Fuzzy or Regex strategy dynamically!
|
|
107
|
+
fuzzy_results = client.search_notes(collection, query="prject", strategy="fuzzy")
|
|
108
|
+
regex_results = client.search_notes(collection, query="^Proj", strategy="regex")
|
|
109
|
+
|
|
110
|
+
print(f"Fuzzy Found: {len(fuzzy_results)} note(s)")
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Enterprise Security (AES Encrypt & HTML Sanitize)
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
# Encrypt highly sensitive note contents for DB storage
|
|
117
|
+
password = "my_secure_user_pass_123"
|
|
118
|
+
cipher_text = client.encrypt_content("My Secret Credit Card Pin: 1234", password)
|
|
119
|
+
|
|
120
|
+
# Decrypt
|
|
121
|
+
plain_text = client.decrypt_content(cipher_text, password)
|
|
122
|
+
|
|
123
|
+
# Note: Client auto-sanitizes against Cross-Site Scripting (XSS) on process_note()
|
|
124
|
+
malicious_note = Note("Hack", "Hello <script>alert(1)</script> World")
|
|
125
|
+
safe_note = client.process_note(malicious_note)
|
|
126
|
+
print(safe_note.content) # Output removes malicious script tags
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Exporters
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
# Export an entire collection into a structured JSON string or Markdown file representation
|
|
133
|
+
json_string = client.export(collection, format="json")
|
|
134
|
+
md_string = client.export(collection, format="md")
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 📖 API Reference
|
|
140
|
+
|
|
141
|
+
### Core Classes
|
|
142
|
+
|
|
143
|
+
| Class | Module | Description |
|
|
144
|
+
|---|---|---|
|
|
145
|
+
| `CloudNotesClient` | `cloudnoteslib` | High-level Facade bridging all modules |
|
|
146
|
+
| `Note` | `cloudnoteslib.models` | Immutable base node holding title, content, properties |
|
|
147
|
+
| `NoteCollection` | `cloudnoteslib.models` | Iterable container holding multiple notes |
|
|
148
|
+
| `Tag` | `cloudnoteslib.models` | Categorization entity holding name and auto-color |
|
|
149
|
+
| `NoteConfig` | `cloudnoteslib.config` | Singleton Configuration manager |
|
|
150
|
+
|
|
151
|
+
### Processors
|
|
152
|
+
|
|
153
|
+
| Class | Module | Description |
|
|
154
|
+
|---|---|---|
|
|
155
|
+
| `NoteProcessor` | `cloudnoteslib.processors` | Abstract base class (ABC) |
|
|
156
|
+
| `MarkdownProcessor` | `cloudnoteslib.processors` | Markdown content sanitizer |
|
|
157
|
+
| `PlainTextProcessor` | `cloudnoteslib.processors` | Standard text normalization |
|
|
158
|
+
| `RichTextProcessor` | `cloudnoteslib.processors` | HTML formatting parser |
|
|
159
|
+
|
|
160
|
+
### Analyzers
|
|
161
|
+
|
|
162
|
+
| Class | Module | Description |
|
|
163
|
+
|---|---|---|
|
|
164
|
+
| `ContentAnalyzer` | `cloudnoteslib.analyzers` | Single-note Deep Analytics |
|
|
165
|
+
| `NoteStatistics` | `cloudnoteslib.analyzers` | Collection-wide summaries |
|
|
166
|
+
| `SearchEngine` | `cloudnoteslib.analyzers` | Multi-strategy search application |
|
|
167
|
+
|
|
168
|
+
### Security & Exporters
|
|
169
|
+
|
|
170
|
+
| Class | Module | Description |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| `NoteEncryptor` | `cloudnoteslib.security` | PBKDF2/Fernet AES Encryption wrapper |
|
|
173
|
+
| `ContentSanitizer` | `cloudnoteslib.security` | Sub-layer removing unsafe URL/script tags |
|
|
174
|
+
| `JSONExporter` | `cloudnoteslib.exporters` | Format out to JSON structures |
|
|
175
|
+
| `MarkdownExporter` | `cloudnoteslib.exporters` | Format out to Markdown file dumps |
|
|
176
|
+
|
|
177
|
+
### Exceptions
|
|
178
|
+
|
|
179
|
+
| Exception | Description |
|
|
180
|
+
|---|---|
|
|
181
|
+
| `CloudNotesLibError` | Base exception |
|
|
182
|
+
| `NoteValidationError` | Property length bounds exceeded |
|
|
183
|
+
| `ProcessorNotSupportedError` | Unknown syntax selection |
|
|
184
|
+
| `SecurityError` | Failed decryption/encryption |
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 📄 License
|
|
189
|
+
|
|
190
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# 📝 cloudnoteslib
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/cloudnoteslib)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
**A comprehensive, reusable Python OOP library designed for text note processing, content analysis, security, and formats exporting.**
|
|
8
|
+
|
|
9
|
+
`cloudnoteslib` provides a clean, object-oriented interface for extracting, sanitizing, analyzing, and structuring text notes securely across formats (Markdown, Plain Text, Rich Text). It strictly incorporates deep software engineering principles, serving as a standalone business logic processor suitable for both backend and script integration.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🏗️ Architecture & OOP Principles
|
|
14
|
+
|
|
15
|
+
| OOP Pillar | Implementation | Class(es) |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| **Abstraction** | Abstract base class defines the processor contract | `NoteProcessor` (ABC) |
|
|
18
|
+
| **Inheritance** | Concrete processors extend the abstract base | `MarkdownProcessor`, `PlainTextProcessor`, `RichTextProcessor` |
|
|
19
|
+
| **Encapsulation** | Private attributes with validated property accessors | `Note`, `Tag`, `NoteCollection` |
|
|
20
|
+
| **Polymorphism** | Interchangeable format processors with identical interfaces | Swap `markdown` ↔ `richtext` without code changes |
|
|
21
|
+
|
|
22
|
+
### Design Patterns Used
|
|
23
|
+
|
|
24
|
+
- **Facade Pattern** — `CloudNotesClient` acts as the single point of entry
|
|
25
|
+
- **Factory Method** — `_create_processor()` instantiates the correct text parser
|
|
26
|
+
- **Strategy Pattern** — `SearchEngine` uses interchangeable search rules (Exact, Fuzzy, Regex)
|
|
27
|
+
- **Template Method** — Base `NoteProcessor` establishes the master cleaning algorithm framework
|
|
28
|
+
- **Singleton Pattern** — `NoteConfig` for global configuration load
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 📦 Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install cloudnoteslib
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🚀 Quick Start
|
|
41
|
+
|
|
42
|
+
### Basic Usage — Create and Process a Note
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from cloudnoteslib import CloudNotesClient, Note
|
|
46
|
+
|
|
47
|
+
# Initialize the client supporting 'markdown' format parsing
|
|
48
|
+
client = CloudNotesClient(processor_type="markdown")
|
|
49
|
+
|
|
50
|
+
# Initialize a Note (models use strict Property Encapsulation)
|
|
51
|
+
my_note = Note(
|
|
52
|
+
title="Project Ideas",
|
|
53
|
+
content="# Main Goals\\n\\nWe need to deploy to **AWS** and use PostgreSQL.",
|
|
54
|
+
tags=["work", "cloud"]
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Process note content (sanitizes and parses formatting depending on the Processor)
|
|
58
|
+
processed = client.process_note(my_note)
|
|
59
|
+
|
|
60
|
+
print(f"Title: {processed.title}")
|
|
61
|
+
print(f"Word Count: {processed.word_count}")
|
|
62
|
+
print(f"Clean Content Snippet: {processed.content[:30]}")
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Content Analytics
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
# Extract analytical insights directly from note content
|
|
69
|
+
analytics = client.analyze_content(my_note)
|
|
70
|
+
|
|
71
|
+
print(f"Vocabulary Richness: {analytics['vocabulary_richness']}")
|
|
72
|
+
print(f"Reading Time (mins): {analytics['reading_time']}")
|
|
73
|
+
print(f"Paragraph Count: {analytics['paragraph_count']}")
|
|
74
|
+
print(f"Top Used Words: {analytics['top_words']}")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Search Using Strategies
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from cloudnoteslib import NoteCollection
|
|
81
|
+
|
|
82
|
+
collection = NoteCollection([my_note, Note("Meeting", "Met with team about the project.")])
|
|
83
|
+
|
|
84
|
+
# Default Exact Match Strategy
|
|
85
|
+
exact_results = client.search_notes(collection, query="project")
|
|
86
|
+
|
|
87
|
+
# Swap to Fuzzy or Regex strategy dynamically!
|
|
88
|
+
fuzzy_results = client.search_notes(collection, query="prject", strategy="fuzzy")
|
|
89
|
+
regex_results = client.search_notes(collection, query="^Proj", strategy="regex")
|
|
90
|
+
|
|
91
|
+
print(f"Fuzzy Found: {len(fuzzy_results)} note(s)")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Enterprise Security (AES Encrypt & HTML Sanitize)
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
# Encrypt highly sensitive note contents for DB storage
|
|
98
|
+
password = "my_secure_user_pass_123"
|
|
99
|
+
cipher_text = client.encrypt_content("My Secret Credit Card Pin: 1234", password)
|
|
100
|
+
|
|
101
|
+
# Decrypt
|
|
102
|
+
plain_text = client.decrypt_content(cipher_text, password)
|
|
103
|
+
|
|
104
|
+
# Note: Client auto-sanitizes against Cross-Site Scripting (XSS) on process_note()
|
|
105
|
+
malicious_note = Note("Hack", "Hello <script>alert(1)</script> World")
|
|
106
|
+
safe_note = client.process_note(malicious_note)
|
|
107
|
+
print(safe_note.content) # Output removes malicious script tags
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Exporters
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
# Export an entire collection into a structured JSON string or Markdown file representation
|
|
114
|
+
json_string = client.export(collection, format="json")
|
|
115
|
+
md_string = client.export(collection, format="md")
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 📖 API Reference
|
|
121
|
+
|
|
122
|
+
### Core Classes
|
|
123
|
+
|
|
124
|
+
| Class | Module | Description |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| `CloudNotesClient` | `cloudnoteslib` | High-level Facade bridging all modules |
|
|
127
|
+
| `Note` | `cloudnoteslib.models` | Immutable base node holding title, content, properties |
|
|
128
|
+
| `NoteCollection` | `cloudnoteslib.models` | Iterable container holding multiple notes |
|
|
129
|
+
| `Tag` | `cloudnoteslib.models` | Categorization entity holding name and auto-color |
|
|
130
|
+
| `NoteConfig` | `cloudnoteslib.config` | Singleton Configuration manager |
|
|
131
|
+
|
|
132
|
+
### Processors
|
|
133
|
+
|
|
134
|
+
| Class | Module | Description |
|
|
135
|
+
|---|---|---|
|
|
136
|
+
| `NoteProcessor` | `cloudnoteslib.processors` | Abstract base class (ABC) |
|
|
137
|
+
| `MarkdownProcessor` | `cloudnoteslib.processors` | Markdown content sanitizer |
|
|
138
|
+
| `PlainTextProcessor` | `cloudnoteslib.processors` | Standard text normalization |
|
|
139
|
+
| `RichTextProcessor` | `cloudnoteslib.processors` | HTML formatting parser |
|
|
140
|
+
|
|
141
|
+
### Analyzers
|
|
142
|
+
|
|
143
|
+
| Class | Module | Description |
|
|
144
|
+
|---|---|---|
|
|
145
|
+
| `ContentAnalyzer` | `cloudnoteslib.analyzers` | Single-note Deep Analytics |
|
|
146
|
+
| `NoteStatistics` | `cloudnoteslib.analyzers` | Collection-wide summaries |
|
|
147
|
+
| `SearchEngine` | `cloudnoteslib.analyzers` | Multi-strategy search application |
|
|
148
|
+
|
|
149
|
+
### Security & Exporters
|
|
150
|
+
|
|
151
|
+
| Class | Module | Description |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| `NoteEncryptor` | `cloudnoteslib.security` | PBKDF2/Fernet AES Encryption wrapper |
|
|
154
|
+
| `ContentSanitizer` | `cloudnoteslib.security` | Sub-layer removing unsafe URL/script tags |
|
|
155
|
+
| `JSONExporter` | `cloudnoteslib.exporters` | Format out to JSON structures |
|
|
156
|
+
| `MarkdownExporter` | `cloudnoteslib.exporters` | Format out to Markdown file dumps |
|
|
157
|
+
|
|
158
|
+
### Exceptions
|
|
159
|
+
|
|
160
|
+
| Exception | Description |
|
|
161
|
+
|---|---|
|
|
162
|
+
| `CloudNotesLibError` | Base exception |
|
|
163
|
+
| `NoteValidationError` | Property length bounds exceeded |
|
|
164
|
+
| `ProcessorNotSupportedError` | Unknown syntax selection |
|
|
165
|
+
| `SecurityError` | Failed decryption/encryption |
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 📄 License
|
|
170
|
+
|
|
171
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cloudnoteslib
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A reusable Object-Oriented generic library for note processing, analysis, and security.
|
|
5
|
+
Home-page: https://github.com/Kavyavegunta04/Cloudnote
|
|
6
|
+
Author: Kavya
|
|
7
|
+
Author-email: Kavya <kavyavegunta27@gmail.com>
|
|
8
|
+
Project-URL: Homepage, https://github.com/Kavyavegunta04/Cloudnote
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
Requires-Dist: cryptography>=41.0.0
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: requires-python
|
|
19
|
+
|
|
20
|
+
# 📝 cloudnoteslib
|
|
21
|
+
|
|
22
|
+
[](https://badge.fury.io/py/cloudnoteslib)
|
|
23
|
+
[](https://www.python.org/downloads/)
|
|
24
|
+
[](https://opensource.org/licenses/MIT)
|
|
25
|
+
|
|
26
|
+
**A comprehensive, reusable Python OOP library designed for text note processing, content analysis, security, and formats exporting.**
|
|
27
|
+
|
|
28
|
+
`cloudnoteslib` provides a clean, object-oriented interface for extracting, sanitizing, analyzing, and structuring text notes securely across formats (Markdown, Plain Text, Rich Text). It strictly incorporates deep software engineering principles, serving as a standalone business logic processor suitable for both backend and script integration.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 🏗️ Architecture & OOP Principles
|
|
33
|
+
|
|
34
|
+
| OOP Pillar | Implementation | Class(es) |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| **Abstraction** | Abstract base class defines the processor contract | `NoteProcessor` (ABC) |
|
|
37
|
+
| **Inheritance** | Concrete processors extend the abstract base | `MarkdownProcessor`, `PlainTextProcessor`, `RichTextProcessor` |
|
|
38
|
+
| **Encapsulation** | Private attributes with validated property accessors | `Note`, `Tag`, `NoteCollection` |
|
|
39
|
+
| **Polymorphism** | Interchangeable format processors with identical interfaces | Swap `markdown` ↔ `richtext` without code changes |
|
|
40
|
+
|
|
41
|
+
### Design Patterns Used
|
|
42
|
+
|
|
43
|
+
- **Facade Pattern** — `CloudNotesClient` acts as the single point of entry
|
|
44
|
+
- **Factory Method** — `_create_processor()` instantiates the correct text parser
|
|
45
|
+
- **Strategy Pattern** — `SearchEngine` uses interchangeable search rules (Exact, Fuzzy, Regex)
|
|
46
|
+
- **Template Method** — Base `NoteProcessor` establishes the master cleaning algorithm framework
|
|
47
|
+
- **Singleton Pattern** — `NoteConfig` for global configuration load
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 📦 Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install cloudnoteslib
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 🚀 Quick Start
|
|
60
|
+
|
|
61
|
+
### Basic Usage — Create and Process a Note
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from cloudnoteslib import CloudNotesClient, Note
|
|
65
|
+
|
|
66
|
+
# Initialize the client supporting 'markdown' format parsing
|
|
67
|
+
client = CloudNotesClient(processor_type="markdown")
|
|
68
|
+
|
|
69
|
+
# Initialize a Note (models use strict Property Encapsulation)
|
|
70
|
+
my_note = Note(
|
|
71
|
+
title="Project Ideas",
|
|
72
|
+
content="# Main Goals\\n\\nWe need to deploy to **AWS** and use PostgreSQL.",
|
|
73
|
+
tags=["work", "cloud"]
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# Process note content (sanitizes and parses formatting depending on the Processor)
|
|
77
|
+
processed = client.process_note(my_note)
|
|
78
|
+
|
|
79
|
+
print(f"Title: {processed.title}")
|
|
80
|
+
print(f"Word Count: {processed.word_count}")
|
|
81
|
+
print(f"Clean Content Snippet: {processed.content[:30]}")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Content Analytics
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
# Extract analytical insights directly from note content
|
|
88
|
+
analytics = client.analyze_content(my_note)
|
|
89
|
+
|
|
90
|
+
print(f"Vocabulary Richness: {analytics['vocabulary_richness']}")
|
|
91
|
+
print(f"Reading Time (mins): {analytics['reading_time']}")
|
|
92
|
+
print(f"Paragraph Count: {analytics['paragraph_count']}")
|
|
93
|
+
print(f"Top Used Words: {analytics['top_words']}")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Search Using Strategies
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from cloudnoteslib import NoteCollection
|
|
100
|
+
|
|
101
|
+
collection = NoteCollection([my_note, Note("Meeting", "Met with team about the project.")])
|
|
102
|
+
|
|
103
|
+
# Default Exact Match Strategy
|
|
104
|
+
exact_results = client.search_notes(collection, query="project")
|
|
105
|
+
|
|
106
|
+
# Swap to Fuzzy or Regex strategy dynamically!
|
|
107
|
+
fuzzy_results = client.search_notes(collection, query="prject", strategy="fuzzy")
|
|
108
|
+
regex_results = client.search_notes(collection, query="^Proj", strategy="regex")
|
|
109
|
+
|
|
110
|
+
print(f"Fuzzy Found: {len(fuzzy_results)} note(s)")
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Enterprise Security (AES Encrypt & HTML Sanitize)
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
# Encrypt highly sensitive note contents for DB storage
|
|
117
|
+
password = "my_secure_user_pass_123"
|
|
118
|
+
cipher_text = client.encrypt_content("My Secret Credit Card Pin: 1234", password)
|
|
119
|
+
|
|
120
|
+
# Decrypt
|
|
121
|
+
plain_text = client.decrypt_content(cipher_text, password)
|
|
122
|
+
|
|
123
|
+
# Note: Client auto-sanitizes against Cross-Site Scripting (XSS) on process_note()
|
|
124
|
+
malicious_note = Note("Hack", "Hello <script>alert(1)</script> World")
|
|
125
|
+
safe_note = client.process_note(malicious_note)
|
|
126
|
+
print(safe_note.content) # Output removes malicious script tags
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Exporters
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
# Export an entire collection into a structured JSON string or Markdown file representation
|
|
133
|
+
json_string = client.export(collection, format="json")
|
|
134
|
+
md_string = client.export(collection, format="md")
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 📖 API Reference
|
|
140
|
+
|
|
141
|
+
### Core Classes
|
|
142
|
+
|
|
143
|
+
| Class | Module | Description |
|
|
144
|
+
|---|---|---|
|
|
145
|
+
| `CloudNotesClient` | `cloudnoteslib` | High-level Facade bridging all modules |
|
|
146
|
+
| `Note` | `cloudnoteslib.models` | Immutable base node holding title, content, properties |
|
|
147
|
+
| `NoteCollection` | `cloudnoteslib.models` | Iterable container holding multiple notes |
|
|
148
|
+
| `Tag` | `cloudnoteslib.models` | Categorization entity holding name and auto-color |
|
|
149
|
+
| `NoteConfig` | `cloudnoteslib.config` | Singleton Configuration manager |
|
|
150
|
+
|
|
151
|
+
### Processors
|
|
152
|
+
|
|
153
|
+
| Class | Module | Description |
|
|
154
|
+
|---|---|---|
|
|
155
|
+
| `NoteProcessor` | `cloudnoteslib.processors` | Abstract base class (ABC) |
|
|
156
|
+
| `MarkdownProcessor` | `cloudnoteslib.processors` | Markdown content sanitizer |
|
|
157
|
+
| `PlainTextProcessor` | `cloudnoteslib.processors` | Standard text normalization |
|
|
158
|
+
| `RichTextProcessor` | `cloudnoteslib.processors` | HTML formatting parser |
|
|
159
|
+
|
|
160
|
+
### Analyzers
|
|
161
|
+
|
|
162
|
+
| Class | Module | Description |
|
|
163
|
+
|---|---|---|
|
|
164
|
+
| `ContentAnalyzer` | `cloudnoteslib.analyzers` | Single-note Deep Analytics |
|
|
165
|
+
| `NoteStatistics` | `cloudnoteslib.analyzers` | Collection-wide summaries |
|
|
166
|
+
| `SearchEngine` | `cloudnoteslib.analyzers` | Multi-strategy search application |
|
|
167
|
+
|
|
168
|
+
### Security & Exporters
|
|
169
|
+
|
|
170
|
+
| Class | Module | Description |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| `NoteEncryptor` | `cloudnoteslib.security` | PBKDF2/Fernet AES Encryption wrapper |
|
|
173
|
+
| `ContentSanitizer` | `cloudnoteslib.security` | Sub-layer removing unsafe URL/script tags |
|
|
174
|
+
| `JSONExporter` | `cloudnoteslib.exporters` | Format out to JSON structures |
|
|
175
|
+
| `MarkdownExporter` | `cloudnoteslib.exporters` | Format out to Markdown file dumps |
|
|
176
|
+
|
|
177
|
+
### Exceptions
|
|
178
|
+
|
|
179
|
+
| Exception | Description |
|
|
180
|
+
|---|---|
|
|
181
|
+
| `CloudNotesLibError` | Base exception |
|
|
182
|
+
| `NoteValidationError` | Property length bounds exceeded |
|
|
183
|
+
| `ProcessorNotSupportedError` | Unknown syntax selection |
|
|
184
|
+
| `SecurityError` | Failed decryption/encryption |
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 📄 License
|
|
189
|
+
|
|
190
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="cloudnoteslib",
|
|
8
|
-
version="0.1.
|
|
8
|
+
version="0.1.1",
|
|
9
9
|
author="Kavya",
|
|
10
10
|
author_email="kavyavegunta27@gmail.com",
|
|
11
11
|
description="A reusable Object-Oriented library for note processing, analysis, and security.",
|
cloudnoteslib-0.1.0/PKG-INFO
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: cloudnoteslib
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: A reusable Object-Oriented generic library for note processing, analysis, and security.
|
|
5
|
-
Home-page: https://github.com/Kavyavegunta04/Cloudnote
|
|
6
|
-
Author: Kavya
|
|
7
|
-
Author-email: Kavya <kavyavegunta27@gmail.com>
|
|
8
|
-
Project-URL: Homepage, https://github.com/Kavyavegunta04/Cloudnote
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Requires-Python: >=3.9
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
Requires-Dist: cryptography>=41.0.0
|
|
16
|
-
Dynamic: author
|
|
17
|
-
Dynamic: home-page
|
|
18
|
-
Dynamic: requires-python
|
|
19
|
-
|
|
20
|
-
# cloudnoteslib
|
|
21
|
-
|
|
22
|
-
A comprehensive, reusable Python Object-Oriented Programming (OOP) library designed for text note processing, content analysis, security, and exports.
|
|
23
|
-
|
|
24
|
-
## Features & OOP Principles
|
|
25
|
-
- **Encapsulation:** Strongly typed `Note` and `Tag` models with data validation via `@property`.
|
|
26
|
-
- **Abstraction:** Abstract `NoteProcessor` base class guaranteeing unified interfaces.
|
|
27
|
-
- **Inheritance & Polymorphism:** `MarkdownProcessor`, `PlainTextProcessor`, and `RichTextProcessor` implementations sharing the same contract.
|
|
28
|
-
- **Design Patterns:**
|
|
29
|
-
- **Facade Pattern:** `CloudNotesClient` acts as the single point of entry.
|
|
30
|
-
- **Strategy Pattern:** Interchangeable search algorithms (`search.py`).
|
|
31
|
-
- **Template Method Pattern:** Processors share generic steps while overriding specific details.
|
|
32
|
-
- **Singleton Pattern:** Global configuration management.
|
|
33
|
-
|
|
34
|
-
## Installation
|
|
35
|
-
```bash
|
|
36
|
-
pip install cloudnoteslib
|
|
37
|
-
```
|
cloudnoteslib-0.1.0/README.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# cloudnoteslib
|
|
2
|
-
|
|
3
|
-
A comprehensive, reusable Python Object-Oriented Programming (OOP) library designed for text note processing, content analysis, security, and exports.
|
|
4
|
-
|
|
5
|
-
## Features & OOP Principles
|
|
6
|
-
- **Encapsulation:** Strongly typed `Note` and `Tag` models with data validation via `@property`.
|
|
7
|
-
- **Abstraction:** Abstract `NoteProcessor` base class guaranteeing unified interfaces.
|
|
8
|
-
- **Inheritance & Polymorphism:** `MarkdownProcessor`, `PlainTextProcessor`, and `RichTextProcessor` implementations sharing the same contract.
|
|
9
|
-
- **Design Patterns:**
|
|
10
|
-
- **Facade Pattern:** `CloudNotesClient` acts as the single point of entry.
|
|
11
|
-
- **Strategy Pattern:** Interchangeable search algorithms (`search.py`).
|
|
12
|
-
- **Template Method Pattern:** Processors share generic steps while overriding specific details.
|
|
13
|
-
- **Singleton Pattern:** Global configuration management.
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
16
|
-
```bash
|
|
17
|
-
pip install cloudnoteslib
|
|
18
|
-
```
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: cloudnoteslib
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: A reusable Object-Oriented generic library for note processing, analysis, and security.
|
|
5
|
-
Home-page: https://github.com/Kavyavegunta04/Cloudnote
|
|
6
|
-
Author: Kavya
|
|
7
|
-
Author-email: Kavya <kavyavegunta27@gmail.com>
|
|
8
|
-
Project-URL: Homepage, https://github.com/Kavyavegunta04/Cloudnote
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Requires-Python: >=3.9
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
Requires-Dist: cryptography>=41.0.0
|
|
16
|
-
Dynamic: author
|
|
17
|
-
Dynamic: home-page
|
|
18
|
-
Dynamic: requires-python
|
|
19
|
-
|
|
20
|
-
# cloudnoteslib
|
|
21
|
-
|
|
22
|
-
A comprehensive, reusable Python Object-Oriented Programming (OOP) library designed for text note processing, content analysis, security, and exports.
|
|
23
|
-
|
|
24
|
-
## Features & OOP Principles
|
|
25
|
-
- **Encapsulation:** Strongly typed `Note` and `Tag` models with data validation via `@property`.
|
|
26
|
-
- **Abstraction:** Abstract `NoteProcessor` base class guaranteeing unified interfaces.
|
|
27
|
-
- **Inheritance & Polymorphism:** `MarkdownProcessor`, `PlainTextProcessor`, and `RichTextProcessor` implementations sharing the same contract.
|
|
28
|
-
- **Design Patterns:**
|
|
29
|
-
- **Facade Pattern:** `CloudNotesClient` acts as the single point of entry.
|
|
30
|
-
- **Strategy Pattern:** Interchangeable search algorithms (`search.py`).
|
|
31
|
-
- **Template Method Pattern:** Processors share generic steps while overriding specific details.
|
|
32
|
-
- **Singleton Pattern:** Global configuration management.
|
|
33
|
-
|
|
34
|
-
## Installation
|
|
35
|
-
```bash
|
|
36
|
-
pip install cloudnoteslib
|
|
37
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|