Skip to main content

CLI tool to execute and format code output in txt, docx, or LaTeX formats

Project description

🧾 Code Formatter CLI

A simple command-line tool to generate well-formatted experiment reports from your code in Python, C, C++, or Java, along with its compiled output.
Built out of absolute laziness and the compulsion to save time and focus on the really important work at hand (writing the code).

Output formats include: DOCX, LaTeX and Plain Text. (In the order of usage priority)


✨ Features

  • ✅ Supports Python, C, C++, and Java code
  • 📄 Formats the code and its output into:
    • Microsoft Word (.docx)
    • Plain text (.txt)
    • LaTeX (.tex)
  • 🧠 Custom metadata:
    • Student Name
    • Class
    • Roll Number
    • Experiment Number

📦 Installation

  1. Clone the git repository

    git clone https://github.com/yourusername/code-formatter-cli.git
    cd code-formatter-cli
    pip install .
    
  2. Install the required dependencies:

    pip install -r requirements.txt
    

🚀 Usage

    formatcode \
    --file sample.py \
    --lang python \
    --format docx \
    --name "Alice Doe" \
    --class_ "Your class name" \
    --roll "Your Roll Number" \
    --expno "Experiment Number"

--file: Path to the source code file

--lang: Programming language (python, c, cpp, java)

--format: Output format (docx, txt, latex)

--name, --class_, --roll, --expno: Student details


Output Examples

Name: Alice Doe              Class: SE-A            Roll No: 42

                EXPERIMENT 03

Code:
[Code block here]

Output:
[Compiled output here]

Contributions

Contributions are welcome! If you'd like to contribute, please:

  1. Fork the repository.

  2. Create a feature branch:

    git checkout -b feature-name
    
  3. Commit your changes:

    git commit -m "Add feature description"
    
  4. Push to your forked repository and create a pull request.


Contact

If you have any questions or suggestions, feel free to reach out:

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

code_formatter_cli-1.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

code_formatter_cli-1.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file code_formatter_cli-1.1.0.tar.gz.

File metadata

  • Download URL: code_formatter_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for code_formatter_cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 bcdb5e5842b9f34eaa45c3865994ee2dd0b187ac205ce4b37a130f3eff111961
MD5 91ef9c7004cf6eac6862b297a1d8e4fb
BLAKE2b-256 014cec6c285762e082b7b215bb4a3586cd5008b3158483b88ead20777bd015f5

See more details on using hashes here.

File details

Details for the file code_formatter_cli-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for code_formatter_cli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dbccda5255ab9f3d83ec05670f9211f4df759708786746f2b121dc6c4169f8e
MD5 86ef0029917ce4c6cc84c044566fa873
BLAKE2b-256 06716e0ba1d4bf580133d7b825f86973d32c313882206e48bbf780ccc6f6033a

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