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.2.tar.gz (4.0 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.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for fac_format-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9b888986275c3a18aba3c421a0656f46d8049f7d779fdbfe1f3669170d57e9a6
MD5 6b066bbf6a227bf3ea70f655297b8c0b
BLAKE2b-256 aec353d9d07ee1fd86c9497b84ff6986adda779cba02b689a0bcee1444b52d41

See more details on using hashes here.

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

Hashes for fac_format-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cc9131582baf99883e107d52590e92e2961ff8f3f49d5fcffb2f3bd7545a5844
MD5 7703a565839ca4af6c6a357c56ada0b6
BLAKE2b-256 817961b98f8cf5fdd5470da5ccbaf19377bd922e2a62fffc598f90b459edb303

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