ssb-pubmd 0.0.9__py3-none-any.whl → 0.0.10__py3-none-any.whl

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.
@@ -7,15 +7,18 @@ from .notebook_syncer import Response
7
7
 
8
8
 
9
9
  class BrowserRequestContext:
10
- """Creates a logged in browser context from which to send requests."""
10
+ """This class is used to create a logged in browser context from which to send requests."""
11
11
 
12
12
  def __init__(self) -> None:
13
- """Initializes a browser context with a login url."""
13
+ """Initializes an empty browser context object."""
14
14
  self._storage_state_path: str = "browser_context.json"
15
15
  self._context: BrowserContext | None = None
16
16
 
17
17
  async def create_new(self, login_url: str) -> BrowserContext:
18
- """Creates a browser context by opening a logging page and waiting for it to be closed by user."""
18
+ """Creates a browser context by opening a login page and waiting for it to be closed by user.
19
+
20
+ This function also saves the browser context to a file for later use.
21
+ """
19
22
  playwright = await async_playwright().start()
20
23
  browser = await playwright.chromium.launch(headless=False)
21
24
 
@@ -30,7 +33,7 @@ class BrowserRequestContext:
30
33
  return self._context
31
34
 
32
35
  async def recreate_from_file(self) -> BrowserContext:
33
- """Restores a browser context from the storage state file."""
36
+ """Recreates a browser context object from a file."""
34
37
  playwright = await async_playwright().start()
35
38
  browser = await playwright.chromium.launch(headless=False)
36
39
 
@@ -46,7 +49,7 @@ class BrowserRequestContext:
46
49
  headers: dict[str, str] | None = None,
47
50
  data: dict[str, str] | None = None,
48
51
  ) -> Response:
49
- """Sends a request tp the specified url, optionally with headers and data, within the browser context."""
52
+ """Sends a request to the specified url, optionally with headers and data, within the browser context."""
50
53
  if self._context is None:
51
54
  raise ValueError("Browser context has not been created.")
52
55
 
@@ -20,7 +20,7 @@ class Response:
20
20
  class RequestContext(Protocol):
21
21
  """Interface for the context in which a request is sent.
22
22
 
23
- Implementing classes may handle authentication, session management, etc.
23
+ Implementing classes may handle authentication, sessions, etc.
24
24
  """
25
25
 
26
26
  async def send_request(
@@ -65,7 +65,7 @@ class BasicRequestContext:
65
65
 
66
66
 
67
67
  class NotebookSyncer:
68
- """Utility class that helps syncing a notebook to a CMS (Content Management System).
68
+ """This class syncs a notebook to a CMS (Content Management System).
69
69
 
70
70
  The CMS must have an endpoint that satisfies the following constraints:
71
71
 
@@ -127,7 +127,7 @@ class NotebookSyncer:
127
127
  json.dump({self.ID_KEY: content_id}, file)
128
128
 
129
129
  def _get_content_id(self) -> str:
130
- """Returns the content id from the data file if it exists, otherwise an empty string."""
130
+ """Fetches the content id from the data file if it exists, otherwise an empty string."""
131
131
  content_id = ""
132
132
 
133
133
  filename = self.data_path
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ssb-pubmd
3
- Version: 0.0.9
3
+ Version: 0.0.10
4
4
  Summary: SSB Pubmd
5
5
  License: MIT
6
6
  Author: Olav Landsverk
@@ -0,0 +1,10 @@
1
+ ssb_pubmd/__init__.py,sha256=bEVVJ-sm5MmH5bXnzzyek_nSAvutyB0WNpBy835lE2g,179
2
+ ssb_pubmd/__main__.py,sha256=8D0yedPhnV_2L7nj0s0KUKxNQqPxoussMHGDNM-vyjg,209
3
+ ssb_pubmd/browser_context.py,sha256=ihFYos4Vm-0Llgr5WlFRAITlE6CAY1D53baMF5rzxwI,2405
4
+ ssb_pubmd/notebook_syncer.py,sha256=cyfB7jsXUVIaohVt38x8TKxlllkk1txy5jVab8vclSc,6511
5
+ ssb_pubmd/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ ssb_pubmd-0.0.10.dist-info/LICENSE,sha256=tF5bnYv09fgH5ph9t1EpH1MGrVOGTQeswL4dzVeZ_ak,1073
7
+ ssb_pubmd-0.0.10.dist-info/METADATA,sha256=Ylp5hVFos3KaDjGpbJBgngtmB6lsLugntRTaRvIDDAo,4407
8
+ ssb_pubmd-0.0.10.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
9
+ ssb_pubmd-0.0.10.dist-info/entry_points.txt,sha256=o4oU99zbZNIBKGYWdgdEG6ev-62ZRWEJOe7EOjJaajk,53
10
+ ssb_pubmd-0.0.10.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- ssb_pubmd/__init__.py,sha256=bEVVJ-sm5MmH5bXnzzyek_nSAvutyB0WNpBy835lE2g,179
2
- ssb_pubmd/__main__.py,sha256=8D0yedPhnV_2L7nj0s0KUKxNQqPxoussMHGDNM-vyjg,209
3
- ssb_pubmd/browser_context.py,sha256=V4KyL9Ell2xlW5LnDFQNa0p16TDCnOEXduYtH1UW4p0,2309
4
- ssb_pubmd/notebook_syncer.py,sha256=w0SXHaT5Ubxzs1CfGHdbe6kW1vqHz7HgY90ZZK1Py0M,6537
5
- ssb_pubmd/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- ssb_pubmd-0.0.9.dist-info/LICENSE,sha256=tF5bnYv09fgH5ph9t1EpH1MGrVOGTQeswL4dzVeZ_ak,1073
7
- ssb_pubmd-0.0.9.dist-info/METADATA,sha256=ZIJBSX_aNAPyBjkKvdncKxl8BAox_QvYQY7nOJftjPI,4406
8
- ssb_pubmd-0.0.9.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
9
- ssb_pubmd-0.0.9.dist-info/entry_points.txt,sha256=o4oU99zbZNIBKGYWdgdEG6ev-62ZRWEJOe7EOjJaajk,53
10
- ssb_pubmd-0.0.9.dist-info/RECORD,,