Лимит на суммарный размер файлов
Bases: BaseFileLimit, FrozenModel
Limits the total size of files handled by :ref:file-downloader or :ref:file-mover.
Calculates the sum of downloaded/moved files size (.stat().st_size),
and checks that this sum is less or equal to specified limit.
After limit is reached, no more files will be downloaded/moved.
Doesn't affect directories, paths without .stat() method or files with zero size.
.. versionadded:: 0.13.0
.. note::
`SI unit prefixes <https://en.wikipedia.org/wiki/Byte#Multiple-byte_units>`_
means that ``1KB`` == ``1 kilobyte`` == ``1000 bytes``.
If you need ``1024 bytes``, use ``1 KiB`` == ``1 kibibyte``.
Parameters
limit : int or str
Examples
Create filter which allows to download/move files with total size up to 1GiB, but not higher:
.. code:: python
from onetl.file.limit import MaxFilesCount
limit = TotalFilesSize("1GiB")
Source code in onetl/file/limit/total_files_size.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
is_reached
property
reset()
Source code in onetl/file/limit/total_files_size.py
72 73 74 | |
stops_at(path)
Source code in onetl/file/limit/total_files_size.py
76 77 78 79 80 81 82 83 84 85 86 87 88 | |