This is my first module
Project description
Simple JSON Parser
A simple JSON parser implemented in Python without using any external libraries. This parser can handle a limited subset of JSON, including strings, numbers, objects, arrays, booleans, and null values.
Features
- Parses JSON strings into Python data structures (dictionaries and lists).
- Supports basic JSON data types: strings, numbers, objects, arrays, booleans, and null.
- No external dependencies; written entirely in Python.
Installation
You can simply copy the JSONParser class into your Python project. There is no need for installation via pip or any other package manager.
Usage
To use the JSON parser, create an instance of the JSONParser class with a JSON string and call the parse() method. Here's an example:
from json_parser import JSONParser # Adjust the import based on your file structure
json_text = '{"name": "John", "age": 30, "is_student": false, "courses": ["Math", "Science"], "address": null}'
parser = JSONParser(json_text)
parsed_data = parser.parse()
print(parsed_data)
Error Handling
The parser raises ValueError for various issues, such as:
Unexpected end of input Invalid JSON values Unterminated strings Missing colons or commas in objects and arrays
Limitations
This parser is a basic implementation and may not handle all edge cases or complex JSON structures. It does not support JSON features like comments or special escape sequences in strings.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gentleparserpy-1.0.0.tar.gz.
File metadata
- Download URL: gentleparserpy-1.0.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9966f60f516463761a6d3d28820703065e4457ef05aaf77df4e0b99d070555f
|
|
| MD5 |
65515aa646496e5551e8a1d7297b668b
|
|
| BLAKE2b-256 |
8a8b59174dd7fbaa158c8cdd136c2a385820c9e11f1c460719757278536c5b36
|
File details
Details for the file gentleParserPy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gentleParserPy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08a6865e8fb34cdd7180270402e9a400372a51d006856ee0ee7769448d909827
|
|
| MD5 |
7595977177630092c7da6fd8e12e23bd
|
|
| BLAKE2b-256 |
df8d1ae19824b2492b5b6c84ab3d2b60feebc59b9db3bbaa8aa1faedf77d429c
|