Questions tagged [json]

JSON (JavaScript Object Notation) aka the Fat Free Alternative to XML is a lightweight data exchange format inspired by JavaScript object literals. It is often used with JavaScript, Ajax, and RESTful web services but is completely language independent.

Filter by
Sorted by
Tagged with
3
votes
0answers
22 views

Fetching data from endpoint, retrieving coordinates, then merging into an output

I'm in no way a skilled developer (or even a developer at that!) but I did want to take a go at writing a script that fetched one endpoint's data, extracted some data, sent if off to be geocoded, then ...
0
votes
1answer
122 views

OOP Refactoring

The following script derives schemas from varied file formats. Can I get this reviewed? What would the improvements look like: ...
3
votes
2answers
82 views

Simple "schema validator" of JSON using JSON Patch (nlohmann:json)

Well, it's not actually a schema validator but anyway... Motivation I'm writing a library which is a UI to work with some electronics - modules. Each real module is represented by a corresponding ...
1
vote
2answers
99 views

Add a folder via JSON

I read about, that I only should have up to two parameters and a function should have about 10 lines. Now I am in trouble to achieve this. It is a Javascript/JSON thing in C#. I have too many ...
2
votes
0answers
10 views

Transform dataframe to a certain JSON format

I need to go from this dataframe: ...
2
votes
2answers
59 views

Using JavaScript, given a JSON value, recursively find all JSON objects, then sort keys in-place

Some background: JavaScript is not my primary language, so I'm looking to get some constructive criticism here. I built a tiny single page HTML app that pretty prints JSON text. It's very useful when ...
1
vote
1answer
169 views

Patch a JSON object using dynamic / ExpandoObject with System.Text.Json

Background Recently, I was making some updates to an "older" library that would handle PATCH-style modifications to an object that is persisted in a JSON format on our document-storage ...
1
vote
1answer
77 views

Copy vehicle information from JSON list to relational database

I am looking for suggestion to make my for loop iterate faster. With about 2000 rows of data. Below code is taking lot of time to run. So far I have followed various Stack Overflow answers. For ...
2
votes
2answers
93 views

OOP - Contact Form PHP Backend - Procedural to OOP - Dynamic MySQL Prepared Statement PHP

I just converted procedural code to OOP code. Is there any performance or security issue with this code or what should I consider further? interface ...
4
votes
1answer
45 views

Extracting domains and IPs from Exodus trackers JSON report

The following command series is used to gather every bit of valuable information from Exodus trackers. The ultimate goal would be to get this all into one jq ...
3
votes
0answers
125 views

Exception handling: using @JsonProperty value to make error message

If the validation in RestController fails, I need to handle MethodArgumentNotValidException and provide an errorMessage, that ...
2
votes
0answers
18 views

Python script to collect NWS gridpoint forecast data (JSON) and push it into MariaDB

This script is my first-ever attempt at writing anything in python. Though I have an electrical engineering background and therefore got a little programming education in college, it was fairly ...
3
votes
1answer
123 views

How to handle configuration from a config file and global variables transparently in python?

This is how I handle configuration in my python code, currently, but I guess it might look magic to people, and it is cumbersome to code. How can this be improved? Are there better solutions? The ...
1
vote
1answer
60 views

Read and display JSON results from Google Books API

I’m working with the Google Books API and I’m not so sure about the way I’m going to get the search data and return it to the user. I will describe the path here and I would like to know if you would ...
3
votes
1answer
40 views

Refactor Web Scraper

I wrote a simple Zoopla real estate scraper for just practicing what I learned so far in Python, Requests, BeautifulSoup and overall web scraping fundamentals. By looking at my code I feel like there ...
3
votes
1answer
133 views

Python script to parse XML file into Json

How are you doing? I have to make a script to parse an xml input file to a json file. I tried to do my best, but it will be nice if you could check it and help me to improve it. The idea is that I don'...
2
votes
1answer
52 views

Query the github api and filter the last 1000 commits which include and exclude certain words from the top 3 repositories in a given organization

This code should query the github api and filter, out of the last 1000 commits, which ones include and exclude certain words from the top 3 repositories in a given organization. For example, I could ...
-3
votes
1answer
42 views

Form a flat indexed array from a multidimensional result set [closed]

I want make my looped data into one flat array without associative keys. I have solved it with my code, but I think it is so crowded and not simple. This my code: ...
1
vote
2answers
104 views

Get data from JSON values

I have been working on where I want to improve my knowledge to do a safe JSON scraping. By that is that I could pretty much do a ugly workaround and wrap it into a try-except but that is not the case. ...
2
votes
1answer
91 views

Run python File With get request flask API

Code is Working Review and Recommend What Are Best Practice What I am trying to achieve. API with Flask that runs any python file from the current directory. Run the file and get output in JSON ...
0
votes
2answers
48 views

Verify application configuration from JSON file with matching type using TypeScript in an Angular project

To bootstrap our application we have a configuration stored in a JSON file. This config holds different settings, like definition of endpoints (e. g. an API or SMS gateway etc.) or some default values ...
3
votes
1answer
104 views

Bash Script for healthcheck linux

I have below bash script which i have written to check the health of different storage component and then creates an incident through service-now tool. This is script is working fine for me but i ...
7
votes
3answers
1k views

Python discord bot

So in my free time, I made a discord bot to play around with and learn a bit of python. I'm mainly a java developer. The bot has a few commands that allow it to find and output recipe for cocktails ...
6
votes
2answers
223 views

Flatten JSON to string

The code below is a Python module to flatten JSON-like structure (nested dictionaries and lists) to a single string. It also provides partial result in the form of flat list of strings. This ...
1
vote
1answer
45 views

