Skip to content

Commit fb5c0f5

Browse files
committed
Packaging of the project
1 parent 787b4e4 commit fb5c0f5

File tree

13 files changed

+916
-8
lines changed

13 files changed

+916
-8
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change log
22

3+
## v1.2.1
4+
5+
### Change:
6+
7+
- Migration of the source files to the notionput/ sub-folder
8+
9+
### Added:
10+
11+
- Subfolder ’notionput/’
12+
13+
314
## v1.2.0
415

516
### New Features

data.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"entries": [{
3+
"_id": "coinmarketcap:btc",
4+
"type": "CMC",
5+
"fields": {
6+
"min": "28670",
7+
"price": "30278",
8+
"max": "31000"
9+
},
10+
"body": {
11+
"type": "embed",
12+
"content": "https://coinmarketcap.com/fr/currencies/bitcoin/"
13+
}
14+
},
15+
{
16+
"_id": "coinmarketcap:etc",
17+
"type": "CMC",
18+
"fields": {
19+
"min": "3100",
20+
"price": "3200",
21+
"max": "3500"
22+
},
23+
"body": {
24+
"type": "embed",
25+
"content": "https://coinmarketcap.com/fr/currencies/ethereum/"
26+
}
27+
}
28+
]
29+
}

main.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import optparse
33
import json
44

5-
from console import print_error,print_status
5+
from notionput.console import print_error,print_status
66

7-
from children import Children
8-
from properties import Properties
9-
from page import Page
10-
from database import Database
11-
from parse import Parser
12-
from notion_api import GetToken
7+
from notionput.children import Children
8+
from notionput.properties import Properties
9+
from notionput.page import Page
10+
from notionput.database import Database
11+
from notionput.parse import Parser
12+
from notionput.notion_api import GetToken
1313

1414
#token = os.environ["NOTION_TOKEN_PUT_EXPERIMENT"]
1515

@@ -28,7 +28,7 @@ def main():
2828
PARSER.get_option(parser=parser)
2929

3030
datas = json_reader()
31-
31+
3232
page_ids = retrive_page_id(datas[0][1][1])
3333

3434
for index,(fields_key,data_extract)in enumerate(datas):

notionput/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NOTION_VERSION = "2022-02-22"

notionput/block.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from notionput.request_notion import Request
2+
3+
class Block:
4+
def __init__(self, integrations_token):
5+
"""
6+
init
7+
:param integrations_token: Notion Internal Integration Token
8+
"""
9+
self.url = 'https://api.notion.com/v1/blocks'
10+
self.result = {}
11+
self.request = Request(self.url, integrations_token=integrations_token)
12+
13+
def retrieve_blocks(self,page_id):
14+
15+
self.result = self.request.call_api_get(self.url + "/" + page_id + "/children")
16+
17+
def update_block(self,block_id,children):
18+
19+
self.result = self.request.call_api_patch(self.url + "/" + block_id, body=children[0])
20+

0 commit comments

Comments
 (0)