A simple Python library to convert between CSV, JSON, and Excel easily.
Project description
TableX
TableX is a simple and powerful Python library to seamlessly convert
between CSV, Excel, and JSON formats.
It also provides utilities like pretty-printing JSON,
flattening/unflattening JSON, and more.
Features
- 📑 Convert between CSV ↔ JSON ↔ Excel
- 🎯 Easy-to-use, minimal code required
- ⚡ Lightweight & fast
- 🛠️ Utility functions for JSON pretty printing and flattening
Installation
pip install tablex
Example Usage
from tablex import TableX
# ---------------- CSV <-> JSON ----------------
# Convert CSV → JSON
records = TableX.csv_to_json(
csv_file="students.csv",
json_file="students.json",
pretty=True,
indent=2
)
# Convert JSON → CSV
TableX.json_to_csv(
json_file="students.json",
csv_file="students_converted.csv"
)
# ---------------- Excel <-> JSON ----------------
# Convert Excel → JSON
records = TableX.excel_to_json(
excel_file="results.xlsx",
json_file="results.json",
sheet_name="result sheet",
pretty=True,
indent=4
)
# Convert JSON → Excel
TableX.json_to_excel(
json_file="results.json",
excel_file="results_converted.xlsx"
)
# ---------------- CSV <-> Excel ----------------
# Convert CSV → Excel
TableX.csv_to_excel(
csv_file="students.csv",
excel_file="students.xlsx"
)
# Convert Excel → CSV
TableX.excel_to_csv(
excel_file="results.xlsx",
csv_file="results_converted.csv",
sheet_name="result sheet"
)
# ---------------- Utility functions ----------------
# Pretty-print JSON file to console
TableX.pretty_print_json("students.json")
# Flatten JSON into a single dictionary (dot notation)
flat = TableX.flatten_json("students.json")
print(flat)
# Example: {"user.name": "Alice", "user.age": 25, "user.skills.0": "Python"}
# Unflatten dictionary back into JSON
unflat = TableX.unflatten_json(flat)
print(unflat)
# Example: {"user": {"name": "Alice", "age": 25, "skills": ["Python"]}}
License
MIT License © 2025
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tablexpy-0.1.0.tar.gz
(3.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tablexpy-0.1.0.tar.gz.
File metadata
- Download URL: tablexpy-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2961a146ed6500e42c2b63d194e6b17568e516b3c919679c85ab3c75078adf0
|
|
| MD5 |
d5a9e8625b9217a60988e1811d480645
|
|
| BLAKE2b-256 |
2e5dec64a69c20411de863b15d14e4d1958a10cc6f22b6a8a2f12e4336841d02
|
File details
Details for the file tablexpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tablexpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
024a0f73cd7f6325037dfd064aecd31598f6265972b26f0ecafb8f3908bd85a3
|
|
| MD5 |
4fe68eb0eb119ce2fb85efe294ca573f
|
|
| BLAKE2b-256 |
8ee29ce5c91b705e38e5900b4e7abc49f9e1821c8c96164f8ee499953c9ea956
|