{"id":15636449,"url":"https://github.com/kaliv0/chancleta","last_synced_at":"2026-03-09T19:02:49.768Z","repository":{"id":257808300,"uuid":"864484007","full_name":"kaliv0/chancleta","owner":"kaliv0","description":"Python library for creating Command Line Interfaces via configuration files","archived":false,"fork":false,"pushed_at":"2025-03-13T05:23:53.000Z","size":2940,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T05:45:17.906Z","etag":null,"topics":["command-line-interface","json","python-cli-starter-kit","toml","xml","yaml"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/chancleta/","language":"Python","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/kaliv0.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}},"created_at":"2024-09-28T10:42:09.000Z","updated_at":"2025-03-13T05:23:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"962e53b2-17d1-4eb4-a24f-14c4216b7cf9","html_url":"https://github.com/kaliv0/chancleta","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"0ed450b4524016b169e8565f36d65e4e5598b341"},"previous_names":["kaliv0/chancleta"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliv0%2Fchancleta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliv0%2Fchancleta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliv0%2Fchancleta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliv0%2Fchancleta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaliv0","download_url":"https://codeload.github.com/kaliv0/chancleta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251651221,"owners_count":21621702,"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":["command-line-interface","json","python-cli-starter-kit","toml","xml","yaml"],"created_at":"2024-10-03T11:04:03.357Z","updated_at":"2026-03-09T19:02:49.677Z","avatar_url":"https://github.com/kaliv0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/kaliv0/chancleta/blob/main/assets/chancleta.gif?raw=true\" width=\"250\" alt=\"Chancleta Samurai\"\u003e\n\u003c/p\u003e\n\n# chancleta\n\n![Python 3.x](https://img.shields.io/badge/python-3.12-blue?style=flat-square\u0026logo=Python\u0026logoColor=white)\n[![PyPI](https://img.shields.io/pypi/v/chancleta.svg)](https://pypi.org/project/chancleta/)\n[![Downloads](https://static.pepy.tech/badge/chancleta)](https://pepy.tech/projects/chancleta)\n\n\u003cbr\u003ePython library for creating \u003cb\u003ecommand line interfaces\u003c/b\u003e in a composable way via configuration files.\n\u003cbr\u003e Supports \u003ci\u003e.toml\u003c/i\u003e, \u003ci\u003e.json\u003c/i\u003e, \u003ci\u003e.yaml\u003c/i\u003e. and (if you'd like to be more adventurous) \u003ci\u003e.xml\u003c/i\u003e.\n\n---------------------------\n### How to use\n- Describe configurations in a chancleta.toml file. \n\u003cbr\u003e(File format could vary between .toml, .json, .yaml and .xml as long as the name remains the same.)\n\u003cbr\u003eAdd mandatory \u003ci\u003e'meta'\u003c/i\u003e data with general information about your program\n\n```toml\n[meta]\nsrc = \"testoo.util.commands\"\nprog = \"foo\"\nversion = \"0.1.0\"\ndescription = \"Test my new flip flops\"\nusage = \"Take that jive Jack, put it in your pocket 'til I get back\"\n```\n\u003cb\u003e'src'\u003c/b\u003e points to the directory where the corresponding python functions are to be found and called with arguments read from the terminal\n- Configure subcommands as separate tables (objects if you're using JSON)\n\n```toml\n[yes]\ndescription = \"Simple yes function\"\nargument = { name = \"text\", help = \"Some dummy text\" }\noption = { name = \"should-repeat\", short = \"r\", flag = \"True\", help = \"should repeat text 5 times\" }\nhelp = \"yes func\"\nfunction = \"yes\"\n```\n\u003cb\u003efunction\u003c/b\u003e shows the name of the python function to be called\n- If you have multiple arguments/options - put them as inline tables inside arrays\n```toml\n[echo]\narguments = [\n    { name = \"text\", help = \"Some dummy text\" },\n    { name = \"mark\", type = \"str\", help = \"Final mark\" },\n]\noptions = [\n    { name = \"other-text\", short = \"o\", default = \"Panda\", dest = \"other\", help = \"Some other dummy text\" },\n    { name = \"delimiter\", default = \", \", help = \"use DELIM instead of TAB for field delimiter\" },\n    { name = \"num\", default = 42, type = \"int\", help = \"some random number to make things pretty\" }\n]\nfunction = \"echo\"\n```\n\u003ci\u003echancleta\u003c/i\u003e supports advanced features such as \u003ci\u003echoices\u003c/i\u003e, \u003ci\u003enargs\u003c/i\u003e, \u003ci\u003edest\u003c/i\u003e (for options), \u003ci\u003etype\u003c/i\u003e validation\n```toml\n[maybe]\nargument = { name = \"number\", type = \"int\", choices = [3, 5, 8], help = \"Some meaningless number\" }\noption = { name = \"other-number\", type = \"int\", nargs = \"*\", choices = [1, 2], dest = \"other\", help = \"Other marvelous number\" }\nfunction = \"maybe\"\n```\n- For boolean flags you could use\n ```toml\noptions = [\n    { name = \"should-log\", flag = \"False\", default = true },\n    { name = \"should-repeat\", flag = \"True\"}\n]\n```\nwhich is equivalent to\n```\naction=\"store_false\"...\naction=\"store_true\"...\n```\n- If no \u003ci\u003eshort\u003c/i\u003e name is given for an option, the first letter of the full name is used\n---------------------------\n\n- Inside your program import the \u003ci\u003eChancleta\u003c/i\u003e object, pass a path to the directory where your config file lives and call the \u003ci\u003eparse\u003c/i\u003e method\n```python\nfrom chancleta import Chancleta\n\ndef main():\n    Chancleta(\"./testoo/config\").parse()\n```\nIf no path is given chancleta will try to find the config file inside the root directory of your project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliv0%2Fchancleta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaliv0%2Fchancleta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliv0%2Fchancleta/lists"}