JSC2F: JSON SQL Cell to File
This module contains functions to save a JSON cell from a MySQL or Mariadb database to a file in a nice and easy to use format. It can also upload JSON files back to the database.
Installation
JSC2FF can be installed by cloning the github repo or from PyPi.
pip install jsc2f
CLI Usage Example
downloadwill save the JSON string from the SQL cell to a nicely formatted file for editing.uploadwill update the cell with the JSON file--whereis used as a selector:--where "id == 3"
# Download a cell to a file
jsc2f download \
--db-ip $database_ip \
--db-name $database_name \
--db-password $database_password \
--db-user $database_user \
--filename $file_path \
--table $table_name \
-column $column_name
# Upload a file to a cell
jsc2f upload \
--db-ip $database_ip \
--db-name $database_name \
--db-password $database_password \
--db-user $database_user \
--filename $file_path \
--table $table_name \
-column $column_name
# jsc2f --help
Usage: jsc2f [OPTIONS]
Upload/Download JSON SQL Cell from/to a local file
Options:
--where TEXT
--table TEXT [required]
--column TEXT [required]
--db-name TEXT [required]
--db-password TEXT [required]
--db-user TEXT [required]
--db-port INTEGER
--db-ip TEXT [required]
--filename TEXT [required]
--upload / --download Upload or download [required]
--help Show this message and exit.
Python Module Usage Example
import jsc2f.lib as jsc2f
# Get data from SQL cell and write it to JSON file
jsc2f.save_to_file(filename=filename, host=db_ip, user=db_user,
password=db_password, database=db_name, column=column,
table=table, where=where, port=db_port)
# Get JSON from file and write it to SQL cell
jsc2f.update_from_file(filename=filename, host=db_ip, user=db_user,
password=db_password, database=db_name,
column=column, table=table, where=where,
port=db_port)
Release files for jsc2f 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jsc2f-0.1.3.tar.gz | 3.0 kB | Details |
Release files / jsc2f-0.1.3.tar.gz
| Download URL | jsc2f-0.1.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b566d430c6fb7a71b8312f38bd2f919d5f2be9fe2cfbbe365dcccd352be40c1a
|
|
BLAKE2b-256 checksum How to use checksums |
8393607c72272608f2cfe57b386416e692eb411ad6223ed8b8eff786a44c6015
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/2.7.16
|