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.2.tar.gz (12.5 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.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for stv_create_file-0.0.2.tar.gz
Algorithm Hash digest
SHA256 69e12cdd16ba76880d0941ba394d0582892ed91d063e049a5bd36c9fdf88a10a
MD5 59e70c25fd806eff329a63175565bb5e
BLAKE2b-256 616c3dc96a4fe7f62e4a83f34e4bc4abc3630779f6e81b5cfce0526629633d94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stv_create_file-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 202711516ab107ab6d44ba1703b8f421f0772541648267fcf70d3a9bbf18715d
MD5 9b16d5d03d754ad3fa8103a43f0eae3d
BLAKE2b-256 29d10a81c505f33e237d96eb578b53646d8fc9a56a485d9e0d6654b5e7db90e9

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