A Python library to convert YAML data to OpenStep plist format.
Project description
yaml_to_openstep_plist
A Python library to convert YAML data to OpenStep plist format.
Installation
Install the library using pip:
pip install yaml_to_openstep_plist
Usage
The library provides two main functions:
to_plist(yaml_data): Convert a Python object (parsed from YAML) to an OpenStep plist string.to_yaml_file(yaml_file_path, plist_file_path): Convert a YAML file to an OpenStep plist file.
Example
import yaml_to_openstep_plist
# Convert YAML file to OpenStep plist file
yaml_to_openstep_plist.to_yaml_file("input.yaml", "output.plist")
# Convert YAML data to OpenStep plist string
yaml_data = {
"surveyLocalizationEnableMapping": {
"todayAtApple": False,
"thankYou": False,
"account": True,
"theme": "dark",
"age": 30,
"score": 95.5,
"data": None
}
}
plist_string = yaml_to_openstep_plist.to_plist(yaml_data)
print(plist_string)
Input YAML Example
surveyLocalizationEnableMapping:
todayAtApple: false
thankYou: false
account: true
theme: dark
age: 30
score: 95.5
data: null
Output Plist Example
surveyLocalizationEnableMapping = {
todayAtApple = false;
thankYou = false;
account = true;
theme = "dark";
age = 30;
score = 95.5;
data = {};
};
Features
- Quotes strings on the right side of
=(e.g.,theme = "dark";). - Leaves numbers unquoted (e.g.,
age = 30;). - Uses
true/falsefor booleans. - Outputs
{}fornullvalues. - Single space after
=and 1-space indentation. - Supports nested dictionaries and top-level key-value pair formatting.
Requirements
- Python 3.6 or higher
- PyYAML (>=5.1)
License
MIT
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 yaml_to_openstep_plist-0.2.0.tar.gz.
File metadata
- Download URL: yaml_to_openstep_plist-0.2.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b9c83916c10c7050d065d958a3c047a3ba704452d027d5979def452a83f9c52
|
|
| MD5 |
79d9eb0feb3385b52f5d2356a56b5a86
|
|
| BLAKE2b-256 |
e3cb8c44160d0941123abd3e93706a7514346cacaaa3b031d4cfa2e79dd9dcf6
|
File details
Details for the file yaml_to_openstep_plist-0.2.0-py3-none-any.whl.
File metadata
- Download URL: yaml_to_openstep_plist-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0ff6948537e7334022cae57b37e57135d10d4d3c4c2b4f8ba23747eff833924
|
|
| MD5 |
b5df219c0cd925184fce2057328ccc43
|
|
| BLAKE2b-256 |
6e3001e29a5eb826b808c99480b962b5a9fe0a5fe2d5258149c2c4becba8137d
|