json2hive
json2hive is a command line utility that can automatically generate CREATE TABLE statements for Hive tables backed by JSON data.
Features
Automatically infer schema of JSON data by analysing JSON records
Supports external and managed Hive tables
Can be used as command line utility or programmatically
Installation
You can install json2hive using pip:
$ pip install json2hive
It is strongly recommended that you install json2hive inside a virtual environment!
Usage
On the Command Line
Run the following and follow the instructions:
$ json2hive --help
As a library
from json2hive.utils import infer_schema
from json2hive.generators import generate_json_table_statement
# infer schema from objects, these objects could be the result of json.loads(...)
object1 = {'name': 'John', age: 25}
object2 = {'name': 'Mary', age: 23}
schema = infer_schema([object1, object2])
# Generate CREATE TABLE statement
statement = generate_json_table_statement('example', schema, managed=True)
print(statement)
Metadata
Release files for json2hive 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| json2hive-0.1.tar.gz | 4.2 kB | Without provenance | Details for json2hive-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| json2hive-0.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for json2hive-0.1-py2.py3-none-any.whl |
Total release size: 10.5 kB
Release files / json2hive-0.1.tar.gz
| Download URL | json2hive-0.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bc07f9815fcc7f6c2b49a39bc174b0b99800991407bc48d2703d2b50e55d944
|
|
BLAKE2b-256 checksum How to use checksums |
85b8b8364f46a0f57053c6da41ce115a433eea4713877bcbcf4bb38469a21e07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / json2hive-0.1-py2.py3-none-any.whl
| Download URL | json2hive-0.1-py2.py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
abc15703215a21cd2b0cda15735506b8f28bbc26d558bee1458690c10ab8af37
|
|
BLAKE2b-256 checksum How to use checksums |
56db18edae4a92dc5a91ec00494ffaa2cceac130f39d486491a91deaee3eeec0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for json2hive 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.