A simple wrapper around fetch

I am writing a simple wrapper around fetch. ...
-1
votes
2answers
95 views

Best Practice: creating a nested associative array JSON in PHP

It's been a while I have been on here and I hope I still understand the rules😊. I have recently started learning PHP and WordPress for a Whatsapp Chatbot integration. I have created a webhook on my ...
0
votes
1answer
46 views

Make a loop faster when reading large text files

im developing a program that will read text files and convert it to JSON format dynamically. Users are able to input the key name and their respective digit to slice the index from a raw text file. ...
3
votes
1answer
88 views

HTML parser written in JavaScript that takes in strings and output a DOM tree object

I wrote an HTML parser in JavaScript, where it takes an a string that represents the HTML ...
4
votes
2answers
83 views

Housekeeping script improvements

I have built a housekeeping script and I would like to improve it. I have a JSON file with the details such as directory path, number of days after which the directory or file should be zipped, ...
1
vote
1answer
54 views

Generic Class for a GSON LinkedHashMap

I originally posted this on Stack overflow and was told to post it here, so here it is. Here's the stack overflow question: https://stackoverflow.com/questions/66528393/generic-class-for-a-gson-...
8
votes
2answers
173 views

JSON4 parser in Typescript

Context I may have accidentally gotten a little sidetracked during homeschooling, and wrote a JSON4 parser in Typescript during the down-time. This project started as an idea that I got while ...
1
vote
1answer
40 views

Populate database of web articles

What I have here is a relatively simple endpoint for a small site I'm making. Idea is to take: title content tags and create an entry in the database. It works properly. I threw this together as ...
0
votes
0answers
24 views

Optimized method of transfering numpy image arrays over localhost to web-tech UI for desktop UI

I have been doing testing to find the most efficient way to display numpy array images to a HTML, CSS, JS UI (specifically, with CEF Python). I mainly used the method explained here to do the numpy ...
3
votes
2answers
91 views

Web Scraping, Serializing and Deserializing in Python

I scraped data from a local .html page and the below code is working. I am a newbie to scraping, just tried with a simple HTML page. It takes 10 sec to complete execution and print data. If I did ...
0
votes
1answer
294 views

Is this a good way to download images from json Api?

In my SwiftUI app, I'm trying to get some data from a json Api and display this data along with an image. First I have a function that fetches the data from the Api, then I have another function that ...
2
votes
2answers
175 views

Getting metadata from MusicBrainz service

I've written a program which does the following things: calls third-party utility to get mp3 file fingerprint asks MusicBrainz IDs from AcoustID service asks metadata from MusicBrainz for each ID I'...
3
votes
1answer
70 views

C99 JSON parser/writer

About I've decided to challenge myself and write a JSON parser in C99 (i've written them in C++ before, but never in plain old C), and here's what I ended up with, it works well from what I've tried. ...
10
votes
1answer
1k views

Parsing overly complex JSON

The Merriam-Webster Dictionary API at some point discontinued the use of XML in favor of exclusively returning JSON. This had the unfortunate effect of making finding a definition listed by sense ...
4
votes
1answer
62 views

Geocoding addresses from a SAP database

I'm new to python and curious if this is the most efficient way to read addresses from a SAP database, geocode them, read the results, and then write the information back to the database. Everything ...
1
vote
1answer
42 views

Transform Data from JSON and CSV to another JSON format

I have 2 files wholesaler_a.csv ...
1
vote
0answers
81 views

Command line utility for user data migration from MUBI.com to letterboxd.com

Please make code review for command line utility for user data migration from MUBI.com to letterboxd.com. Utility makes Get HTTP request downloads json-data, parses it and saves as CSV-file. Can be ...
6
votes
3answers
80 views

JS function to initialize properties

I have some JavaScript code to manage a 2D map in a game. I have a function to create a new room in the map which is at map[x][y]. I need to create that property ...
6
votes
1answer
421 views

Parsing a JSON one line at a time in Python

happy 2021 everyone! I started coding some months ago for fun and recently I challenged myself to build a JSON parser in Python (v3.8). The basic idea was to avoid loading the whole file at once, ...
2
votes
2answers
92 views

API response json to C# object

So I got kind of a weird format returned from the api I'm calling it's the following: ...
0
votes
1answer
86 views

Unity Static Singleton JSON Serialisation

I have a static PlayerData singleton which stores all the data for the player (gold, upgrades, heroes etc) but JsonUtility ...
2
votes
1answer
78 views

Modify original JSON few times and post http request

Follow up question from here. I am working on a project where I need to do below things in Python: Take few input parameters like - environmentName, ...
2
votes
2answers
177 views

Pretty print directory structure in a JSON recursively

I am trying to pretty print the directory structure defined in a JSON. I do have a solution using recursion but I'm looking for feedback on how this solution can be ...
9
votes
1answer
266 views

Post json using http and verify whether all actions completed successfully or not

I am working on a project where I need to work with http apis and call them using Python language. Below is what I need to do: Take few input parameters like - <...
2
votes
1answer
46 views

Program efficiency vs user experience. Python Ancestor app

Bit of a basic question but I was creating a ancestor/family tree app thingy (haven't really worked out the details) and I wrote a small start-up program (seen below) which checks the AppData ...
5
votes
1answer
595 views

AJAX with Vanilla Node.js/JavaScript – POST JSON without a form

I am new to node.js, ajax, and asynchronous code. I’ve pieced together a working way to exchange json between browser and server and am wondering if someone with more experience considers the approach ...

1
2 3 4 5
17