metupy-core 0.1.0__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.
@@ -0,0 +1,21 @@
1
+ ## MIT License
2
+
3
+ Copyright (c) 2025-present PalembangPy Community
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: metupy-core
3
+ Version: 0.1.0
4
+ Summary: Lightweight Python Static Site & Documentation Generator — fast, component-driven, multi-language, zero JS build tools.
5
+ Keywords: static-site-generator,documentation-generator,markdown-to-html,ssg,docs-as-code,i18n,python-framework,metupy
6
+ Author-email: palembangPy <palembangpy@gmail.com>
7
+ Maintainer-email: tomsdroid <tomsdroid007@gmail.com>
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Documentation
13
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Operating System :: OS Independent
20
+ License-File: LICENSE
21
+ Requires-Dist: chardet>=7.6.0
22
+ Requires-Dist: deep-translator>=1.11.0
23
+ Requires-Dist: docutils>=0.23
24
+ Requires-Dist: jinja2>=3.1.6
25
+ Requires-Dist: lark>=1.3.1
26
+ Requires-Dist: markdown>=3.5.0
27
+ Requires-Dist: peewee>=4.4.0
28
+ Requires-Dist: pluggy>=1.6.0
29
+ Requires-Dist: pygments>=2.21.0
30
+ Requires-Dist: pytest>=9.1.1
31
+ Requires-Dist: pytest-cov>=7.1.0
32
+ Project-URL: Documentation, https://docs.metupy.com/
33
+ Project-URL: Homepage, https://metupy.com
34
+ Project-URL: Issues, https://github.com/metupy/metupy-core/issues
35
+ Project-URL: Repository, https://github.com/metupy/metupy-core
36
+
37
+ <p align="center">
38
+ <img src="https://raw.githubusercontent.com/palembangpy/metupy/main/src/metupy/assets/metupy.png" alt="Metupy Logo" width="120" height="120">
39
+ <br>
40
+ <strong>Fast • Simple • Extensible</strong>
41
+ <br>
42
+ Core utilities and foundational components for Metupy static site generator.
43
+ </p>
44
+
45
+ <p align="center">
46
+ <img src="https://img.shields.io/pypi/v/metupy-core?style=for-the-badge&color=blue" alt="PyPI Version">
47
+ <img src="https://img.shields.io/badge/tests-passing-green?style=for-the-badge" alt="Tests Passing">
48
+ <img src="https://img.shields.io/badge/python-3.9+-blue?style=for-the-badge" alt="Python Version">
49
+ <img src="https://img.shields.io/badge/license-MIT-yellow?style=for-the-badge" alt="License">
50
+ </p>
51
+
52
+ ---
53
+
54
+
55
+ ### Metupy
56
+ Metupy Core provides the essential building blocks used across the Metupy ecosystem:
57
+ - **Signal** System — Event-driven hooks for plugins and lifecycle management
58
+ - **Utilities** — File operations, path handling, port detection, date formatting, and more
59
+ - **Writer** — Output writing, asset copying, and directory management
60
+
61
+ ### Installation
62
+
63
+ ```bash
64
+ pip install metupy-core
65
+ ```
66
+
67
+ ### Quick Start
68
+
69
+ ```python
70
+ from metupy_core.signal import on, emit
71
+ from metupy_core.writer import write_output, copy_assets
72
+ from metupy_core.utils import slugify, get_free_port
73
+ ```
74
+
75
+ ### Project Structure
76
+
77
+ ```bash
78
+ src/metupy_core/
79
+ ├── __init__.py # Package entry point & public API
80
+ ├── api.py # High-level public interface
81
+ ├── cache.py # Caching system & memory management
82
+ ├── components.py # UI component blueprints
83
+ ├── config.py # Configuration loading & validation
84
+ ├── contents.py # Content processing & data models
85
+ ├── database.py # Local database & storage layer
86
+ ├── exception.py # Custom exceptions & error handling
87
+ ├── generators.py # Static file & page generators
88
+ ├── i18n.py # Internationalization & multi-language
89
+ ├── logging.py # Logging setup & output formatting
90
+ ├── middleware.py # Request/response middleware
91
+ ├── parsers.py # Markdown & file parsers
92
+ ├── reader.py # File system reading & watching
93
+ ├── renderer.py # Template rendering engine
94
+ ├── server.py # Development HTTP server
95
+ ├── setting.py # User settings & defaults
96
+ ├── signal.py # Event system & hooks
97
+ ├── utils.py # Shared utilities & helpers
98
+ └── writer.py # File output & asset management
99
+
100
+ ```
101
+
102
+ <p align="center">
103
+ <img src="https://img.shields.io/badge/Made%20with-Python-3776AB?style=flat-square" alt="Made with Python">
104
+ <br><br>
105
+ MIT License — see LICENSE file for details
106
+ </p>
107
+
@@ -0,0 +1,70 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/palembangpy/metupy/main/src/metupy/assets/metupy.png" alt="Metupy Logo" width="120" height="120">
3
+ <br>
4
+ <strong>Fast • Simple • Extensible</strong>
5
+ <br>
6
+ Core utilities and foundational components for Metupy static site generator.
7
+ </p>
8
+
9
+ <p align="center">
10
+ <img src="https://img.shields.io/pypi/v/metupy-core?style=for-the-badge&color=blue" alt="PyPI Version">
11
+ <img src="https://img.shields.io/badge/tests-passing-green?style=for-the-badge" alt="Tests Passing">
12
+ <img src="https://img.shields.io/badge/python-3.9+-blue?style=for-the-badge" alt="Python Version">
13
+ <img src="https://img.shields.io/badge/license-MIT-yellow?style=for-the-badge" alt="License">
14
+ </p>
15
+
16
+ ---
17
+
18
+
19
+ ### Metupy
20
+ Metupy Core provides the essential building blocks used across the Metupy ecosystem:
21
+ - **Signal** System — Event-driven hooks for plugins and lifecycle management
22
+ - **Utilities** — File operations, path handling, port detection, date formatting, and more
23
+ - **Writer** — Output writing, asset copying, and directory management
24
+
25
+ ### Installation
26
+
27
+ ```bash
28
+ pip install metupy-core
29
+ ```
30
+
31
+ ### Quick Start
32
+
33
+ ```python
34
+ from metupy_core.signal import on, emit
35
+ from metupy_core.writer import write_output, copy_assets
36
+ from metupy_core.utils import slugify, get_free_port
37
+ ```
38
+
39
+ ### Project Structure
40
+
41
+ ```bash
42
+ src/metupy_core/
43
+ ├── __init__.py # Package entry point & public API
44
+ ├── api.py # High-level public interface
45
+ ├── cache.py # Caching system & memory management
46
+ ├── components.py # UI component blueprints
47
+ ├── config.py # Configuration loading & validation
48
+ ├── contents.py # Content processing & data models
49
+ ├── database.py # Local database & storage layer
50
+ ├── exception.py # Custom exceptions & error handling
51
+ ├── generators.py # Static file & page generators
52
+ ├── i18n.py # Internationalization & multi-language
53
+ ├── logging.py # Logging setup & output formatting
54
+ ├── middleware.py # Request/response middleware
55
+ ├── parsers.py # Markdown & file parsers
56
+ ├── reader.py # File system reading & watching
57
+ ├── renderer.py # Template rendering engine
58
+ ├── server.py # Development HTTP server
59
+ ├── setting.py # User settings & defaults
60
+ ├── signal.py # Event system & hooks
61
+ ├── utils.py # Shared utilities & helpers
62
+ └── writer.py # File output & asset management
63
+
64
+ ```
65
+
66
+ <p align="center">
67
+ <img src="https://img.shields.io/badge/Made%20with-Python-3776AB?style=flat-square" alt="Made with Python">
68
+ <br><br>
69
+ MIT License — see LICENSE file for details
70
+ </p>
@@ -0,0 +1,59 @@
1
+ [project]
2
+ name = "metupy-core"
3
+ version = "0.1.0"
4
+ description = "Lightweight Python Static Site & Documentation Generator — fast, component-driven, multi-language, zero JS build tools."
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ keywords = [
8
+ "static-site-generator",
9
+ "documentation-generator",
10
+ "markdown-to-html",
11
+ "ssg",
12
+ "docs-as-code",
13
+ "i18n",
14
+ "python-framework",
15
+ "metupy",
16
+ ]
17
+
18
+ authors = [
19
+ { name = "palembangPy", email = "palembangpy@gmail.com" }
20
+ ]
21
+ maintainers = [
22
+ { name = "tomsdroid", email = "tomsdroid007@gmail.com" }
23
+ ]
24
+ classifiers = [
25
+ "Development Status :: 3 - Alpha",
26
+ "Intended Audience :: Developers",
27
+ "Topic :: Documentation",
28
+ "Topic :: Text Processing :: Markup :: Markdown",
29
+ "License :: OSI Approved :: MIT License",
30
+ "Programming Language :: Python :: 3",
31
+ "Programming Language :: Python :: 3.10",
32
+ "Programming Language :: Python :: 3.11",
33
+ "Programming Language :: Python :: 3.12",
34
+ "Operating System :: OS Independent",
35
+ ]
36
+
37
+ dependencies = [
38
+ "chardet>=7.6.0",
39
+ "deep-translator>=1.11.0",
40
+ "docutils>=0.23",
41
+ "jinja2>=3.1.6",
42
+ "lark>=1.3.1",
43
+ "markdown>=3.5.0",
44
+ "peewee>=4.4.0",
45
+ "pluggy>=1.6.0",
46
+ "pygments>=2.21.0",
47
+ "pytest>=9.1.1",
48
+ "pytest-cov>=7.1.0",
49
+ ]
50
+
51
+ [project.urls]
52
+ Homepage = "https://metupy.com"
53
+ Documentation = "https://docs.metupy.com/"
54
+ Repository = "https://github.com/metupy/metupy-core"
55
+ Issues = "https://github.com/metupy/metupy-core/issues"
56
+
57
+ [build-system]
58
+ requires = ["flit-core>=3.10,<4"]
59
+ build-backend = "flit_core.buildapi"
@@ -0,0 +1,178 @@
1
+ """
2
+ Metupy Core
3
+ ~~~~~~~~~~~
4
+
5
+ Static site generator with multi-format content, AST-based templating,
6
+ and plugin-friendly architecture.
7
+
8
+ Supported formats: .pym, .py, .md, .rst
9
+ License: MIT
10
+ """
11
+
12
+ __version__ = "0.1.0"
13
+ __author__ = "Metupy Team"
14
+ __license__ = "MIT"
15
+
16
+ # ─── Core Exports ───
17
+
18
+ from .logging import log, setup_logging
19
+ from .setting import Setting, load_setting, NavItem
20
+ from .signal import on, off, emit, connect, disconnect, list_signals, reset
21
+ from .utils import (
22
+ get_free_port,
23
+ watch_directory,
24
+ ensure_dir,
25
+ clean_dir,
26
+ copy_file,
27
+ slugify,
28
+ format_date,
29
+ file_hash,
30
+ get_ext,
31
+ is_binary_file,
32
+ walk_files,
33
+ relative_path,
34
+ )
35
+ from .reader import (
36
+ FileReader,
37
+ read_file,
38
+ read_and_parse,
39
+ detect_format,
40
+ normalize_content,
41
+ is_supported,
42
+ SUPPORTED_EXTENSIONS,
43
+ )
44
+ from .parsers import (
45
+ ParsedContent,
46
+ BaseParser,
47
+ PymParser,
48
+ MarkdownParser,
49
+ RestructuredTextParser,
50
+ PythonParser,
51
+ get_parser_for_file,
52
+ parse_file,
53
+ )
54
+ from .renderer import (
55
+ RenderContext,
56
+ BaseRenderer,
57
+ PymRenderer,
58
+ MarkdownRenderer,
59
+ RestructuredTextRenderer,
60
+ PythonRenderer,
61
+ Renderer,
62
+ render_content,
63
+ )
64
+ from .writer import (
65
+ write_output,
66
+ write_binary,
67
+ copy_assets,
68
+ ensure_dir as ensure_output_dir,
69
+ clean_directory,
70
+ get_output_path,
71
+ )
72
+ from .middleware import (
73
+ Middleware,
74
+ MiddlewareStack,
75
+ CORSMiddleware,
76
+ LoggingMiddleware,
77
+ SecurityMiddleware,
78
+ RateLimitMiddleware,
79
+ CacheMiddleware,
80
+ GZipMiddleware,
81
+ DatabaseMiddleware,
82
+ )
83
+ from .server import (
84
+ MetupyServer,
85
+ LiveReloadHandler,
86
+ wsgi_app,
87
+ asgi_app,
88
+ run_server,
89
+ )
90
+ from .page import Page, LayoutManager, ComponentRegistry, Theme
91
+
92
+ # ─── Convenience Aliases ───
93
+
94
+ __all__ = [
95
+ # Core
96
+ "__version__",
97
+ "log",
98
+ "setup_logging",
99
+ # Settings
100
+ "Setting",
101
+ "load_setting",
102
+ "NavItem",
103
+ # Signals
104
+ "on",
105
+ "off",
106
+ "emit",
107
+ "connect",
108
+ "disconnect",
109
+ "list_signals",
110
+ "reset",
111
+ # Utils
112
+ "get_free_port",
113
+ "watch_directory",
114
+ "ensure_dir",
115
+ "clean_dir",
116
+ "copy_file",
117
+ "slugify",
118
+ "format_date",
119
+ "file_hash",
120
+ "get_ext",
121
+ "is_binary_file",
122
+ "walk_files",
123
+ "relative_path",
124
+ # Reader
125
+ "FileReader",
126
+ "read_file",
127
+ "read_and_parse",
128
+ "detect_format",
129
+ "normalize_content",
130
+ "is_supported",
131
+ "SUPPORTED_EXTENSIONS",
132
+ # Parsers
133
+ "ParsedContent",
134
+ "BaseParser",
135
+ "PymParser",
136
+ "MarkdownParser",
137
+ "RestructuredTextParser",
138
+ "PythonParser",
139
+ "get_parser_for_file",
140
+ "parse_file",
141
+ # Renderer
142
+ "RenderContext",
143
+ "BaseRenderer",
144
+ "PymRenderer",
145
+ "MarkdownRenderer",
146
+ "RestructuredTextRenderer",
147
+ "PythonRenderer",
148
+ "Renderer",
149
+ "render_content",
150
+ # Writer
151
+ "write_output",
152
+ "write_binary",
153
+ "copy_assets",
154
+ "ensure_output_dir",
155
+ "clean_directory",
156
+ "get_output_path",
157
+ # Middleware
158
+ "Middleware",
159
+ "MiddlewareStack",
160
+ "CORSMiddleware",
161
+ "LoggingMiddleware",
162
+ "SecurityMiddleware",
163
+ "RateLimitMiddleware",
164
+ "CacheMiddleware",
165
+ "GZipMiddleware",
166
+ "DatabaseMiddleware",
167
+ # Server
168
+ "MetupyServer",
169
+ "LiveReloadHandler",
170
+ "wsgi_app",
171
+ "asgi_app",
172
+ "run_server",
173
+ # Page / Theme / Components
174
+ "Page",
175
+ "LayoutManager",
176
+ "ComponentRegistry",
177
+ "Theme",
178
+ ]