MCPcopy Create free account
hub / github.com/apify/crawlee-python / __str__

Method __str__

src/crawlee/_utils/byte_size.py:60–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 return self.bytes / _BYTES_PER_TB
59
60 def __str__(self) -> str:
61 if self.bytes >= _BYTES_PER_TB:
62 return f'{self.to_tb():.2f} TB'
63 if self.bytes >= _BYTES_PER_GB:
64 return f'{self.to_gb():.2f} GB'
65 if self.bytes >= _BYTES_PER_MB:
66 return f'{self.to_mb():.2f} MB'
67 if self.bytes >= _BYTES_PER_KB:
68 return f'{self.to_kb():.2f} KB'
69 return f'{self.bytes} B'
70
71 def __eq__(self, other: object) -> bool:
72 if isinstance(other, ByteSize):

Callers

nothing calls this directly

Calls 4

to_tbMethod · 0.95
to_gbMethod · 0.95
to_mbMethod · 0.95
to_kbMethod · 0.95

Tested by

no test coverage detected