blurry-cli 0.19.2__tar.gz → 0.20.1__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.
Files changed (40) hide show
  1. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/PKG-INFO +2 -2
  2. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/file_processors/__init__.py +2 -14
  3. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/markdown/renderer_functions/render_video.py +11 -5
  4. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/utils.py +15 -0
  5. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/pyproject.toml +2 -2
  6. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/LICENSE +0 -0
  7. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/README.md +0 -0
  8. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/__init__.py +0 -0
  9. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/__main__.py +0 -0
  10. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/async_typer.py +0 -0
  11. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/cli.py +0 -0
  12. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/commands/__init__.py +0 -0
  13. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/commands/clean.py +0 -0
  14. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/commands/init.py +0 -0
  15. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/commands/version.py +0 -0
  16. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/constants.py +0 -0
  17. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/gather_file_data_by_directory.py +0 -0
  18. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/images.py +0 -0
  19. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/markdown/__init__.py +0 -0
  20. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/markdown/front_matter.py +0 -0
  21. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/markdown/renderer_functions/__init__.py +0 -0
  22. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/open_graph.py +0 -0
  23. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/__init__.py +0 -0
  24. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/html_plugins/__init__.py +0 -0
  25. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/html_plugins/minify_html_plugin.py +0 -0
  26. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/jinja_plugins/__init__.py +0 -0
  27. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/jinja_plugins/blurry_image_extension.py +0 -0
  28. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/jinja_plugins/filters.py +0 -0
  29. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/markdown_plugins/__init__.py +0 -0
  30. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/markdown_plugins/container_plugin.py +0 -0
  31. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/markdown_plugins/punctuation_plugin.py +0 -0
  32. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/plugins/markdown_plugins/python_code_plugin.py +0 -0
  33. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/py.typed +0 -0
  34. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/runserver_handlers.py +0 -0
  35. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/schema_validation/__init__.py +0 -0
  36. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/schema_validation/models.py +0 -0
  37. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/settings.py +0 -0
  38. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/sitemap.py +0 -0
  39. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/templates.py +0 -0
  40. {blurry_cli-0.19.2 → blurry_cli-0.20.1}/blurry/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blurry-cli
3
- Version: 0.19.2
3
+ Version: 0.20.1
4
4
  Summary: A Mistune-based static site generator for Python
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -24,7 +24,6 @@ Classifier: Topic :: Text Processing :: Markup :: Markdown
24
24
  Requires-Dist: Jinja2 (>=3.1.5,<4.0.0)
25
25
  Requires-Dist: PyLD (>=2.0.4,<3.0.0)
26
26
  Requires-Dist: dpath (>=2.2.0,<3.0.0)
27
- Requires-Dist: ffmpeg-python (>=0.2.0,<0.3.0)
28
27
  Requires-Dist: htmlmin2 (>=0.1.13,<0.2.0)
29
28
  Requires-Dist: jinja2-simple-tags (>=0.6.1,<0.7.0)
30
29
  Requires-Dist: jinjax (>=0.48,<0.62)
@@ -32,6 +31,7 @@ Requires-Dist: livereload (>=2.7.1,<3.0.0)
32
31
  Requires-Dist: mistune (>=3.1.0,<4.0.0)
33
32
  Requires-Dist: pillow (>=12.0.0,<13.0.0)
34
33
  Requires-Dist: pydantic (>=2.10.5,<3.0.0)
34
+ Requires-Dist: pymediainfo (>=7.0.1,<8.0.0)
35
35
  Requires-Dist: rich (>=13.9.4,<15.0.0)
36
36
  Requires-Dist: selectolax (>=0.3.27,<0.4.0)
37
37
  Requires-Dist: typer (>=0.15.1,<0.17.0)
@@ -1,12 +1,10 @@
1
1
  import asyncio
2
2
  import dataclasses
3
- import json
4
3
  import mimetypes
5
4
  import shutil
6
5
  from copy import deepcopy
7
6
  from datetime import datetime
8
7
  from pathlib import Path
9
- from typing import Any
10
8
 
11
9
  from jinja2 import Environment
12
10
  from rich.console import Console
@@ -20,9 +18,8 @@ from blurry.settings import get_content_directory
20
18
  from blurry.settings import get_settings
21
19
  from blurry.types import MarkdownFileData
22
20
  from blurry.types import TemplateContext
23
- from blurry.utils import content_path_to_url
21
+ from blurry.utils import content_path_to_url, schema_variables_to_json
24
22
  from blurry.utils import convert_content_path_to_directory_in_build
