WSON (Web Simple Object Notation)
Project description
WSON (Web Simple Object Notation)
WSON is a simple, readable data interchange format that combines the best features of JSON and YAML while addressing some of their limitations.
Features
| Feature | Status | Description |
|---|---|---|
| Syntax | Implemented | The basic syntax of WSON is implemented. |
| Comment Support (// and # styles) | Implemented | The ability to remove comments is implemented. |
| Original Formatting Preservation | Not Implemented | The functionality to preserve original formatting is not explicitly implemented. |
| Nested Objects and Arrays Support | Implemented | Capable of parsing and serializing nested objects and arrays. |
| String, Number, Boolean, and Null Handling | Implemented | Can handle various data types. |
| Date and Time Handling | Implemented | Supports parsing and serializing date and time values. |
| Version Handling | Implemented | Supports parsing and serializing version numbers as tuples. |
Language Support
| Language | Status | Badges |
|---|---|---|
| Python | Implemented | |
| JavaScript | Not Implemented | |
| Java | Not Implemented | |
| C# | Not Implemented | |
| Ruby | Not Implemented | |
| Go | Not Implemented | |
| C | Not Implemented | |
| C++ | Not Implemented | |
| PHP | Not Implemented |
Installation
You can install WSON using pip:
pip install wson
Usage
Here's a quick example of how to use WSON in your Python projects:
import wson
# WSON String
wson_data = """
{
status = "success",
code = 200,
message = "Data retrieved successfully",
user = {
id = 123,
name = "John Doe",
email = "john@example.com",
age = 25
},
tasks = [
{
task_id = 1,
title = "Complete project report",
status = "in-progress",
due_date = "2024-10-15"
},
{
task_id = 2,
title = "Review team feedback",
status = "pending",
due_date = "2024-10-20"
}
]
}
"""
# Parsing the WSON string into the Python dictionary
parsed_data = wson.loads(wson_data)
print("Parsed Data:")
print(parsed_data)
# Serialize Python dictionaries into WSON strings
wson_output = wson.dumps(parsed_data)
print("\nSerialized WSON:")
print(wson_output)
Why WSON?
WSON addresses some limitations of JSON and YAML:
- Unlike JSON, WSON supports comments, making it more readable and self-documenting.
- WSON has a simpler syntax compared to YAML, reducing the chance of indentation errors.
- WSON preserves the original formatting when possible, unlike JSON which often alters the structure.
- WSON is more concise than JSON, omitting unnecessary quotation marks for keys.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.
Links
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 wson-0.2.2.tar.gz.
File metadata
- Download URL: wson-0.2.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.2 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85bcc0867688fa6d1b3ae088bfa0eb3fd02ff21134c0fa5c07587c98cd4545f4
|
|
| MD5 |
4f122ef4c126adbfa37dc545ed0a9715
|
|
| BLAKE2b-256 |
2b89935a4c9e28d9b9fffa0631fb874d89b4f565000e51f363943a699c97772b
|
File details
Details for the file wson-0.2.2-py3-none-any.whl.
File metadata
- Download URL: wson-0.2.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.2 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e37567587da3e76c6e2a9e41fb45787dd7896b664c5628222dd5a27731316519
|
|
| MD5 |
93b7caf825f41b328aa8f39c0cc5946c
|
|
| BLAKE2b-256 |
a793db1733928a25f3364cd77f87973db592a559e962e0091ff145d6d528cf17
|