Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ameygaikwad/csv-to-json-converter-using-python
Welcome to CSV-to-JSON-Converter-Using-Python, this Python script converts CSV (Comma-Separated Values) files to JSON (JavaScript Object Notation) files. It's designed for basic conversion and assumes well-formatted CSV files.
https://github.com/ameygaikwad/csv-to-json-converter-using-python
csv csv-converter csv-parser json json-converter json-schema python
Last synced: about 1 month ago
JSON representation
Welcome to CSV-to-JSON-Converter-Using-Python, this Python script converts CSV (Comma-Separated Values) files to JSON (JavaScript Object Notation) files. It's designed for basic conversion and assumes well-formatted CSV files.
- Host: GitHub
- URL: https://github.com/ameygaikwad/csv-to-json-converter-using-python
- Owner: AmeyGaikwad
- Created: 2024-05-31T10:31:22.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-06-18T15:04:56.000Z (8 months ago)
- Last Synced: 2024-10-31T03:42:14.025Z (3 months ago)
- Topics: csv, csv-converter, csv-parser, json, json-converter, json-schema, python
- Language: Python
- Homepage:
- Size: 80.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# CSV-to-JSON-Converter-Using-Python
Welcome to CSV-to-JSON-Converter-Using-Python, this Python script converts CSV (Comma-Separated Values) files to JSON (JavaScript Object Notation) files. It's designed for basic conversion and assumes well-formatted CSV files.
**Project Overview**
CSV-to-JSON-Converter-Using-Python enables you to convert CSV files, commonly used for tabular data, into JSON format. This conversion allows for better data management, analysis, and sharing.
**Features**
1. Exception Handling: CSV-to-JSON-Converter-Using-Python incorporates robust exception handling to ensure smooth data conversion.
2. Converts CSV data into a JSON object structure.
3. Handles basic CSV formatting, including headers as the first row.
4. Outputs the converted JSON data to a new file.
**How to Use**
1. Create a virtal enviornment and activate it.
```js
python -m venv pr-venv
```2. Install all the prereqesites from requirements.txt.
```js
pip install -r .\requirements.txt
```3. Edit .env file as per your requirement / Declare these enviornment variables as follows:
(Windows)
```js
$Env:SRC_BASE_DIR = 'data/retail_db'
$Env:TGT_BASE_DIR = 'data/retail_db_json'
```
4. Run app.py as per requirements.**Use Case**
This would convert all the csv files present in data/retail_db to json.
```js
python app.py
```To convert files specefic to dataset.
```js
python app.py '[\"orders\" ,\"depatment\", \"order_items\"]'
```
--This would convert files of only orders and order_items dataset to JSON files as there is a typo in departments hence proving exception handling.