This package provides a comprehensive RosettaCode API wrapper for Arturo, enabling easy interaction with the RosettaCode wiki. It handles authentication, task retrieval, solution parsing, as well as structured access to task content/categories/examples/etc.
Simply import it and start exploring RosettaCode tasks:
import 'rosetta!
; Connect to RosettaCode
rc: to :Rosetta []!
; Get all implemented tasks for Arturo
tasks: rc\implemented "Arturo"
print ["Arturo has" size tasks "implementations"]
; Get information about a specific task
task: last tasks
print task\description
; Get the Arturo solution
if solution: <= task\solution "Arturo" [
loop solution\code 'code ->
print code
]
; Find tasks without Arturo implementation
unimpl: rc\unimplemented "Arturo"
print ["Missing implementations:" size unimpl]
; Get draft tasks
drafts: rc\drafts
print ["Draft tasks:" size drafts]The main RosettaCode API client
to :Rosetta []
\wiki- underlying MediaWiki API client\loggedIn- authentication status
Authenticate with RosettaCode.
login username :string password :string
- :logical -
trueif authentication successful,falseotherwise
Retrieve task content.
task title :string
- :rcTask - task object with parsed content
- :null - task not found or request failure
Get all tasks with implementations for given language.
implemented lang :string
- :block - array of :rcTask objects
Find all tasks without implementation for given language.
unimplemented lang :string
- :block - array of :rcTask objects
Get draft programming tasks.
drafts
- :block - array of :rcTask objects
Represents a RosettaCode task with its content, solutions, and metadata
to :rcTask [wiki :MW, title :string]
\wiki- MediaWiki API client reference\title- task title
Get task content, loading from wiki if needed.
content
- :string - task wikitext content
- :null - request failure
Check if task is a draft.
draft?
- :logical -
trueif task is a draft - :null - content not available
Get task description.
description
- :string - task description (text before first solution)
- :null - content not available
Get task categories.
categories
- :block - array of category names
- :null - content not available
Get all language solutions.
solutions
- :block - array of :rcSolution objects
- :null - content not available
Get solution for specific language.
solution lang :string
- :rcSolution - solution object for the specified language
- :null - language not found or content not available
Represents a language solution with extracted code and output
to :rcSolution [language :string, content :string]
\language- programming language name\code- array of extracted code blocks (from<syntaxhighlight>tags)\output- extracted output text (from{{out}}section)
Tip
All task data is lazily loaded and cached! The first call to \content, \solutions, etc. fetches and parses the content, then subsequent calls use the cached data. 😉
MIT License
Copyright (c) 2026 Yanis Zafirópulos
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.