Here is the English translation of the README.md file:
# CreateFile with Designated Encoding ✨
[](https://github.com/StarWindv/CreateFile-with-DesignatedEncoding/blob/main/LICENSE)
[](https://pypi.org/project/stv_create_file/)
[](https://pypi.org/project/stv_create_file/)
[中文](./README.md)
**CreateFile with Designated Encoding** is a powerful command-line tool for creating files with specified encoding formats, supporting custom metadata tags and multi-language prompts.
> Create files with your specified encoding
## 🌟 Core Features
- **Specify File Encoding** - Create files in UTF-8, GBK, Big5, and other encoding formats
- **Metadata Tags** - Customize metadata format in the first line of files
- **Multi-language Support** - Auto-adapt to Chinese/English interfaces
- **Encoding Verification** - Automatically detect file encoding after creation
- **Exclusive Mode** - Prevent accidental overwriting of existing files
- **Verbose Logging** - Optional verbose output mode
- **User Configuration** - Save preferences to config files
- **Author Information** - Add author attribution in metadata
- **Changelog** - View version update history
## 🚀 Installation
### Install via PyPI
```bash
pip install stv_create_file
Install from GitHub Source
git clone https://github.com/StarWindv/CreateFile-with-DesignatedEncoding.git
cd CreateFile-with-DesignatedEncoding
pip install .
🛠 Usage Guide
Basic Commands
create [file_path] [options]
nf [file_path] [options] # Short for newfile
newfile [file_path] [options] # Full command
Command Options
| Option | Shortcut | Default | Description |
|---|---|---|---|
--encoding |
-e |
utf-8 |
File encoding format |
--prefix |
-p |
# |
First line prefix |
--left-paren |
-l |
<| |
Left metadata tag |
--right-paren |
-r |
|> |
Right metadata tag |
--add-author |
-a |
'' |
Add author info in metadata |
--monopolize |
-m |
False |
Exclusive mode (prevent overwrite) |
--coding-check |
-cc |
False |
Verify encoding after creation |
--verbose |
-v |
False |
Verbose output mode |
--version |
-V |
- | Show version information |
--license |
- | Show project license | |
--whats-new |
- | Show program changelog | |
--set-language |
-sl |
Set prompt language (zh-cn/en-uk) |
Usage Examples
-
Create Basic File
create example.txt -
Specify File Encoding
nf data.csv -e gbk
-
Custom Metadata Format
newfile config.ini -p "// " -l "{{" -r "}}"
-
Create in Exclusive Mode
create important.log -m
-
Create and Verify Encoding
nf report.txt -e utf-8-sig -cc -v
-
Add Author Information
nf poem.txt -a "Li Bai"
-
View Changelog
newfile --whats-new latest
-
Switch to English Interface
create -sl english
Special Notes
-
Adding Newlines in Metadata Tags
nf test.txt -l "#n<| " -p ""
⚙️ Configuration File
Configuration path: ~/.stv_project/config.json
Default Configuration:
{
"lang": "zh-cn",
"verbose": false
}
Configurable Options:
lang: Interface language (zh-cn/en-uk)verbose: Enable verbose output by default
📂 Project Structure
CreateFile-with-DesignatedEncoding/
├── LICENSE
├── pyproject.toml
├── README.md
├── README.en.md
└── src/
└── stv_create_file/
├── core/
│ ├── __init__.py
│ ├── FileCreator.py # Core file creation logic
│ └── stv_parse.py # Command-line argument parsing
├── main.py # Program entry point
├── mul_lang/ # Multi-language support
│ ├── __init__.py
│ └── change_text.py
└── utils/
├── __init__.py
├── GetConfig.py # Configuration management
└── utils.py # Utility functions
📦 Dependencies
chardet- File encoding detection library
📜 License
This project is licensed under the MIT License
🤝 Contributing
Contributions via Issues or Pull Requests are welcome!
Project Repository: GitHub Repository
Metadata
Release files for stv-create-file 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stv_create_file-0.0.5.tar.gz | 14.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stv_create_file-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.3 kB
Release files / stv_create_file-0.0.5.tar.gz
| Download URL | stv_create_file-0.0.5.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79b2d9d8a69effe03b1318357ad9bee9a73774afead6eeb042ebda9e32f084fa
|
|
BLAKE2b-256 checksum How to use checksums |
f07a9355d478cc1bf9a5b6fd61ca0c1e484e487ff17b8a5111d40d76d0ac21a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / stv_create_file-0.0.5-py3-none-any.whl
| Download URL | stv_create_file-0.0.5-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e26096681c31e2bba191cb3127bff88f9b7dda5a7fe69255b1f3d0cecf7c786b
|
|
BLAKE2b-256 checksum How to use checksums |
5ccd371bc116b8736a8bbafbd2545dcf51e30c9669d090ff450872c318ea58c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|