ssb-pubmd 0.0.5__tar.gz → 0.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ssb-pubmd
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: SSB Pubmd
5
5
  License: MIT
6
6
  Author: Olav Landsverk
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ssb-pubmd"
3
- version = "0.0.5"
3
+ version = "0.0.6"
4
4
  description = "SSB Pubmd"
5
5
  authors = ["Olav Landsverk <stud-oll@ssb.no>"]
6
6
  license = "MIT"
@@ -48,7 +48,7 @@ def notebook_to_cms(
48
48
  underscores replaced with spaces, and words capitalized).
49
49
 
50
50
  Returns:
51
- str: The response from the CMS endpoint, string-formatted.
51
+ str: The body of the response from the CMS endpoint, string-formatted.
52
52
  """
53
53
  if notebook_folder:
54
54
  os.chdir(notebook_folder)
@@ -73,7 +73,13 @@ def notebook_to_cms(
73
73
  cell.source for cell in notebook.cells if cell.cell_type == "markdown"
74
74
  )
75
75
 
76
- request_data = {"id": _id, "displayName": display_name, "markdown": markdown}
76
+ request_data = {"_id": _id, "displayName": display_name, "markdown": markdown}
77
77
  response = requests.post(endpoint, data=request_data)
78
78
 
79
- return json.dumps(response, indent=4)
79
+ body = response.json()
80
+ node_id = body.get("_id")
81
+
82
+ with open(json_filename, "w") as file:
83
+ json.dump({"_id": node_id}, file)
84
+
85
+ return json.dumps(body, indent=4)
File without changes
File without changes