Skip to main content

Create New File with Customize Encoding

Project description

CreateFile with Designated Encoding ✨

License: MIT PyPI Version Python Versions

中文文档

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

  1. Create Basic File

    create example.txt
    
  2. Specify File Encoding

    nf data.csv -e gbk
    
  3. Custom Metadata Format

    newfile config.ini -p "// " -l "{{" -r "}}"
    
  4. Create in Exclusive Mode

    create important.log -m
    
  5. 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

stv_create_file-0.0.3.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stv_create_file-0.0.3-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file stv_create_file-0.0.3.tar.gz.

File metadata

  • Download URL: stv_create_file-0.0.3.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for stv_create_file-0.0.3.tar.gz
Algorithm Hash digest
SHA256 c6772047f4bc989d3b365620c19cc893c9756f3a80eccb8ecb5d3e76f35f30c0
MD5 aad3ae054650895a27f96f138ef4404f
BLAKE2b-256 54d4dcd74867de00e577e61dc5575745c49a7a3b9bca7aa79a929aecedd89080

See more details on using hashes here.

File details

Details for the file stv_create_file-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for stv_create_file-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a4429bc669941cd53b6173f644a9aa10b87fea3998b090b9f20400ec06089168
MD5 3055f386ee484de996477baac2f7b749
BLAKE2b-256 3d96c502e7ea67b7e50258b3056478f4dd8598f91e5a68767217c09d09a36f99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page