Effortlessly convert between CSV and YAML formats using either a Python script or a command-line interface (CLI).
This repository provides two utilities for bi-directional conversions between CSV and YAML formats:
- Script-based Conversion: An interactive Python script that prompts the user to choose a conversion direction and then to provide the appropriate input and output file paths.
- CLI-based Conversion: A command-line utility that allows users to specify the conversion direction and file paths as arguments, offering a streamlined conversion process suitable for automation and batch processing.
- Clone the repository:
git clone https://github.com/javedali99/bi-directional-csv-yaml-converter.git cd csv-yaml-converter
- Python 3.8 or newer
- PyYAML package
-
Create a virtual environment:
python -m venv env source env/bin/activate # On Windows, use `env\Scripts\activate`
-
Install the required packages:
pip install PyYAML
-
Create a conda environment:
conda create --name csv_yaml_converter_env python=3.9
-
Activate the conda environment:
conda activate csv_yaml_converter_env
-
Install the required packages:
conda install -c conda-forge pyyaml
- Run the script:
python bi_directional_csv_yaml_script.py
- Follow the on-screen prompts to choose the conversion mode and provide file paths.
For CSV to YAML:
python bi_directional_csv_yaml_cli.py csv-to-yaml path_to_input.csv path_to_output.yaml
For YAML to CSV:
python bi_directional_csv_yaml_cli.py yaml-to-csv path_to_input.yaml path_to_output.csv
- Fork the repository on GitHub.
- Clone the forked repository and make the necessary changes.
- Push your changes to your GitHub repository.
- Submit a pull request, providing a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.