Questions tagged [python-jsons]

jsons is a third-party library used to simplify JSON serialization for user-defined classes in Python. DO NOT USE THIS TAG FOR GENERIC QUESTIONS ABOUT HANDLING JSON IN PYTHON. Use it only if your question is specifically about this library, documented at https://jsons.readthedocs.io. Otherwise, just tag [python] and [json] normally.

jsons FAQ from the official documentation: https://jsons.readthedocs.io/en/latest/faq.html

5 questions
1
vote
3 answers

How to create python nested dictionary from another nested dictionary

I want to create a nested dictionary from another nested dictionary using python . below is the sample json object which will be loaded as python object , and i'll need the output as another nested dict. { "latest": { "school": { …
defnoteg
  • 11
  • 3
1
vote
1 answer

How to recursively enrich json object with custom field using python jsons

I'm using jsons library and would like to add a custom serializer that for a given type adds a certain field. Naive example: def adjust(obj): if isinstance(obj, MyFoo): json = jsons.dump(obj) json['foo'] = "bar" return…
Krever
  • 1,371
  • 1
  • 13
  • 32
0
votes
1 answer

Posting JSON to Python API (created using flask)

I have below code where I am making an API using flask: from flask import Flask, request, jsonify import json app = Flask(__name__) @app.route('/post', methods=['GET','POST']) def post(): payload = request.data # return jsonify(data) #…
0
votes
0 answers

writing a python web client to access an API of an online supermarket

Suppose you are writing a python web client to access an API of an online supermarket. Given below are the API details. Base URL= http://host1.open.uom.lk:8080 This is the details of API method API endpoint Description 1. GET …
Ahmed
  • 1
0
votes
2 answers

Create JSON dynamically reading file from S3

I am working on AWS Glue and writing a a requests program to query Botify (with BQL). I need to have a json (requred for POST) which should be dynamically created with the queried fields. The fields that needs to be queried resides in a text file on…
marie20
  • 723
  • 11
  • 30