{"id":32596170,"url":"https://github.com/cwtools/cwtools","last_synced_at":"2025-10-30T04:57:55.326Z","repository":{"id":43376535,"uuid":"108912521","full_name":"cwtools/cwtools","owner":"cwtools","description":"A library for parsing, editing, and validating Paradox Interactive script files.","archived":false,"fork":false,"pushed_at":"2025-10-04T10:56:34.000Z","size":72820,"stargazers_count":125,"open_issues_count":43,"forks_count":32,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-10-04T12:29:21.489Z","etag":null,"topics":["crusaders-kings-2","europa-universalis-4","hearts-of-iron-4","paradox","paradox-interactive","stellaris"],"latest_commit_sha":null,"homepage":"https://cwtools.github.io/","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cwtools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-10-30T21:52:37.000Z","updated_at":"2025-10-04T10:56:43.000Z","dependencies_parsed_at":"2025-07-10T10:48:17.628Z","dependency_job_id":"81705c0e-85d5-4bb8-a41e-88ff3ed78f4b","html_url":"https://github.com/cwtools/cwtools","commit_stats":null,"previous_names":["tboby/cwtools"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/cwtools/cwtools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwtools%2Fcwtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwtools%2Fcwtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwtools%2Fcwtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwtools%2Fcwtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwtools","download_url":"https://codeload.github.com/cwtools/cwtools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwtools%2Fcwtools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281748722,"owners_count":26554822,"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","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["crusaders-kings-2","europa-universalis-4","hearts-of-iron-4","paradox","paradox-interactive","stellaris"],"created_at":"2025-10-30T04:57:49.447Z","updated_at":"2025-10-30T04:57:55.318Z","avatar_url":"https://github.com/cwtools.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cwtools \t![nuget](https://img.shields.io/nuget/v/CWTools.svg)\nA library for parsing, editing, and validating Paradox Interactive script files.  \nSupports all modern Paradox Interactive games, and targets .net standard 2.0.\n\nConsidering contributing? [Start here!](https://github.com/tboby/cwtools/wiki/Contributing)\n\n## Projects that use CW Tools\n#### [Stellaris tech tree](http://www.draconas.co.uk/stellaristech): https://github.com/draconas1/stellaris-tech-tree\nAn interactive tech tree visualiser that uses CW Tools to parse the vanilla tech files, and extract localisation.\n#### [SC Mod Manager](https://github.com/WojciechKrysiak/SCModManager): https://github.com/WojciechKrysiak/SCModManager/tree/feature/PortToAvalonia/PDXModLib/Utility\nA mod manager that uses CW Tools for parsing and manipulating mod files.\n\n## Example usage (C#)\nThis is a simple example of loading an event file, modifying it, and printing the updated events.\n```csharp\n            //Support UTF-8\n            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);\n\n            //Parse event file\n            var parsed = CWTools.Parser.CKParser.parseEventFile(\"./testevent.txt\");\n            var eventFile = parsed.GetResult();\n\n            //\"Process\" result into nicer format\n            var processed = CK2Process.processEventFile(eventFile);\n\n            //Find interesting event\n            var myEvent = processed.Events.FirstOrDefault(x =\u003e x.ID == \"test.1\");\n            \n            //Add is_triggered_only = true\n            var leaf = new Leaf(\"is_triggered_only\", Value.NewBool(true));\n            myEvent.AllChildren.Add(Child.NewLeafC(leaf));\n            // or\n            myEvent.AllChildren.Add(Leaf.Create(\"is_triggered_only\", Value.NewBool(true)));\n\n            //Output\n            var output = processed.ToRaw;\n            Console.WriteLine(CKPrinter.printKeyValueList(output, 0));\n```\nWhich will take a file like\n```\nnamespace = test\n\n#One event\ncountry_event = {\n        id = test.1\n    desc = \"test description\"\n}\n#Another event\ncountry_event = {\n    id = test.2\ndesc = \"test 2 description\"\n}\n```\nand output a file like\n```\nnamespace = test\n#One event\ncountry_event = {\n        is_triggered_only = yes\n        id = test.1\n        desc = \"test description\"\n         }\n#Another event\ncountry_event = {\n        id = test.2\n        desc = \"test 2 description\"\n         }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwtools%2Fcwtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwtools%2Fcwtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwtools%2Fcwtools/lists"}