25
- from blurry.utils import format_schema_data
26
23
  from blurry.utils import write_index_file_creating_path
27
24
 
28
25
 
@@ -79,11 +76,6 @@ def process_jinja_file(filepath: Path, jinja_env: Environment, file_data_by_dire
79
76
  filepath_in_build.write_text(html)
80
77
 
81
78
 
82
- def json_converter_with_dates(item: Any) -> None | str:
83
- if isinstance(item, datetime):
84
- return item.strftime("%Y-%M-%D")
85
-
86
-
87
79
  def write_html_file(
88
80
  filepath: Path,
89
81
  file_data_by_directory: dict[Path, list[MarkdownFileData]],
@@ -132,13 +124,9 @@ def write_html_file(
132
124
  continue
133
125
  schema_variables[key] = value
134
126
 
135
- schema_data = json.dumps(
136
- format_schema_data(schema_variables),
137
- default=json_converter_with_dates,
138
- )
139
-
140
127
  validate_front_matter_as_schema(filepath, schema_variables, warning_console)
141
128
 
129
+ schema_data = schema_variables_to_json(schema_variables)
142
130
  schema_type_tag = f'<script type="application/ld+json">{schema_data}</script>'
143
131
 
144
132
  template_context = {
@@ -1,14 +1,20 @@
1
1
  from pathlib import Path
2
2
 
3
- import ffmpeg
3
+ from pymediainfo import MediaInfo
4
4
  from mistune.util import escape
5
5
 
6
6
 
7
7
  def render_video(src: str, absolute_path: Path, extension: str, title: str | None):
8
- video_probe_output = ffmpeg.probe(absolute_path)
9
- video_info = video_probe_output["streams"][0]
10
- video_width = video_info["width"]
11
- video_height = video_info["height"]
8
+ media_info = MediaInfo.parse(absolute_path)
9
+ video_width = 0
10
+ video_height = 0
11
+ for track in media_info.tracks:
12
+ if track.track_type == "Video":
13
+ video_width = track.width
14
+ video_height = track.height
15
+
16
+ if 0 in {video_width, video_height}:
17
+ raise Exception("Video width and/or height undefined")
12
18
 
13
19
  video_attributes = {
14
20
  "height": video_height,
@@ -1,5 +1,8 @@
1
+ import json
1
2
  from concurrent.futures import Future
3
+ from datetime import datetime, date
2
4
  from pathlib import Path
5
+ from typing import Any
3
6
 
4
7
  from blurry.settings import get_build_directory
5
8
  from blurry.settings import get_content_directory
@@ -102,6 +105,18 @@ def format_schema_data(schema_data: dict) -> dict:
102
105
  return formatted_schema_data
103
106
 
104
107
 
108
+ def json_converter_with_dates(item: Any) -> None | str:
109
+ if isinstance(item, (date, datetime)):
110
+ return item.strftime("%Y-%m-%d")
111
+
112
+
113
+ def schema_variables_to_json(schema_variables: dict):
114
+ return json.dumps(
115
+ format_schema_data(schema_variables),
116
+ default=json_converter_with_dates,
117
+ )
118
+
119
+
105
120
  def handle_future_result(future: Future, message: str):
106
121
  exception = future.exception()
107
122
  if not exception:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "blurry-cli"
3
- version = "0.19.2"
3
+ version = "0.20.1"
4
4
  description = "A Mistune-based static site generator for Python"
5
5
  authors = ["John Franey <franey@duck.com>"]
6
6
  license = "MIT"
@@ -26,7 +26,6 @@ packages = [{ include = "blurry" }]
26
26
  [tool.poetry.dependencies]
27
27
  Jinja2 = "^3.1.5"
28
28
  PyLD = "^2.0.4"
29
- ffmpeg-python = "^0.2.0"
30
29
  livereload = "^2.7.1"
31
30
  mistune = "^3.1.0"
32
31
  python = "^3.11"
@@ -39,6 +38,7 @@ jinja2-simple-tags = "^0.6.1"
39
38
  jinjax = ">=0.48,<0.62"
40
39
  pydantic = "^2.10.5"
41
40
  pillow = "^12.0.0"
41
+ pymediainfo = "^7.0.1"
42
42
 
43
43
  [tool.poetry.scripts]
44
44
  blurry = 'blurry:main'
File without changes
File without changes
File without changes
File without changes
File without changes