Skip to main content

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:

  1. Files must start with @begin/format@ and end with @end/format@
  2. Comments use \note prefix
  3. Values are declared using:
    @value|key_name
    /content\|type|value
    
  4. Lists are declared using:
    @list|list_name
    |item\value1
    |item\value2
    /end\list
    
  5. 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|true or |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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fac_format-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fac_format-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file fac_format-0.1.1.tar.gz.

File metadata

  • Download URL: fac_format-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.10

File hashes

Hashes for fac_format-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c2c3bd2d3212dd2be130ff0474d864fd1e2515bb9684d6bc1485e8626682396b
MD5 f6bac83c64d848b13c0960b9ad6c17e1
BLAKE2b-256 9fce40a314118cd2b495b373b273423d149dc44ae5c5a8cd0a2481a200c269d1

See more details on using hashes here.

File details

Details for the file fac_format-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fac_format-0.1.1-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

Hashes for fac_format-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f04d9627a0c9da02c6297b78012e5271cb3682013b7a39b6ace8dd8a0bf6406a
MD5 8088bb0c20abe9d95a403fcfdeeb188b
BLAKE2b-256 37143426bbb63299dd98a808809c4ff3e18b2c75c489cf2771afe51ff2a9c137

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page