A deliberately complicated and inefficient file format alternative to JSON
Project description
FAC Format - A Deliberately Complicated File Format
FAC (Frustratingly Awful Configuration) is an intentionally complicated and inefficient alternative to JSON. It's designed to be hard to read, write, and parse - because sometimes we need to appreciate how good we have it with JSON!
Features
- ❌ Not human-readable (by design!)
- ❌ Unnecessarily complex syntax
- ❌ Deliberately verbose
- ✅ Python parser included
- ✅ Converts to/from Python dictionaries
Installation
pip install fac-format
Usage
Writing FAC Files
from fac_parser import FacWriter
data = {
"name": "John Doe",
"age": 30,
"hobbies": ["reading", "coding"]
}
writer = FacWriter()
fac_content = writer.write(data)
with open('output.fac', 'w') as f:
f.write(fac_content)
Reading FAC Files
from fac_parser import FacParser
with open('input.fac', 'r') as f:
content = f.read()
parser = FacParser()
data = parser.parse(content)
File Format Specification
FAC uses a unique and deliberately complicated syntax:
- Files must start with
@begin/format@and end with@end/format@ - Comments use
\noteprefix - Values are declared using:
@value|key_name /content\|type|value - Lists are declared using:
@list|list_name |item\value1 |item\value2 /end\list - Objects are declared using:
@object|object_name @value|nested_key /content\|type|value /end\object
Data Types
- Text:
|text|value - Numbers:
|number|value - Booleans:
|boolean|trueor|boolean|false
Example FAC File
@begin/format@
\note this is a sample FAC file
@value|name
/content\|text|John Doe
@value|age
/content\|number|30
@list|hobbies
|item\reading
|item\coding
/end\list
@object|address
@value|street
/content\|text|123 Main St
/end\object
@end/format@
Why Use FAC?
You probably shouldn't! This format was created as a demonstration of how not to design a data format. It serves as an educational tool to appreciate the elegance and simplicity of formats like JSON, YAML, and TOML.
Contributing
If you want to make FAC even worse (or better at being worse), feel free to contribute! Just remember: the more complicated and frustrating, the better.
License
MIT License - Because even bad ideas should be free to share!
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 fac_format-0.1.2.tar.gz.
File metadata
- Download URL: fac_format-0.1.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b888986275c3a18aba3c421a0656f46d8049f7d779fdbfe1f3669170d57e9a6
|
|
| MD5 |
6b066bbf6a227bf3ea70f655297b8c0b
|
|
| BLAKE2b-256 |
aec353d9d07ee1fd86c9497b84ff6986adda779cba02b689a0bcee1444b52d41
|
File details
Details for the file fac_format-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fac_format-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc9131582baf99883e107d52590e92e2961ff8f3f49d5fcffb2f3bd7545a5844
|
|
| MD5 |
7703a565839ca4af6c6a357c56ada0b6
|
|
| BLAKE2b-256 |
817961b98f8cf5fdd5470da5ccbaf19377bd922e2a62fffc598f90b459edb303
|