apify 2.7.1b10__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.1b10.dist-info → apify-2.7.1b12.dist-info}/METADATA +17 -2
- {apify-2.7.1b10.dist-info → apify-2.7.1b12.dist-info}/RECORD +5 -5
- {apify-2.7.1b10.dist-info → apify-2.7.1b12.dist-info}/WHEEL +0 -0
- {apify-2.7.1b10.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
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apify
|
|
3
|
-
Version: 2.7.
|
|
3
|
+
Version: 2.7.1b12
|
|
4
4
|
Summary: Apify SDK for Python
|
|
5
5
|
Project-URL: Apify Homepage, https://apify.com
|
|
6
6
|
Project-URL: Changelog, https://docs.apify.com/sdk/python/docs/changelog
|
|
@@ -240,7 +240,22 @@ Provides-Extra: scrapy
|
|
|
240
240
|
Requires-Dist: scrapy>=2.11.0; extra == 'scrapy'
|
|
241
241
|
Description-Content-Type: text/markdown
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
<h1 align=center>Apify SDK for Python</h1>
|
|
244
|
+
|
|
245
|
+
<p align=center>
|
|
246
|
+
<a href="https://badge.fury.io/py/apify" rel="nofollow">
|
|
247
|
+
<img src="https://badge.fury.io/py/apify.svg" alt="PyPI version" style="max-width: 100%;">
|
|
248
|
+
</a>
|
|
249
|
+
<a href="https://pypi.org/project/apify/" rel="nofollow">
|
|
250
|
+
<img src="https://img.shields.io/pypi/dm/apify" alt="PyPI - Downloads" style="max-width: 100%;">
|
|
251
|
+
</a>
|
|
252
|
+
<a href="https://pypi.org/project/apify/" rel="nofollow">
|
|
253
|
+
<img src="https://img.shields.io/pypi/pyversions/apify" alt="PyPI - Python Version" style="max-width: 100%;">
|
|
254
|
+
</a>
|
|
255
|
+
<a href="https://discord.gg/jyEM2PRvMU" rel="nofollow">
|
|
256
|
+
<img src="https://img.shields.io/discord/801163717915574323?label=discord" alt="Chat on discord" style="max-width: 100%;">
|
|
257
|
+
</a>
|
|
258
|
+
</p>
|
|
244
259
|
|
|
245
260
|
The Apify SDK for Python is the official library to create [Apify Actors](https://docs.apify.com/platform/actors)
|
|
246
261
|
in Python. It provides useful features like Actor lifecycle management, local storage emulation, and Actor
|
|
@@ -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
|