JSON Articles

Found 152 articles

How I can create Python class from JSON object?

Rajendra Dharmkar
Rajendra Dharmkar
Updated on 24-Mar-2026 1K+ Views

Creating Python classes from JSON objects can be accomplished using the python-jsonschema-objects library, which is built on top of jsonschema. This library provides automatic class-based binding to JSON schemas for use in Python. Installing the Required Library First, install the python-jsonschema-objects library ? pip install python-jsonschema-objects Defining a JSON Schema Let's start with a sample JSON schema that defines the structure of a Person object ? schema = '''{ "title": "Example Schema", "type": "object", "properties": { ...

Read More

How to convert Python date in JSON format?

Rajendra Dharmkar
Rajendra Dharmkar
Updated on 24-Mar-2026 3K+ Views

There is no standard JSON format for dates. However, the ISO 8601 format is widely accepted as it's human readable, sorts correctly, includes fractional seconds, and is compatible with most programming languages. Python provides several methods to convert dates to JSON-compatible ISO format. Using isoformat() Method The isoformat() method is the simplest way to convert a Python datetime object to ISO 8601 format ? from datetime import datetime my_date = datetime.now() print(my_date.isoformat()) 2018-01-02T22:08:12.510696 Using strftime() Method For more control over the output format, you can use the strftime() function ...

Read More

What are the differences between json and simplejson Python modules?

Rajendra Dharmkar
Rajendra Dharmkar
Updated on 24-Mar-2026 1K+ Views

Both json and simplejson are Python modules for working with JSON data, but they have key differences in availability, performance, and update frequency. What is json? The json module is part of Python's standard library since Python 2.6. It provides basic JSON encoding and decoding functionality ? import json data = {"name": "Alice", "age": 30, "city": "New York"} json_string = json.dumps(data) print(json_string) # Parse JSON back to Python object parsed_data = json.loads(json_string) print(parsed_data) {"name": "Alice", "age": 30, "city": "New York"} {'name': 'Alice', 'age': 30, 'city': 'New York'} What is ...

Read More

How to Convert String to JSON using Python?

Yaswanth Varma
Yaswanth Varma
Updated on 24-Mar-2026 3K+ Views

In this article, we are going to learn how to convert a string to JSON in Python. JSON is a lightweight data interchange format that is used to read and write, and store data. Usually, we receive JSON data in the form of a string. To process it using a Python program, we need to convert the JSON string into an object, which can be stored in Python dictionaries and lists. This conversion can be done by using functions provided by the Python JSON module. Using Python json.loads() Function The Python json.loads() function is used to convert ...

Read More

How to Install Bower on Ubuntu

Sharon Christine
Sharon Christine
Updated on 17-Mar-2026 1K+ Views

Bower is a package manager for web development that provides a standardized approach to front-end package management. It maintains and monitors all packages, checks for updates, and uses a manifest file called bower.json to track dependencies. This article explains how to install Bower on Ubuntu. Prerequisites To install Bower, you need Node.js and NPM pre-installed on your system. First, verify that Node.js is installed by checking its version: $ node -v The output should display the Node.js version: v6.9.2 Next, verify the NPM version: $ npm -v ...

Read More

Guide to Linux jq Command for JSON Processing

Bamdeb Ghosh
Bamdeb Ghosh
Updated on 17-Mar-2026 13K+ Views

JSON (JavaScript Object Notation) is a popular data format used for exchanging information between applications. It is lightweight and easy to understand. To process JSON data efficiently, Linux provides a command-line tool called jq. This powerful tool enables users to extract, manipulate, and transform JSON data with ease. With jq, users can quickly perform filtering, sorting, and selecting specific fields. Additionally, jq supports various output formats, making it easy to integrate with other command-line tools. Installation Before using jq, ensure it is installed on your system. jq can be installed using the Linux package manager. Ubuntu/Debian Installation ...

Read More

How to Fetch Data from JSON file and Display it in an HTML Table using jQuery?

Jaisshree
Jaisshree
Updated on 16-Mar-2026 3K+ Views

JSON (JavaScript Object Notation) is a lightweight data interchange format that has become the standard for transmitting data between servers and web applications. With jQuery, you can easily fetch data from a JSON file and dynamically display it in an HTML table, creating interactive and data-driven web pages. Syntax The primary jQuery method for fetching JSON data is − $.getJSON(url, data, success) Parameters − url − The URL of the JSON file or API endpoint from which to retrieve data. Can be relative or absolute. data (optional) − Additional data to send ...

Read More

How to Convert JSON to Excel in JavaScript?

Pankaj Kumar Bind
Pankaj Kumar Bind
Updated on 15-Mar-2026 3K+ Views

Converting JSON data to Excel format is a common requirement in web applications, especially for data export and reporting functionality. Excel files are widely used for data presentation and analysis, making JSON-to-Excel conversion essential for seamless data management. This article explores different methods to convert JSON data to Excel files using JavaScript, including library-based approaches and manual techniques. Approaches to Convert JSON to Excel in JavaScript Using the SheetJS (xlsx) library Manual HTML Table Export Exporting JSON to CSV format Using the SheetJS ...

Read More

Using data in JSON format in Snack

Saba Hilal
Saba Hilal
Updated on 15-Mar-2026 788 Views

There are many ways to use data with apps made with Snack Expo. Sometimes the data is stored as JSON (JavaScript Object Notation). In this format, data can be easily stored as key-value pairs and can also be converted to CSV files. This article demonstrates how to use JSON data in Snack using JavaScript, including reading JSON data and displaying it as a table, plus converting JSON to CSV format for download. Sample JSON Data Structure For our examples, we'll use a products.json file containing product information: { "products": [ ...

Read More

How to Convert XML to JSON String in JavaScript?

Pankaj Kumar Bind
Pankaj Kumar Bind
Updated on 15-Mar-2026 2K+ Views

Some popular formats for data exchange are XML (eXtensible Markup Language) and JSON (JavaScript Object Notation). Tags are used to structure XML, while JSON is a more condensed key-value format. In JavaScript apps, converting XML data to JSON is often required to facilitate data manipulation or integration with APIs that expect JSON format. Several techniques for converting XML to JSON using JavaScript are examined in this article, from using DOM parsing to employing custom JavaScript solutions. Understanding XML and JSON XML Example Pankaj 20 ...

Read More
Showing 1–10 of 152 articles
« Prev 1 2 3 4 5 16 Next »
Advertisements