Skip to main content

ssjson is JSON based python library with various json operation

Project description

SSJSON

ssjson is JSON based python library with various json operation

USAGE

#creating file
conn = ssjson.connect("testing")

#creating json
conn.create([{'name':'','age':''}])

#inserting data into json
conn.insert({'name':'abcd','age':'2345'})

#renaming data in json
conn.alter_rename_column('name','full_name')

#adding key in json
conn.alter_add_column('height')

#removing a key
conn.delete('height')

#updating key with value
conn.update_with_where({'full_name':'hello world','age':'22'},{'age':'2345'})

#select and print multiple keys
conn.select_multiple(['full_name','age'])

#selecting multiple keyc with condition
conn.select_multiple_with_where(['full_name','age'],{'age':'22','full_name':'hello world'})

#selecting all data with condition
conn.select_all_with_where({'full_name':'hello'})

##printing all data
conn.select_all()

USAGE Using SQL

Below is the SQL query for all the operation happened above

conn = ssjson.connect("testfile")

query="create table tablename(id text , name text , dob text)"
conn.execute(query)

query="INSERT INTO tablename (full_name,dob) valuesss(Bud,22);"
conn.execute(query)

query="ALTER TABLE table_name RENAME COLUMN full_name TO name;"
conn.execute(query)

query="ALTER TABLE table_name ADD COLUMN code;"
conn.execute(query)

query="ALTER TABLE table_name DROP COLUMN code;"
conn.execute(query)

query="UPDATE tablename set dob=23,name=sand where name=Bud"
conn.execute(query)

query="select id,name,dob from tablename"
conn.execute(query)

query="select id,name from tablename where name=sand"
conn.execute(query)

query="select * from tablename where name=sand"
conn.execute(query)

query="select * from tablename"
conn.execute(query)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssjson-1.0.15.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

ssjson-1.0.15-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page