pysfi 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.
- pysfi-0.1.0/.codebuddy/rules/language-standards.mdc +79 -0
- pysfi-0.1.0/.gitignore +18 -0
- pysfi-0.1.0/.python-version +1 -0
- pysfi-0.1.0/PKG-INFO +78 -0
- pysfi-0.1.0/README.md +71 -0
- pysfi-0.1.0/pyproject.toml +102 -0
- pysfi-0.1.0/sfi/__init__.py +0 -0
- pysfi-0.1.0/sfi/alarmclock/__init__.py +0 -0
- pysfi-0.1.0/sfi/alarmclock/alarmclock.py +367 -0
- pysfi-0.1.0/sfi/alarmclock/pyproject.toml +7 -0
- pysfi-0.1.0/sfi/embedinstall/embedinstall.py +418 -0
- pysfi-0.1.0/sfi/embedinstall/pyproject.toml +7 -0
- pysfi-0.1.0/sfi/filedate/README.md +45 -0
- pysfi-0.1.0/sfi/filedate/__init__.py +0 -0
- pysfi-0.1.0/sfi/filedate/filedate.py +112 -0
- pysfi-0.1.0/sfi/filedate/pyproject.toml +11 -0
- pysfi-0.1.0/sfi/makepython/__init__.py +0 -0
- pysfi-0.1.0/sfi/makepython/makepython.py +68 -0
- pysfi-0.1.0/sfi/makepython/pyproject.toml +7 -0
- pysfi-0.1.0/sfi/projectparse/projectparse.py +152 -0
- pysfi-0.1.0/sfi/projectparse/pyproject.toml +9 -0
- pysfi-0.1.0/sfi/pyloadergen/pyloadergen.py +1042 -0
- pysfi-0.1.0/sfi/pyloadergen/pyproject.toml +7 -0
- pysfi-0.1.0/sfi/pyloadergen/tests/__init__.py +0 -0
- pysfi-0.1.0/sfi/pyloadergen/tests/test_pyloadergen.py +290 -0
- pysfi-0.1.0/sfi/pypacker/fspacker.py +91 -0
- pysfi-0.1.0/sfi/pypacker/pyproject.toml +7 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
enabled: true
|
|
5
|
+
updatedAt: 2026-01-12T09:56:47.884Z
|
|
6
|
+
provider:
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Language Standards for sfi Project
|
|
10
|
+
|
|
11
|
+
This rule enforces consistent use of English language throughout the sfi project to ensure international accessibility and professional code standards.
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
### 1. Code Comments
|
|
16
|
+
- ALL code comments MUST be written in English
|
|
17
|
+
- This includes:
|
|
18
|
+
- Inline comments (single-line)
|
|
19
|
+
- Block comments (multi-line)
|
|
20
|
+
- Docstrings
|
|
21
|
+
- Type hints descriptions
|
|
22
|
+
- Function and class documentation
|
|
23
|
+
|
|
24
|
+
### 2. Documentation
|
|
25
|
+
- ALL documentation files MUST be written in English
|
|
26
|
+
- This includes:
|
|
27
|
+
- README.md
|
|
28
|
+
- Any additional markdown files (*.md)
|
|
29
|
+
- Documentation text in code files
|
|
30
|
+
- Inline documentation strings
|
|
31
|
+
|
|
32
|
+
### 3. User-Facing Messages
|
|
33
|
+
- Command-line interface messages SHOULD be written in English for international users
|
|
34
|
+
- This includes:
|
|
35
|
+
- Help text in argparse
|
|
36
|
+
- Logger messages (info, warning, error)
|
|
37
|
+
- Print statements for user output
|
|
38
|
+
- Error messages
|
|
39
|
+
|
|
40
|
+
### 4. Variable and Function Names
|
|
41
|
+
- All identifiers MUST use English names
|
|
42
|
+
- Examples:
|
|
43
|
+
- ✅ `process_file()`, `user_name`, `total_count`
|
|
44
|
+
- ❌ `处理文件()`, `用户名`, `总数`
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
### Correct (English)
|
|
49
|
+
```python
|
|
50
|
+
"""Remove file date prefix and replace with creation/modification date."""
|
|
51
|
+
def process_files(files: list[Path]) -> None:
|
|
52
|
+
"""Process multiple files concurrently."""
|
|
53
|
+
logger.info("Processing files...")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Incorrect (Non-English)
|
|
57
|
+
```python
|
|
58
|
+
"""移除文件日期前缀并替换为创建/修改日期。"""
|
|
59
|
+
def 处理文件(文件列表: list[Path]) -> None:
|
|
60
|
+
"""并发处理多个文件。"""
|
|
61
|
+
logger.info("处理文件中...")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Enforcement
|
|
65
|
+
|
|
66
|
+
When writing or reviewing code for the sfi project:
|
|
67
|
+
1. Check all comments are in English
|
|
68
|
+
2. Check all docstrings are in English
|
|
69
|
+
3. Check README and documentation are in English
|
|
70
|
+
4. Check variable/function names are in English
|
|
71
|
+
5. Check user-facing messages are in English
|
|
72
|
+
|
|
73
|
+
## Rationale
|
|
74
|
+
|
|
75
|
+
- English is the de facto standard for open-source projects
|
|
76
|
+
- Ensures code is accessible to international contributors
|
|
77
|
+
- Follows Python community best practices
|
|
78
|
+
- Maintains consistency across the codebase
|
|
79
|
+
- Facilitates collaboration and code review
|
pysfi-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.8
|
pysfi-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pysfi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Single File commands for Interactive python.
|
|
5
|
+
Requires-Python: >=3.8
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# sfi
|
|
9
|
+
|
|
10
|
+
Single File commands for Interactive python.
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
sfi is a Python project that provides single-file command-line utilities, designed to be lightweight and easy-to-use.
|
|
15
|
+
|
|
16
|
+
## Available Commands
|
|
17
|
+
|
|
18
|
+
### [filedate](sfi/filedate/README.md)
|
|
19
|
+
|
|
20
|
+
A file date management tool that normalizes date prefixes in filenames.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Install using uv (recommended)
|
|
26
|
+
uv add sfi
|
|
27
|
+
|
|
28
|
+
# Or using pip
|
|
29
|
+
pip install sfi
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Development
|
|
33
|
+
|
|
34
|
+
### Requirements
|
|
35
|
+
|
|
36
|
+
- Python >= 3.8
|
|
37
|
+
- [uv](https://github.com/astral-sh/uv) (recommended) or pip
|
|
38
|
+
|
|
39
|
+
### Development Dependencies
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv pip install -e ".[dev]"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Code Standards
|
|
46
|
+
|
|
47
|
+
The project uses Ruff for code linting and formatting:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Check code
|
|
51
|
+
ruff check .
|
|
52
|
+
|
|
53
|
+
# Format code
|
|
54
|
+
ruff format .
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Project Structure
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
sfi/
|
|
61
|
+
├── pyproject.toml # Main project configuration
|
|
62
|
+
├── README.md
|
|
63
|
+
└── sfi/
|
|
64
|
+
├── __init__.py
|
|
65
|
+
└── filedate/ # filedate command module
|
|
66
|
+
├── __init__.py
|
|
67
|
+
├── filedate.py # Main implementation
|
|
68
|
+
├── pyproject.toml
|
|
69
|
+
└── README.md # Detailed documentation
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT License
|
|
75
|
+
|
|
76
|
+
## Contributing
|
|
77
|
+
|
|
78
|
+
Issues and Pull Requests are welcome!
|
pysfi-0.1.0/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# sfi
|
|
2
|
+
|
|
3
|
+
Single File commands for Interactive python.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
sfi is a Python project that provides single-file command-line utilities, designed to be lightweight and easy-to-use.
|
|
8
|
+
|
|
9
|
+
## Available Commands
|
|
10
|
+
|
|
11
|
+
### [filedate](sfi/filedate/README.md)
|
|
12
|
+
|
|
13
|
+
A file date management tool that normalizes date prefixes in filenames.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Install using uv (recommended)
|
|
19
|
+
uv add sfi
|
|
20
|
+
|
|
21
|
+
# Or using pip
|
|
22
|
+
pip install sfi
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
### Requirements
|
|
28
|
+
|
|
29
|
+
- Python >= 3.8
|
|
30
|
+
- [uv](https://github.com/astral-sh/uv) (recommended) or pip
|
|
31
|
+
|
|
32
|
+
### Development Dependencies
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
uv pip install -e ".[dev]"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Code Standards
|
|
39
|
+
|
|
40
|
+
The project uses Ruff for code linting and formatting:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Check code
|
|
44
|
+
ruff check .
|
|
45
|
+
|
|
46
|
+
# Format code
|
|
47
|
+
ruff format .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Project Structure
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
sfi/
|
|
54
|
+
├── pyproject.toml # Main project configuration
|
|
55
|
+
├── README.md
|
|
56
|
+
└── sfi/
|
|
57
|
+
├── __init__.py
|
|
58
|
+
└── filedate/ # filedate command module
|
|
59
|
+
├── __init__.py
|
|
60
|
+
├── filedate.py # Main implementation
|
|
61
|
+
├── pyproject.toml
|
|
62
|
+
└── README.md # Detailed documentation
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT License
|
|
68
|
+
|
|
69
|
+
## Contributing
|
|
70
|
+
|
|
71
|
+
Issues and Pull Requests are welcome!
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
build-backend = "hatchling.build"
|
|
3
|
+
requires = ["hatchling"]
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
dependencies = []
|
|
7
|
+
description = "Single File commands for Interactive python."
|
|
8
|
+
name = "pysfi"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
version = "0.1.0"
|
|
12
|
+
|
|
13
|
+
[project.scripts]
|
|
14
|
+
alarmclk = "sfi.alarmclock.alarmclock:main"
|
|
15
|
+
embedinstall = "sfi.embedinstall.embedinstall:main"
|
|
16
|
+
filedate = "sfi.filedate.filedate:main"
|
|
17
|
+
mkp = "sfi.makepython.makepython:main"
|
|
18
|
+
projectparse = "sfi.projectparse.projectparse:main"
|
|
19
|
+
pyloadergen = "sfi.pyloadergen.pyloadergen:main"
|
|
20
|
+
pypacker = "sfi.pypacker.pypacker:main"
|
|
21
|
+
|
|
22
|
+
[tool.hatch.build.targets.wheel]
|
|
23
|
+
exclude = ["sfi/*/README.md", "sfi/*/dist", "sfi/*/pyproject.toml"]
|
|
24
|
+
packages = ["sfi"]
|
|
25
|
+
|
|
26
|
+
[tool.ruff]
|
|
27
|
+
line-length = 120
|
|
28
|
+
target-version = "py38"
|
|
29
|
+
|
|
30
|
+
# Exclude files and directories
|
|
31
|
+
exclude = [
|
|
32
|
+
".bzr",
|
|
33
|
+
".direnv",
|
|
34
|
+
".eggs",
|
|
35
|
+
".git",
|
|
36
|
+
".git-rewrite",
|
|
37
|
+
".hg",
|
|
38
|
+
".mypy_cache",
|
|
39
|
+
".nox",
|
|
40
|
+
".pants.d",
|
|
41
|
+
".pytype",
|
|
42
|
+
".ruff_cache",
|
|
43
|
+
".svn",
|
|
44
|
+
".tox",
|
|
45
|
+
".venv",
|
|
46
|
+
"__pypackages__",
|
|
47
|
+
"_build",
|
|
48
|
+
"buck-out",
|
|
49
|
+
"build",
|
|
50
|
+
"dist",
|
|
51
|
+
"node_modules",
|
|
52
|
+
"venv",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[tool.ruff.lint]
|
|
56
|
+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
|
57
|
+
fixable = ["ALL"]
|
|
58
|
+
ignore = [
|
|
59
|
+
"B008", # Do not perform function calls in function arguments
|
|
60
|
+
"E501", # Line too long (handled by formatter)
|
|
61
|
+
]
|
|
62
|
+
select = [
|
|
63
|
+
"B", # flake8-bugbear
|
|
64
|
+
"C4", # flake8-comprehensions
|
|
65
|
+
"E", # pycodestyle errors
|
|
66
|
+
"F", # Pyflakes
|
|
67
|
+
"I", # isort
|
|
68
|
+
"N", # pep8-naming
|
|
69
|
+
"RUF", # Ruff-specific rules
|
|
70
|
+
"SIM", # flake8-simplify
|
|
71
|
+
"UP", # pyupgrade
|
|
72
|
+
"W", # pycodestyle warnings
|
|
73
|
+
]
|
|
74
|
+
unfixable = []
|
|
75
|
+
|
|
76
|
+
[tool.ruff.lint.isort]
|
|
77
|
+
known-first-party = ["sfi"]
|
|
78
|
+
|
|
79
|
+
[tool.ruff.lint.per-file-ignores]
|
|
80
|
+
"__init__.py" = ["F401"] # Allow unused imports
|
|
81
|
+
|
|
82
|
+
[tool.uv.workspace]
|
|
83
|
+
members = [
|
|
84
|
+
"sfi/alarmclock",
|
|
85
|
+
"sfi/embedinstall",
|
|
86
|
+
"sfi/filedate",
|
|
87
|
+
"sfi/makepython",
|
|
88
|
+
"sfi/projectparse",
|
|
89
|
+
"sfi/pyloadergen",
|
|
90
|
+
"sfi/pypacker",
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
[dependency-groups]
|
|
94
|
+
dev = [
|
|
95
|
+
"hatch>=1.14.2",
|
|
96
|
+
"pyside2>=5.15.2.1",
|
|
97
|
+
"pytest-cov>=5.0.0",
|
|
98
|
+
"pytest>=8.3.5",
|
|
99
|
+
"qdarkstyle>=3.2.3",
|
|
100
|
+
"ruff>=0.14.11",
|
|
101
|
+
"tomli>=2.4.0",
|
|
102
|
+
]
|
|
File without changes
|
|
File without changes
|