notionhelper 0.1.5__tar.gz → 0.1.6__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.
- {notionhelper-0.1.5 → notionhelper-0.1.6}/PKG-INFO +46 -1
- {notionhelper-0.1.5 → notionhelper-0.1.6}/README.md +45 -0
- {notionhelper-0.1.5 → notionhelper-0.1.6}/pyproject.toml +1 -1
- {notionhelper-0.1.5 → notionhelper-0.1.6}/uv.lock +1 -1
- {notionhelper-0.1.5 → notionhelper-0.1.6}/.gitignore +0 -0
- {notionhelper-0.1.5 → notionhelper-0.1.6}/.python-version +0 -0
- {notionhelper-0.1.5 → notionhelper-0.1.6}/images/helper_logo.png +0 -0
- {notionhelper-0.1.5 → notionhelper-0.1.6}/images/json_builder.png.png +0 -0
- {notionhelper-0.1.5 → notionhelper-0.1.6}/src/notionhelper/__init__.py +0 -0
- {notionhelper-0.1.5 → notionhelper-0.1.6}/src/notionhelper/helper.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: notionhelper
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Author-email: Jan du Plessis <drjanduplessis@icloud.com>
|
|
6
6
|
Requires-Python: >=3.12
|
|
@@ -140,3 +140,48 @@ file_upload_id = upload_response["id"]
|
|
|
140
140
|
page_id = "your_page_id"
|
|
141
141
|
attach_response = helper.attach_file_to_page(page_id, file_upload_id)
|
|
142
142
|
print(f"Successfully uploaded and attached file: {attach_response}")
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Simplified File Operations
|
|
146
|
+
|
|
147
|
+
NotionHelper provides convenient one-step methods that combine file upload and attachment operations:
|
|
148
|
+
|
|
149
|
+
#### one_step_image_embed()
|
|
150
|
+
Uploads an image and embeds it in a Notion page in a single call, combining what would normally require:
|
|
151
|
+
1. Uploading the file
|
|
152
|
+
2. Embedding it in the page
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
page_id = "your_page_id"
|
|
156
|
+
image_path = "path/to/image.png"
|
|
157
|
+
response = helper.one_step_image_embed(page_id, image_path)
|
|
158
|
+
print(f"Successfully embedded image: {response}")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### one_step_file_to_page()
|
|
162
|
+
Uploads a file and attaches it to a Notion page in one step, combining:
|
|
163
|
+
1. Uploading the file
|
|
164
|
+
2. Attaching it to the page
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
page_id = "your_page_id"
|
|
168
|
+
file_path = "path/to/document.pdf"
|
|
169
|
+
response = helper.one_step_file_to_page(page_id, file_path)
|
|
170
|
+
print(f"Successfully attached file: {response}")
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### one_step_file_to_page_property()
|
|
174
|
+
Uploads a file and attaches it to a specific Files & Media property on a page, combining:
|
|
175
|
+
1. Uploading the file
|
|
176
|
+
2. Attaching it to the page property
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
page_id = "your_page_id"
|
|
180
|
+
property_name = "Files" # Name of your Files & Media property
|
|
181
|
+
file_path = "path/to/document.pdf"
|
|
182
|
+
file_name = "Custom Display Name.pdf" # Optional display name
|
|
183
|
+
response = helper.one_step_file_to_page_property(page_id, property_name, file_path, file_name)
|
|
184
|
+
print(f"Successfully attached file to property: {response}")
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
These methods handle all the intermediate steps automatically, making file operations with Notion much simpler.
|
|
@@ -128,3 +128,48 @@ file_upload_id = upload_response["id"]
|
|
|
128
128
|
page_id = "your_page_id"
|
|
129
129
|
attach_response = helper.attach_file_to_page(page_id, file_upload_id)
|
|
130
130
|
print(f"Successfully uploaded and attached file: {attach_response}")
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Simplified File Operations
|
|
134
|
+
|
|
135
|
+
NotionHelper provides convenient one-step methods that combine file upload and attachment operations:
|
|
136
|
+
|
|
137
|
+
#### one_step_image_embed()
|
|
138
|
+
Uploads an image and embeds it in a Notion page in a single call, combining what would normally require:
|
|
139
|
+
1. Uploading the file
|
|
140
|
+
2. Embedding it in the page
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
page_id = "your_page_id"
|
|
144
|
+
image_path = "path/to/image.png"
|
|
145
|
+
response = helper.one_step_image_embed(page_id, image_path)
|
|
146
|
+
print(f"Successfully embedded image: {response}")
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### one_step_file_to_page()
|
|
150
|
+
Uploads a file and attaches it to a Notion page in one step, combining:
|
|
151
|
+
1. Uploading the file
|
|
152
|
+
2. Attaching it to the page
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
page_id = "your_page_id"
|
|
156
|
+
file_path = "path/to/document.pdf"
|
|
157
|
+
response = helper.one_step_file_to_page(page_id, file_path)
|
|
158
|
+
print(f"Successfully attached file: {response}")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### one_step_file_to_page_property()
|
|
162
|
+
Uploads a file and attaches it to a specific Files & Media property on a page, combining:
|
|
163
|
+
1. Uploading the file
|
|
164
|
+
2. Attaching it to the page property
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
page_id = "your_page_id"
|
|
168
|
+
property_name = "Files" # Name of your Files & Media property
|
|
169
|
+
file_path = "path/to/document.pdf"
|
|
170
|
+
file_name = "Custom Display Name.pdf" # Optional display name
|
|
171
|
+
response = helper.one_step_file_to_page_property(page_id, property_name, file_path, file_name)
|
|
172
|
+
print(f"Successfully attached file to property: {response}")
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
These methods handle all the intermediate steps automatically, making file operations with Notion much simpler.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|