{"id":38488764,"url":"https://github.com/gerph/rosettacode","last_synced_at":"2026-01-17T05:39:45.119Z","repository":{"id":128876894,"uuid":"186054301","full_name":"gerph/rosettacode","owner":"gerph","description":"Library for accessing Rosetta Code","archived":false,"fork":false,"pushed_at":"2025-06-25T01:27:31.000Z","size":23,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T02:34:02.540Z","etag":null,"topics":["rosettacode"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gerph.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}},"created_at":"2019-05-10T21:05:00.000Z","updated_at":"2025-06-25T01:27:29.000Z","dependencies_parsed_at":"2025-06-25T02:26:57.974Z","dependency_job_id":"1525d786-29a1-448f-8d8a-7f019aea7512","html_url":"https://github.com/gerph/rosettacode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gerph/rosettacode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Frosettacode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Frosettacode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Frosettacode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Frosettacode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerph","download_url":"https://codeload.github.com/gerph/rosettacode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerph%2Frosettacode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28500603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["rosettacode"],"created_at":"2026-01-17T05:39:44.995Z","updated_at":"2026-01-17T05:39:45.100Z","avatar_url":"https://github.com/gerph.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rosetta Code reading\n\n## Introduction\n\nThe rosettacode.org site provides example code for a variety\nfor different tasks in many different languages. Because the\ncode is generally pretty self contained and simple - as the\npoint is to show the differences in the way languages do\nthings - it makes a good source of code to try things out\nwith.\n\nI wanted to get the C code to test a compiler wasn't crashing\non simple stuff, but it's probably useful to others. So I've\ntidied up code a little bit, and added a CLI interface, so\nthat others might use it.\n\n\n## rosettacode.py\n\nThe main rosettacode.py library is able to be used to extract\ninformation from the Task and Category pages, breaking down\nthe information into Languages and CodeBlocks. You can then\ndo what you want with that information.\n\nIt is expected that the code is used by accessing either a\nCategory(\u003cname\u003e) or a Task(\u003cname\u003e).\n\nBasically:\n  * a Category may list a number of Tasks.\n  * Tasks may contain a number of Languages.\n  * Languages may define multiple CodeBlocks.\n  * CodeBlocks may have code, an output definition, and some\n    other metadata.\n\nFor example:\n    task = Task('100_doors')\n    for lang in task.languages:\n        for block in lang.blocks:\n            print(\"Code length: {}\".format(len(block.code)))\nOr:\n    category = Category('C')\n    for task in category.tasks:\n        print(\"Task: {}\".format(task.name))\n\nThe layout of the pages is mostly structured to allow the\ncode blocks to be extracted, but some code blocks are not\nstructured consistently in the markdown.\n\n\n## rccli.py\n\nThe CLI tool is intended to be used just to get the data out,\nwithout needing to care about the API that does the data\nprocessing. I didn't use it myself for the extraction of the\ndata I wanted - the nasty code I wrote was expanded into the\nmonstrosity that is this CLI tool.\n\nIf the tool isn't functional for you, there's always the API.\nIf the API isn't functional for you, well, you have the source...\n\nSome examples:\n\nSome example uses:\n\n* `./rccli.py --task '100_doors'`\n\n    list the languages in '100_doors'\n\n* `./rccli.py --task '100_doors' --languages --count`\n\n    list the languagse with counts of the code blocks\n\n* `./rccli.py --task '100_doors' --code`\n\n    list all the code in all the languages\n\n* `./rccli.py --task '100_doors' --language 'C' --code`\n\n    show the code blocks for C code in '100_doors'\n\n* `./rccli.py --category 'C' --tasks`\n\n    list all the tasks in the 'C' category\n\n* `./rccli.py --catgeory 'C' --json`\n\n    Dump JSON for the data in the 'C' category.\n\n* `./rccli.py --category 'C' --json --file 'my.json'`\n\n    Dump JSON for the data in the 'C' category to a file.\n\n* `./rccli.py --task '100_doors' --dir 'code'`\n\n    Extract all the code from the '100_doors' task in to a directory\n\n* `./rccli.py --task '100_doors' --language 'C' --dir 'code'`\n\n    Extract the C code from the '100_doors' task in to a directory\n\n* `./rccli.py --category 'C' --language 'C' --dir 'code'`\n\n    Extract the C code all tasks in the 'C' category in to a directory\n\n\n## Notes\n\nThe API library uses a local cache in the 'no-backup'\ndirectory. If that's not what you want, then it's simple\nto change, but I was too lazy to add more functionality for\nconfiguring it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Frosettacode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerph%2Frosettacode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerph%2Frosettacode/lists"}