# Shiftify
Shiftify is a versatile Python package that provides efficient tools for converting data between a wide variety of formats. Whether your source data is in CSV or JSON format, Shiftify offers a comprehensive set of conversion tools—including SQL, HTML, plain text, YAML, XML, TSV, TOML, NDJSON, Excel, Markdown, binary (via pickle), and INI formats. It is designed to handle large files efficiently through streaming.
## Features
### CSV Conversions
- **CSV to JSON**: Convert CSV files into JSON arrays.
- **CSV to SQL**: Generate SQL `INSERT` statements from CSV rows.
- **CSV to HTML**: Create an HTML table representation of CSV data.
- **CSV to Plain Text**: Write each CSV row as a pretty‐printed JSON string on a new line.
- **CSV to YAML**: Convert CSV files to YAML (with optional key wrapping).
- **CSV to XML**: Convert CSV rows to XML where each row is an `<Item>` element.
- **CSV to TSV**: Transform CSV files into tab-separated values.
- **CSV to TOML**: Convert CSV rows to TOML format.
- **CSV to NDJSON**: Generate newline-delimited JSON (NDJSON) from CSV rows.
- **CSV to Excel**: Convert CSV files into Excel spreadsheets.
- **CSV to Markdown Table**: Create Markdown formatted tables from CSV data.
- **CSV to Binary**: Serialize CSV rows into a binary file using pickle.
- **CSV to INI**: Convert CSV data into an INI file, storing each row as a separate section.
### JSON Conversions
- **JSON to CSV**: Convert JSON arrays into CSV format.
- **JSON to SQL**: Generate SQL `INSERT` statements from JSON objects.
- **JSON to HTML**: Create an HTML table representation of JSON data.
- **JSON to Plain Text**: Write each JSON object as a pretty‐printed string on a new line.
- **JSON to YAML**: Convert JSON arrays to YAML (with optional key wrapping).
- **JSON to XML**: Convert JSON arrays to XML where each object is an `<Item>` element.
- **JSON to TSV**: Transform JSON data into TSV format.
- **JSON to TOML**: Convert JSON arrays to TOML format.
- **JSON to NDJSON**: Generate newline-delimited JSON (NDJSON) from JSON objects.
- **JSON to Excel**: Convert JSON arrays into Excel spreadsheets.
- **JSON to Markdown Table**: Create Markdown tables from JSON data.
- **JSON to Binary**: Serialize JSON objects into a binary file using pickle.
- **JSON to INI**: Convert JSON arrays into an INI file, storing each object as a separate section.
## Installation
To install Shiftify, run the following command in your terminal:
```bash
pip install Shiftify
```
## Usage
Shiftify provides two main classes—CSV and JSON—that handle conversions from CSV and JSON files respectively. (Will roll out new formats soon)
Using the CSV Class
```python
from shiftify import CSV
# Initialize the CSV converter with your CSV file
csv_converter = CSV('path/to/your/input.csv')
# Convert CSV to JSON
csv_converter.to_json('path/to/your/output.json')
# Convert CSV to SQL (and save the SQL statements to a file)
csv_converter.to_sql('path/to/your/output.sql', table_name="my_table")
# Convert CSV to HTML table
csv_converter.to_html('path/to/your/output.html')
# Convert CSV to YAML (with optional key wrapping)
csv_converter.to_yaml('path/to/your/output.yaml', key="record")
# Convert CSV to XML with a custom root element
csv_converter.to_xml('path/to/your/output.xml', root_element="Data")
# Other conversions include:
# to_text, to_tsv, to_toml, to_ndjson, to_excel, to_markdown_table, to_binary, and to_ini.
```
Using the JSON Class
```python
from shiftify import JSON
# Initialize the JSON converter with your JSON file
json_converter = JSON('path/to/your/input.json')
# Convert JSON to CSV
json_converter.to_csv('path/to/your/output.csv')
# Convert JSON to SQL statements
json_converter.to_sql('path/to/your/output.sql', table_name="my_table")
# Convert JSON to HTML table
json_converter.to_html('path/to/your/output.html')
# Convert JSON to YAML (with optional key wrapping)
json_converter.to_yaml('path/to/your/output.yaml', key="record")
# Convert JSON to XML with a custom root element
json_converter.to_xml('path/to/your/output.xml', root_element="Data")
# Other conversions include:
# to_text, to_tsv, to_toml, to_ndjson, to_excel, to_markdown_table, to_binary, and to_ini.
```
## Customizing Options
For CSV-to-JSON (or vice versa) conversions, you can customize options such as delimiters and quote characters. For example:
```python
from shiftify import JSON
json_converter = JSON('path/to/your/input.json')
# Use a semicolon as delimiter and a single quote as quotechar when converting to CSV
json_converter.to_csv('path/to/your/output.csv', delimiter=';', quotechar="'")
```
# Contributing
Contributions to Shiftify are welcome! Please feel free to fork the repository, make your improvements, and submit a pull request. Whether you're fixing bugs, adding new conversion formats, or improving the documentation, your help is appreciated.
# License
This project is licensed under the MIT License - see the LICENSE file for details.
Raw data
{
"_id": null,
"home_page": "http://github.com/abdulrafey38/shiftify",
"name": "Shiftify",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "CSV, JSON, conversion, data transformation, file format, convert CSV to JSON, convert JSON to CSV, data interchange, CSV converter, JSON converter, data conversion, format switcher",
"author": "Abdul Rafey",
"author_email": "abdulrafey38@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7b/62/408131c8137ec4dc77ec3dca1b2c705d70e53279636bc9c9513412b369b1/shiftify-0.1.3.tar.gz",
"platform": null,
"description": "# Shiftify\n\nShiftify is a versatile Python package that provides efficient tools for converting data between a wide variety of formats. Whether your source data is in CSV or JSON format, Shiftify offers a comprehensive set of conversion tools\u2014including SQL, HTML, plain text, YAML, XML, TSV, TOML, NDJSON, Excel, Markdown, binary (via pickle), and INI formats. It is designed to handle large files efficiently through streaming.\n\n## Features\n\n### CSV Conversions\n- **CSV to JSON**: Convert CSV files into JSON arrays.\n- **CSV to SQL**: Generate SQL `INSERT` statements from CSV rows.\n- **CSV to HTML**: Create an HTML table representation of CSV data.\n- **CSV to Plain Text**: Write each CSV row as a pretty\u2010printed JSON string on a new line.\n- **CSV to YAML**: Convert CSV files to YAML (with optional key wrapping).\n- **CSV to XML**: Convert CSV rows to XML where each row is an `<Item>` element.\n- **CSV to TSV**: Transform CSV files into tab-separated values.\n- **CSV to TOML**: Convert CSV rows to TOML format.\n- **CSV to NDJSON**: Generate newline-delimited JSON (NDJSON) from CSV rows.\n- **CSV to Excel**: Convert CSV files into Excel spreadsheets.\n- **CSV to Markdown Table**: Create Markdown formatted tables from CSV data.\n- **CSV to Binary**: Serialize CSV rows into a binary file using pickle.\n- **CSV to INI**: Convert CSV data into an INI file, storing each row as a separate section.\n\n### JSON Conversions\n- **JSON to CSV**: Convert JSON arrays into CSV format.\n- **JSON to SQL**: Generate SQL `INSERT` statements from JSON objects.\n- **JSON to HTML**: Create an HTML table representation of JSON data.\n- **JSON to Plain Text**: Write each JSON object as a pretty\u2010printed string on a new line.\n- **JSON to YAML**: Convert JSON arrays to YAML (with optional key wrapping).\n- **JSON to XML**: Convert JSON arrays to XML where each object is an `<Item>` element.\n- **JSON to TSV**: Transform JSON data into TSV format.\n- **JSON to TOML**: Convert JSON arrays to TOML format.\n- **JSON to NDJSON**: Generate newline-delimited JSON (NDJSON) from JSON objects.\n- **JSON to Excel**: Convert JSON arrays into Excel spreadsheets.\n- **JSON to Markdown Table**: Create Markdown tables from JSON data.\n- **JSON to Binary**: Serialize JSON objects into a binary file using pickle.\n- **JSON to INI**: Convert JSON arrays into an INI file, storing each object as a separate section.\n\n## Installation\n\nTo install Shiftify, run the following command in your terminal:\n\n```bash\npip install Shiftify\n```\n\n## Usage\n\nShiftify provides two main classes\u2014CSV and JSON\u2014that handle conversions from CSV and JSON files respectively. (Will roll out new formats soon)\n\nUsing the CSV Class\n\n```python\nfrom shiftify import CSV\n\n# Initialize the CSV converter with your CSV file\ncsv_converter = CSV('path/to/your/input.csv')\n\n# Convert CSV to JSON\ncsv_converter.to_json('path/to/your/output.json')\n\n# Convert CSV to SQL (and save the SQL statements to a file)\ncsv_converter.to_sql('path/to/your/output.sql', table_name=\"my_table\")\n\n# Convert CSV to HTML table\ncsv_converter.to_html('path/to/your/output.html')\n\n# Convert CSV to YAML (with optional key wrapping)\ncsv_converter.to_yaml('path/to/your/output.yaml', key=\"record\")\n\n# Convert CSV to XML with a custom root element\ncsv_converter.to_xml('path/to/your/output.xml', root_element=\"Data\")\n\n# Other conversions include:\n# to_text, to_tsv, to_toml, to_ndjson, to_excel, to_markdown_table, to_binary, and to_ini.\n```\n\nUsing the JSON Class\n\n```python\nfrom shiftify import JSON\n\n# Initialize the JSON converter with your JSON file\njson_converter = JSON('path/to/your/input.json')\n\n# Convert JSON to CSV\njson_converter.to_csv('path/to/your/output.csv')\n\n# Convert JSON to SQL statements\njson_converter.to_sql('path/to/your/output.sql', table_name=\"my_table\")\n\n# Convert JSON to HTML table\njson_converter.to_html('path/to/your/output.html')\n\n# Convert JSON to YAML (with optional key wrapping)\njson_converter.to_yaml('path/to/your/output.yaml', key=\"record\")\n\n# Convert JSON to XML with a custom root element\njson_converter.to_xml('path/to/your/output.xml', root_element=\"Data\")\n\n# Other conversions include:\n# to_text, to_tsv, to_toml, to_ndjson, to_excel, to_markdown_table, to_binary, and to_ini.\n```\n\n\n## Customizing Options\n\nFor CSV-to-JSON (or vice versa) conversions, you can customize options such as delimiters and quote characters. For example:\n\n```python\nfrom shiftify import JSON\n\njson_converter = JSON('path/to/your/input.json')\n# Use a semicolon as delimiter and a single quote as quotechar when converting to CSV\njson_converter.to_csv('path/to/your/output.csv', delimiter=';', quotechar=\"'\")\n```\n\n# Contributing\nContributions to Shiftify are welcome! Please feel free to fork the repository, make your improvements, and submit a pull request. Whether you're fixing bugs, adding new conversion formats, or improving the documentation, your help is appreciated.\n\n# License\nThis project is licensed under the MIT License - see the LICENSE file for details.\n",
"bugtrack_url": null,
"license": null,
"summary": "A simple utility for converting formats to different and vice versa.",
"version": "0.1.3",
"project_urls": {
"Homepage": "http://github.com/abdulrafey38/shiftify"
},
"split_keywords": [
"csv",
" json",
" conversion",
" data transformation",
" file format",
" convert csv to json",
" convert json to csv",
" data interchange",
" csv converter",
" json converter",
" data conversion",
" format switcher"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7b62408131c8137ec4dc77ec3dca1b2c705d70e53279636bc9c9513412b369b1",
"md5": "66523ca77a494a447cb48067cf358342",
"sha256": "d9a53be3f7a9bb125426e19b537278bdba4280c3cb2769915fbbc56da0e98d0b"
},
"downloads": -1,
"filename": "shiftify-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "66523ca77a494a447cb48067cf358342",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10837,
"upload_time": "2025-02-02T19:16:44",
"upload_time_iso_8601": "2025-02-02T19:16:44.040710Z",
"url": "https://files.pythonhosted.org/packages/7b/62/408131c8137ec4dc77ec3dca1b2c705d70e53279636bc9c9513412b369b1/shiftify-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-02 19:16:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "abdulrafey38",
"github_project": "shiftify",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pyyaml",
"specs": []
},
{
"name": "openpyxl",
"specs": []
},
{
"name": "toml",
"specs": []
}
],
"lcname": "shiftify"
}