{"id":22377260,"url":"https://github.com/csbiology/yamlicious","last_synced_at":"2025-07-30T23:32:02.256Z","repository":{"id":244207347,"uuid":"806612939","full_name":"CSBiology/YAMLicious","owner":"CSBiology","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-14T13:48:11.000Z","size":189,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-01T10:29:44.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CSBiology.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-27T14:31:45.000Z","updated_at":"2024-10-14T13:48:15.000Z","dependencies_parsed_at":"2024-06-24T10:44:20.916Z","dependency_job_id":null,"html_url":"https://github.com/CSBiology/YAMLicious","commit_stats":null,"previous_names":["csbiology/yamlicious"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSBiology%2FYAMLicious","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSBiology%2FYAMLicious/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSBiology%2FYAMLicious/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSBiology%2FYAMLicious/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CSBiology","download_url":"https://codeload.github.com/CSBiology/YAMLicious/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228198877,"owners_count":17883776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T22:13:24.849Z","updated_at":"2024-12-04T22:13:25.396Z","avatar_url":"https://github.com/CSBiology.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YAMLicious \n\n![NuGet Version](https://img.shields.io/nuget/v/YAMLicious?style=for-the-badge) ![NuGet Downloads](https://img.shields.io/nuget/dt/YAMLicious?style=for-the-badge)\n\n\n\nYAMLicious is a small YAML reader/writer inspired by [Thoth.Json](https://github.com/thoth-org/Thoth.Json) syntax!\n\n## Code examples\n\n### F# Model\n\n```fsharp\ntype Package = {\n    Name: string\n    Version: string option\n}\n\ntype ArcValidation = {\n    ArcSpecificationVersion: string\n    Packages: Package list\n}   \n```\n\n### YAML\n\n```yaml\narc_specification: 2.0.0-draft\nvalidation_packages:\n  - name: package1\n    version: 1.0.0\n  - name: package2\n    version: 2.0.0\n  - name: package3\n```\n\n### Decode (from YAML)\n\n```fsharp\n// from yaml\nlet Example1 = \n    \"arc_specification: 2.0.0-draft\nvalidation_packages:\n    - name: package1\n    version: 1.0.0\n    - name: package2\n    version: 2.0.0\n    - name: package3\"\n\nlet packageEncoder : (YAMLicious.YAMLElement -\u003e Package) = \n    Decode.object (fun get -\u003e\n        {\n            Name = get.Required.Field \"name\" Decode.string\n            Version = get.Optional.Field \"version\" Decode.string\n        }\n    )\n\nlet arcValidationDecoder : (YAMLicious.YAMLElement -\u003e ArcValidation) =\n    Decode.object (fun get -\u003e\n        {\n            ArcSpecificationVersion = get.Required.Field \"arc_specification\" Decode.string\n            Packages = get.Required.Field \"validation_packages\" (Decode.list packageEncoder)\n        }\n    )\n\nlet actual : ArcValidation = Examples.ValidationPackageTypes.string |\u003e Decode.read |\u003e arcValidationDecoder\n\n```\n\n### Encode (to YAML)\n\n```fsharp\n// to yaml\nlet Example2 = {\n    ArcSpecificationVersion = \"2.0.0-draft\"\n    Packages = [\n        { Name = \"package1\"; Version = Some \"1.0.0\" }\n        { Name = \"package2\"; Version = Some \"2.0.0\" }\n        { Name = \"package3\"; Version = None }\n    ]\n}\n\nlet packageEncoder (pack: Package) = \n    [\n        \"name\", Encode.string pack.Name\n        Encode.tryInclude \"version\" Encode.string pack.Version \n    ]\n    |\u003e Encode.choose\n    |\u003e Encode.object\n\nlet arcValidationEncoder (arc: ArcValidation) = \n    Encode.object [\n        \"arc_specification\", Encode.string arc.ArcSpecificationVersion\n        \"validation_packages\", Encode.list packageEncoder arc.Packages\n    ]\n\nlet actual : string = Encode.write 2 (arcValidationEncoder Example2)\n```\n\n\n---\n## Local Development\n\n### Requirements\n\nBecause this library targets multiple programming languages we need to support all of them:\n\n- [nodejs and npm](https://nodejs.org/en/download)\n    - verify with `node --version` (Tested with v20.10.0)\n    - verify with `npm --version` (Tested with v9.2.0)\n- [.NET SDK](https://dotnet.microsoft.com/en-us/download)\n    - verify with `dotnet --version` (Tested with 8.0.205)\n- [Python](https://www.python.org/downloads/)\n    - verify with `py --version` (Tested with 3.11.9, known to work only for \u003e=3.11)\n\n### Setup\n\nThis needs to be done on a fresh download once. Paths for python venv executable might be different depending on the OS.\n\n1. `dotnet tool restore`, Restore .NET tools (fable)\n2. `npm i`, install js dependencies\n3. `py -m venv ./.venv`, setup python virtual environment\n4. `.\\.venv\\Scripts\\Activate.ps1`, activate python virtual environment\n5. install python dependencies\n    1. `python -m pip install -U pip setuptools`\n    2. `python -m pip install poetry`\n    3. `python -m poetry install --no-root`\n\n### Testing\n\nFirst activate python virtual environment (`.\\.venv\\Scripts\\Activate.ps1`).\n\n`.\\build.cmd test`\n\n*or specify target*\n\n`.\\build.cmd test [f#, c#, js [native], py [native]]`\n\n### Publish\n\nRequires API keys for Nuget and PyPi. \n\nThe following command will run all tests, bundle and then start publishing!\n\n`.\\build.cmd publish pipeline`\n\n*or only publish specific targets, without test and bundle*\n\n`.\\build.cmd publish [npm, pypi, nuget]`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsbiology%2Fyamlicious","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsbiology%2Fyamlicious","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsbiology%2Fyamlicious/lists"}