opweb 1.0.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.
- opweb/__init__.py +58 -0
- opweb-1.0.0.dist-info/METADATA +63 -0
- opweb-1.0.0.dist-info/RECORD +5 -0
- opweb-1.0.0.dist-info/WHEEL +4 -0
- opweb-1.0.0.dist-info/licenses/LICENSE +19 -0
opweb/__init__.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""opweb - Web asset distribution package.
|
|
2
|
+
|
|
3
|
+
A Python package for distributing web development assets including
|
|
4
|
+
JavaScript, TypeScript, CSS, HTML, and Node.js modules.
|
|
5
|
+
|
|
6
|
+
Example usage:
|
|
7
|
+
>>> from opweb import get_asset_path, list_assets
|
|
8
|
+
>>> get_asset_path("js", "app.js")
|
|
9
|
+
'opweb/assets/js/app.js'
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
__version__ = "1.0.0"
|
|
16
|
+
|
|
17
|
+
_ASSETS_DIR = Path(__file__).parent / "assets"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_asset_path(subfolder: str, filename: str) -> str:
|
|
21
|
+
"""Get the absolute path to a web asset file.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
subfolder: Asset subfolder (js, ts, css, html, node).
|
|
25
|
+
filename: Name of the asset file.
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
Absolute path to the asset file.
|
|
29
|
+
"""
|
|
30
|
+
return str(_ASSETS_DIR / subfolder / filename)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def list_assets(subfolder: str | None = None) -> dict[str, list[str]]:
|
|
34
|
+
"""List all available web assets.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
subfolder: Optional subfolder to filter by (js, ts, css, html, node).
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
Dictionary mapping subfolder names to lists of filenames.
|
|
41
|
+
"""
|
|
42
|
+
assets = {}
|
|
43
|
+
if subfolder:
|
|
44
|
+
subfolders = [subfolder]
|
|
45
|
+
else:
|
|
46
|
+
subfolders = ["js", "ts", "css", "html", "node"]
|
|
47
|
+
|
|
48
|
+
for sf in subfolders:
|
|
49
|
+
sf_path = _ASSETS_DIR / sf
|
|
50
|
+
if sf_path.exists():
|
|
51
|
+
assets[sf] = sorted([f.name for f in sf_path.iterdir() if f.is_file()])
|
|
52
|
+
else:
|
|
53
|
+
assets[sf] = []
|
|
54
|
+
|
|
55
|
+
return assets
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
__all__ = ["get_asset_path", "list_assets"]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: opweb
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Web asset distribution package - JavaScript, TypeScript, CSS, HTML, and Node.js assets for web development projects.
|
|
5
|
+
Author-email: opweb author <author@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: assets,css,frontend,html,javascript,node,typescript,web
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# opweb
|
|
13
|
+
|
|
14
|
+
**opweb** is a Python package for distributing web development assets including JavaScript, TypeScript, CSS, HTML, and Node.js modules.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install opweb
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from opweb import get_asset_path, list_assets
|
|
26
|
+
|
|
27
|
+
# Get path to a JavaScript asset
|
|
28
|
+
js_path = get_asset_path("js", "app.js")
|
|
29
|
+
|
|
30
|
+
# Get path to a TypeScript asset
|
|
31
|
+
ts_path = get_asset_path("ts", "index.ts")
|
|
32
|
+
|
|
33
|
+
# Get path to a CSS asset
|
|
34
|
+
css_path = get_asset_path("css", "styles.css")
|
|
35
|
+
|
|
36
|
+
# Get path to an HTML asset
|
|
37
|
+
html_path = get_asset_path("html", "index.html")
|
|
38
|
+
|
|
39
|
+
# Get path to a Node.js asset
|
|
40
|
+
node_path = get_asset_path("node", "server.js")
|
|
41
|
+
|
|
42
|
+
# List all available assets
|
|
43
|
+
assets = list_assets()
|
|
44
|
+
print(assets)
|
|
45
|
+
|
|
46
|
+
# List assets in a specific subfolder
|
|
47
|
+
js_assets = list_assets("js")
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Asset Structure
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
opweb/assets/
|
|
54
|
+
├── js/ # JavaScript files
|
|
55
|
+
├── ts/ # TypeScript files
|
|
56
|
+
├── css/ # CSS stylesheets
|
|
57
|
+
├── html/ # HTML templates
|
|
58
|
+
└── node/ # Node.js modules
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
opweb/__init__.py,sha256=UB8Mo9wPj0xFgaeDCuME14Qu6lEZxXVyaKLnrx8wFcA,1515
|
|
2
|
+
opweb-1.0.0.dist-info/METADATA,sha256=Nxm6KVCGYZ9x763SwnVYwJ9GmktMReWwEaVmmufTTyw,1425
|
|
3
|
+
opweb-1.0.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
4
|
+
opweb-1.0.0.dist-info/licenses/LICENSE,sha256=c2XYIenR_g0rYYvHV684cmx1153Y7CIxx081Mogu4zo,1053
|
|
5
|
+
opweb-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|