-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPKG-INFO
More file actions
129 lines (99 loc) · 4.88 KB
/
Copy pathPKG-INFO
File metadata and controls
129 lines (99 loc) · 4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Metadata-Version: 2.4
Name: json2sql
Version: 0.1.0
Summary: Convert JSON files/datasets to SQL INSERT statements
Author: Revenue Holdings
License-Expression: MIT
Keywords: json,sql,etl,data-conversion,cli
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Database
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.0.0
Provides-Extra: license
Requires-Dist: revenueholdings-license>=0.1.0; extra == "license"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Dynamic: license-file
# json2sql
[](https://github.com/Coding-Dev-Tools/json2sql/stargazers)
Convert JSON files and datasets to SQL INSERT statements. Supports nested JSON, PostgreSQL, MySQL, and SQLite output dialects.
[](https://pypi.org/project/json2sql/)
[](https://pypi.org/project/json2sql/)
[](https://github.com/Coding-Dev-Tools/json2sql/blob/main/LICENSE)
**Why json2sql?** Moving data from JSON into a database should be one command, not a script you maintain. json2sql takes JSON files — flat or nested — and produces correct SQL INSERT statements in your dialect of choice. Nested objects are automatically flattened into relational tables. Arrays become multiple INSERT rows. Type inference handles strings, numbers, booleans, and nulls without configuration. Pipe data from stdin, specify the table name, and get clean SQL out. Zero dependencies beyond Python 3.10+ and the CLI.
## Installation
```bash
pip install json2sql
```
Or install directly from GitHub:
```bash
pip install git+https://github.com/Coding-Dev-Tools/json2sql.git
```
## Quick Start
```bash
# Basic usage — converts JSON to SQL INSERT statements
json2sql convert data.json
# Specify output dialect
json2sql convert data.json --dialect postgres
json2sql convert data.json --dialect mysql
json2sql convert data.json --dialect sqlite
# Specify output file
json2sql convert data.json -o output.sql
# Specify table name
json2sql convert data.json --table users
# Handle nested JSON (auto-flattens into relational tables)
json2sql convert nested_data.json --flatten
```
## Features
- **Nested JSON support**: Automatically flattens nested objects into separate relational tables
- **Multi-dialect output**: PostgreSQL, MySQL, SQLite INSERT syntax
- **Array of objects**: Handles JSON arrays as multiple INSERT rows
- **Type inference**: Auto-detects strings, numbers, booleans, nulls
- **Pipe support**: Read from stdin for pipeline usage
- **Zero dependencies**: Only Python 3.10+ required (typer for CLI)
## CI/CD Integration
```bash
# Generate SQL as part of a data pipeline
cat data.json | json2sql convert --dialect postgres --table events > events.sql
# Use in GitHub Actions to prepare test data
json2sql convert fixtures.json --dialect sqlite -o seed.sql
sqlite3 test.db < seed.sql
```
## Pricing
json2sql is one of eight tools in the Revenue Holdings suite. One license covers all CLI tools.
| Plan | Price | Best For |
|------|-------|----------|
| **Free** | $0 | Individual devs, OSS — CLI only, limited rows |
| **json2sql Individual** | **$9/mo** ($7 billed annually) | Professional devs — unlimited rows, batch processing |
| **Suite (all 8 tools)** | **$49/mo** ($39 billed annually) | Full Revenue Holdings toolkit — 40% savings |
| **Team** | **$79/mo** ($63 billed annually) | Up to 5 devs — API access, CI/CD integration, priority support |
| **Enterprise** | Custom | SSO, RBAC, compliance reports, dedicated support |
🔹 **No lock-in**: CLI works fully offline on the free tier — no telemetry, no phone-home.
🔹 **Annual billing**: Save 20%.
### Per-Tier Features
| Feature | Free | json2sql | Suite | Team | Enterprise |
|---------|:----:|:--------:|:-----:|:----:|:----------:|
| CLI: convert, pipe | ✓ | ✓ | ✓ | ✓ | ✓ |
| Unlimited rows per conversion | — | ✓ | ✓ | ✓ | ✓ |
| Batch processing | — | ✓ | ✓ | ✓ | ✓ |
| Schema generation | — | ✓ | ✓ | ✓ | ✓ |
| API access | — | — | — | ✓ | ✓ |
| Compliance reports | — | — | — | — | ✓ |
| RBAC | — | — | — | — | ✓ |
| SSO / SAML / OIDC | — | — | — | — | ✓ |
| Priority support | Community | 24h | 24h | 8h | Dedicated |
---
<p align="center">
<sub>Part of <a href="https://coding-dev-tools.github.io/revenueholdings.dev/">Revenue Holdings</a> — CLI tools built by autonomous AI.</sub>
</p>
## License
MIT