chronulus-core 0.0.4__tar.gz
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.
- chronulus_core-0.0.4/PKG-INFO +16 -0
- chronulus_core-0.0.4/README.md +1 -0
- chronulus_core-0.0.4/pyproject.toml +3 -0
- chronulus_core-0.0.4/setup.cfg +4 -0
- chronulus_core-0.0.4/setup.py +36 -0
- chronulus_core-0.0.4/src/chronulus_core/__init__.py +0 -0
- chronulus_core-0.0.4/src/chronulus_core/types/__init__.py +0 -0
- chronulus_core-0.0.4/src/chronulus_core/types/attributes.py +45 -0
- chronulus_core-0.0.4/src/chronulus_core.egg-info/PKG-INFO +16 -0
- chronulus_core-0.0.4/src/chronulus_core.egg-info/SOURCES.txt +11 -0
- chronulus_core-0.0.4/src/chronulus_core.egg-info/dependency_links.txt +1 -0
- chronulus_core-0.0.4/src/chronulus_core.egg-info/requires.txt +2 -0
- chronulus_core-0.0.4/src/chronulus_core.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: chronulus-core
|
|
3
|
+
Version: 0.0.4
|
|
4
|
+
Summary: Core components for Chronulus
|
|
5
|
+
Author: Chronulus AI
|
|
6
|
+
Author-email: jeremy@chronulus.com
|
|
7
|
+
License: Apache
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: pydantic==2.9.2
|
|
14
|
+
Requires-Dist: pillow==11.0.0
|
|
15
|
+
|
|
16
|
+
# Chronulus Core
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Chronulus Core
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import pathlib
|
|
2
|
+
from setuptools import setup, find_packages, Extension
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# The directory containing this file
|
|
6
|
+
HERE = pathlib.Path(__file__).parent
|
|
7
|
+
|
|
8
|
+
# The text of the README file
|
|
9
|
+
README = (HERE / "README.md").read_text()
|
|
10
|
+
|
|
11
|
+
__version__ = "0.0.4"
|
|
12
|
+
|
|
13
|
+
with open('requirements.txt') as f:
|
|
14
|
+
requirements = f.read().splitlines()
|
|
15
|
+
|
|
16
|
+
# This call to setup() does all the work
|
|
17
|
+
setup(
|
|
18
|
+
name="chronulus-core",
|
|
19
|
+
version=__version__,
|
|
20
|
+
description="Core components for Chronulus",
|
|
21
|
+
long_description=README,
|
|
22
|
+
long_description_content_type="text/markdown",
|
|
23
|
+
author="Chronulus AI",
|
|
24
|
+
author_email="jeremy@chronulus.com",
|
|
25
|
+
license="Apache",
|
|
26
|
+
classifiers=[
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
"Programming Language :: Python :: 3.11",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
],
|
|
32
|
+
package_dir={"": "src"},
|
|
33
|
+
packages=find_packages("src"),
|
|
34
|
+
include_package_data=False,
|
|
35
|
+
install_requires=requirements,
|
|
36
|
+
)
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
from PIL import Image
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_pillow_image_type(ext: str):
|
|
8
|
+
ext = "." + ext.lower().replace('.','')
|
|
9
|
+
if ext in Image.registered_extensions():
|
|
10
|
+
return Image.registered_extensions()[ext]
|
|
11
|
+
else:
|
|
12
|
+
return None
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ImageFromUrl(BaseModel):
|
|
16
|
+
url: str
|
|
17
|
+
type: str | None = Field(default=None)
|
|
18
|
+
|
|
19
|
+
def model_post_init(self, __context: Any) -> None:
|
|
20
|
+
if self.type is None:
|
|
21
|
+
parts = self.url.split(".")
|
|
22
|
+
if len(parts) == 1:
|
|
23
|
+
raise ValueError(f"""Image type could not be determined for {self.url}.
|
|
24
|
+
Please add it in the `type` argument.""")
|
|
25
|
+
else:
|
|
26
|
+
ext = parts[-1]
|
|
27
|
+
pillow_format = get_pillow_image_type(ext)
|
|
28
|
+
if pillow_format is None:
|
|
29
|
+
raise ValueError(
|
|
30
|
+
f"""Image type was detected as '.{ext}' but this type is not supported.
|
|
31
|
+
If this is incorrect, please provide the correct type in the `type` argument.
|
|
32
|
+
""")
|
|
33
|
+
else:
|
|
34
|
+
self.type = pillow_format
|
|
35
|
+
|
|
36
|
+
else:
|
|
37
|
+
pillow_format = get_pillow_image_type(self.type)
|
|
38
|
+
if pillow_format is None:
|
|
39
|
+
raise ValueError(
|
|
40
|
+
f"""Image type '{self.type}' was specified but this type is not supported.
|
|
41
|
+
If this is incorrect, please provide the correct type in the `type` argument.
|
|
42
|
+
""")
|
|
43
|
+
else:
|
|
44
|
+
self.type = pillow_format
|
|
45
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: chronulus-core
|
|
3
|
+
Version: 0.0.4
|
|
4
|
+
Summary: Core components for Chronulus
|
|
5
|
+
Author: Chronulus AI
|
|
6
|
+
Author-email: jeremy@chronulus.com
|
|
7
|
+
License: Apache
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: pydantic==2.9.2
|
|
14
|
+
Requires-Dist: pillow==11.0.0
|
|
15
|
+
|
|
16
|
+
# Chronulus Core
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
setup.py
|
|
4
|
+
src/chronulus_core/__init__.py
|
|
5
|
+
src/chronulus_core.egg-info/PKG-INFO
|
|
6
|
+
src/chronulus_core.egg-info/SOURCES.txt
|
|
7
|
+
src/chronulus_core.egg-info/dependency_links.txt
|
|
8
|
+
src/chronulus_core.egg-info/requires.txt
|
|
9
|
+
src/chronulus_core.egg-info/top_level.txt
|
|
10
|
+
src/chronulus_core/types/__init__.py
|
|
11
|
+
src/chronulus_core/types/attributes.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
chronulus_core
|