apify 2.7.1b11__py3-none-any.whl → 2.7.1b12__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.
Potentially problematic release.
This version of apify might be problematic. Click here for more details.
- apify/_charging.py +19 -0
- {apify-2.7.1b11.dist-info → apify-2.7.1b12.dist-info}/METADATA +1 -1
- {apify-2.7.1b11.dist-info → apify-2.7.1b12.dist-info}/RECORD +5 -5
- {apify-2.7.1b11.dist-info → apify-2.7.1b12.dist-info}/WHEEL +0 -0
- {apify-2.7.1b11.dist-info → apify-2.7.1b12.dist-info}/licenses/LICENSE +0 -0
apify/_charging.py
CHANGED
|
@@ -64,6 +64,16 @@ class ChargingManager(Protocol):
|
|
|
64
64
|
This can be used for instance when your code needs to support multiple pricing models in transition periods.
|
|
65
65
|
"""
|
|
66
66
|
|
|
67
|
+
def get_charged_event_count(self, event_name: str) -> int:
|
|
68
|
+
"""Get the number of events with the given name that were charged so far.
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
event_name: Name of the inspected event.
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
def get_max_total_charge_usd(self) -> Decimal:
|
|
75
|
+
"""Get the configured maximum total charge for this Actor run."""
|
|
76
|
+
|
|
67
77
|
|
|
68
78
|
@docs_group('Charging')
|
|
69
79
|
@dataclass(frozen=True)
|
|
@@ -309,6 +319,15 @@ class ChargingManagerImplementation(ChargingManager):
|
|
|
309
319
|
},
|
|
310
320
|
)
|
|
311
321
|
|
|
322
|
+
@ensure_context
|
|
323
|
+
def get_charged_event_count(self, event_name: str) -> int:
|
|
324
|
+
item = self._charging_state.get(event_name)
|
|
325
|
+
return item.charge_count if item is not None else 0
|
|
326
|
+
|
|
327
|
+
@ensure_context
|
|
328
|
+
def get_max_total_charge_usd(self) -> Decimal:
|
|
329
|
+
return self._max_total_charge_usd
|
|
330
|
+
|
|
312
331
|
|
|
313
332
|
@dataclass
|
|
314
333
|
class ChargingStateItem:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
apify/__init__.py,sha256=HpgKg2FZWJuSPfDygzJ62psylhw4NN4tKFnoYUIhcd4,838
|
|
2
2
|
apify/_actor.py,sha256=kOEvs_3TxjZ1PlwLEnIEL5nAD12oKs0ULldYyI-9irw,52985
|
|
3
|
-
apify/_charging.py,sha256=
|
|
3
|
+
apify/_charging.py,sha256=KjZ2DnEMS0Tt8ibizmmt0RwBq8FOAsD1z-hKFgdazcY,13143
|
|
4
4
|
apify/_configuration.py,sha256=Ta-qPlKenLaI0IOlODg_A4ZwmPtnuS7OWLSJyexcqmA,13283
|
|
5
5
|
apify/_consts.py,sha256=CjhyEJ4Mi0lcIrzfqz8dN7nPJWGjCeBrrXQy1PZ6zRI,440
|
|
6
6
|
apify/_crypto.py,sha256=tqUs13QkemDtGzvU41pIA2HUEawpDlgzqbwKjm4I8kM,6852
|
|
@@ -46,7 +46,7 @@ apify/storage_clients/_file_system/_key_value_store_client.py,sha256=DHDv_e0kFwh
|
|
|
46
46
|
apify/storage_clients/_file_system/_storage_client.py,sha256=UwxuSvhbyQ7zR1db1hTmZ1h38yH7btHNp82X7e8MWWE,1290
|
|
47
47
|
apify/storages/__init__.py,sha256=-9tEYJVabVs_eRVhUehxN58GH0UG8OfuGjGwuDieP2M,122
|
|
48
48
|
apify/storages/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
apify-2.7.
|
|
50
|
-
apify-2.7.
|
|
51
|
-
apify-2.7.
|
|
52
|
-
apify-2.7.
|
|
49
|
+
apify-2.7.1b12.dist-info/METADATA,sha256=rFR4ftqtGq4L8Ga5k7nHbLYX4dSH9yd15egh1dhRoAw,22578
|
|
50
|
+
apify-2.7.1b12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
51
|
+
apify-2.7.1b12.dist-info/licenses/LICENSE,sha256=AsFjHssKjj4LGd2ZCqXn6FBzMqcWdjQre1byPPSypVw,11355
|
|
52
|
+
apify-2.7.1b12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|