Skip to main content

No project description provided

Project description

cuddly_dicts

Turn a KDL document like this:

landtable version=1 {
    // Minimum compatible Landtable version
    ensure_landtable_version "0.0.1"
    
    provisioning {
        // Whether to allow runtime provisioning
        // (whether you can add/remove fields via the API or the web)
        allow_runtime_provisioning true
        
        // A provisioning strategy defines how a new database can be
        // created.
        strategy "Nest Postgres" {
            primary {
                using "postgres_provisioning_plugin"
                hostname "hackclub.app"
                
                authentication "userpass" {
                    username "sarah"
                    password "i_l0ve_hC!"
                }
                
                // or:
                
                authentication "vault-pg" {
                    path "database/creds/landtable"
                }
            }
        }
    }
}

Into a dict like this:

{
    "landtable": {
        "version": 1,
        "ensure_landtable_version": "0.0.1",
        "provisioning": {
            "allow_runtime_provisioning": True,
            "strategy": {
                "Nest Postgres": {
                    "primary": {
                        "using": "postgres_provisioning_plugin",
                        "hostname": "hackclub.app",
                        "authentication": {
                            "userpass": {
                                "username": "sarah",
                                "password": "i_l0ve_hC!"
                            }
                        }
                    }
                }
            }
        }
    }
}

Motivation

  • Keep using Landtable's existing validation library (Pydantic)
  • Support multiple configuration languages (TOML, JSON, YAML, whatever!) by making them all compile down to the same representation that can be validated

Conversion rules

  • KDL node -> dict result
  • landtable {} -> {"landtable": {}}.
  • version 1 -> {"version": 1}
    • Repeated version nodes will create a list.
      alias "High Seas"
      alias "hs"
      
      Will turn into {"alias": ["High Seas", "hs"]}
  • landtable version=1 {} -> {"landtable": {"version": 1}}
  • strategy "Nest Postgres" {} -> {"strategy": {"Nest Postgres": {}}}
    • Repeated strategy nodes will add another entry to the dict.

License

MIT or WTFPL, depending on how much of a prude you are

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

cuddly_dicts-1.0.0.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.

cuddly_dicts-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file cuddly_dicts-1.0.0.tar.gz.

File metadata

  • Download URL: cuddly_dicts-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cuddly_dicts-1.0.0.tar.gz
Algorithm Hash digest
SHA256 601b6a6a9fbd5aaa7f28a5d1b8d4020353c72234a09c87ca19d2931ea94eca0b
MD5 97df6a042f7c8b103373604f5abeeb37
BLAKE2b-256 4c9f8fd4a955ff2b4223dd61cfb6450e44adaaaeac89ec1cdc9653610d5b4e7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cuddly_dicts-1.0.0.tar.gz:

Publisher: workflow.yml on iamawatermelo/cuddly-dicts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cuddly_dicts-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cuddly_dicts-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cuddly_dicts-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36db7ffedec53cd5c2304e992d57fdc84b48a3f3cc5ddca3203cf68f4aaa5ec8
MD5 531bbbc1e539bcabc593d6ee0ad5895c
BLAKE2b-256 8da246addf3a6be99c5b8c9953683aae7e53d3704befa187d427ea1f3fb84b4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for cuddly_dicts-1.0.0-py3-none-any.whl:

Publisher: workflow.yml on iamawatermelo/cuddly-dicts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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