Create New File with Customize Encoding
Project description
CreateFile with Designated Encoding ✨
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 Some File with Designated Encoding
🌟 Core Features
- Specify File Encoding - Create files with various encodings including UTF-8, GBK, Big5, etc.
- Metadata Tags - Customize metadata format in the first line of files
- Multi-language Support - Automatically adapts to English/Chinese interfaces
- Encoding Verification - Auto-detect file encoding after creation
- Exclusive Mode - Prevent accidental overwriting of existing files
- Verbose Logging - Optional detailed output mode
- User Configuration - Save preferences to config file
🚀 Installation
Install via PyPI
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 |
# |
File header prefix |
--left-paren |
-l |
<| |
Left metadata tag |
--right-paren |
-r |
|> |
Right metadata tag |
--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 info |
--license |
-lic |
- | Show project license |
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 with Encoding Verification
nf report.txt -e big5 -cc -v
⚙️ Configuration File
Configuration path: ~/.stv_project/config.json
Default Configuration:
{
"lang": "English",
"verbose": false
}
Configurable Items:
lang: Interface language (English/zh-cn)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 # File creation core logic
│ └── stv_parse.py # CLI argument parsing
├── main.py # Program entry point
├── mul_lang/
│ ├── __init__.py
│ └── change_text.py # Multi-language support
└── utils/
├── __init__.py
├── GetConfig.py # Configuration management
└── utils.py # Utility functions
📦 Dependencies
chardet- File encoding detection library
📜 License
This project is licensed under MIT License
🤝 Contribution Guidelines
Contributions via Issues or Pull Requests are welcome!
Project URL: GitHub Repository
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stv_create_file-0.0.1.tar.gz.
File metadata
- Download URL: stv_create_file-0.0.1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
790418b21ad5fc7fbb0d9ec7a38f77266e9d5414c2354dac0a9b3307cac619c9
|
|
| MD5 |
d75355699fefca69484f480187fa78d1
|
|
| BLAKE2b-256 |
b246aa0bbaea125e66c20de0aa15c1ad461c0dfb4aad3a8a2f784b64798e99a7
|
File details
Details for the file stv_create_file-0.0.1-py3-none-any.whl.
File metadata
- Download URL: stv_create_file-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
298bb2e255c27e390d2c975b16377aafd59f1e82537bc5896781dfa577afb0a1
|
|
| MD5 |
1fe971a5ee8bcef6a7524ce40426b3a2
|
|
| BLAKE2b-256 |
e9a534dbec4c4f858a34120194c720f5aec4c8d732725edb02b1f54f13db4c6a
|