pixel-sizes 0.1.0__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.
@@ -0,0 +1,29 @@
1
+ from dataclasses import dataclass
2
+
3
+
4
+ @dataclass(frozen=True)
5
+ class Size:
6
+ width: int
7
+ height: int
8
+
9
+ def aspect_ratio(self):
10
+ return self.width / self.height
11
+
12
+ def rotate(self):
13
+ return Size(self.height, self.width)
14
+
15
+
16
+ SIZES = {
17
+ "8k": Size(7680, 4320),
18
+ "4k": Size(3840, 2160),
19
+ "2k": Size(2560, 1440),
20
+ "Full HD": Size(1920, 1080),
21
+ "HD": Size(1280, 720),
22
+ "480p": Size(854, 480),
23
+ "360p": Size(640, 360),
24
+ "240p": Size(426, 240),
25
+ "144p": Size(256, 144),
26
+ }
27
+
28
+
29
+ __all__ = ["Size", "SIZES"]
@@ -0,0 +1,16 @@
1
+ # file generated by setuptools_scm
2
+ # don't change, don't track in version control
3
+ TYPE_CHECKING = False
4
+ if TYPE_CHECKING:
5
+ from typing import Tuple, Union
6
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
7
+ else:
8
+ VERSION_TUPLE = object
9
+
10
+ version: str
11
+ __version__: str
12
+ __version_tuple__: VERSION_TUPLE
13
+ version_tuple: VERSION_TUPLE
14
+
15
+ __version__ = version = '0.1.0'
16
+ __version_tuple__ = version_tuple = (0, 1, 0)
pixel_sizes/py.typed ADDED
File without changes
@@ -0,0 +1,11 @@
1
+ Copyright 2022 Kitsu Yui
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,37 @@
1
+ Metadata-Version: 2.1
2
+ Name: pixel-sizes
3
+ Version: 0.1.0
4
+ Summary: Dictionary of pixel sizes
5
+ Home-page: https://github.com/kitsuyui/pixel-sizes
6
+ Author: Yui Kitsu
7
+ Author-email: kitsuyui+github@kitsuyui.com
8
+ License: BSD-3-Clause
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: License :: OSI Approved :: BSD License
11
+ Classifier: Programming Language :: Python :: 3.8
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+
22
+ # python-pixel-sizes
23
+
24
+ [![codecov](https://codecov.io/gh/kitsuyui/python-pixel-sizes/graph/badge.svg?token=830WMASKHU)](https://codecov.io/gh/kitsuyui/python-pixel-sizes)
25
+
26
+ ## Usage
27
+
28
+ ```python
29
+ from pixel_sizes import SIZES
30
+
31
+ SIZES['8k'].width # 7680
32
+ SIZES['8k'].height # 4320
33
+ SIZES['8k'].aspect_ratio() # 16/9 == 1.7777777777777777
34
+
35
+ # LICENSE
36
+
37
+ The 3-Clause BSD License. See also LICENSE file.
@@ -0,0 +1,8 @@
1
+ pixel_sizes/__init__.py,sha256=N_9Ya5tvJzu3ucq0MId_h8RzpKliJjOg5-y3RR8-yO8,540
2
+ pixel_sizes/_version.py,sha256=IMl2Pr_Sy4LVRKy_Sm4CdwUl1Gryous6ncL96EMYsnM,411
3
+ pixel_sizes/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ pixel_sizes-0.1.0.dist-info/LICENSE,sha256=59MH6uQUUjdlQVK55r_KDPA7HitghBnf-VSdd3ENTMQ,1454
5
+ pixel_sizes-0.1.0.dist-info/METADATA,sha256=Otau10CwJ6_ZNs0cwxQC2kSjVKiOtHi32i-6Bftt8XY,1150
6
+ pixel_sizes-0.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
7
+ pixel_sizes-0.1.0.dist-info/top_level.txt,sha256=AymrlAxrjuN3pLw1axBp74fx0soWqdLBEvNjnghdRtE,12
8
+ pixel_sizes-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.43.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ pixel_sizes