{"id":24510632,"url":"https://github.com/chriseaton/spell","last_synced_at":"2026-02-18T09:01:59.403Z","repository":{"id":97906608,"uuid":"158620085","full_name":"chriseaton/spell","owner":"chriseaton","description":"\"Sort-of Pseudocode\" Everyday Logical Language. Communicate logical operations clearly between technical and semi-technical individuals.","archived":false,"fork":false,"pushed_at":"2018-11-22T05:57:51.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-19T18:45:54.213Z","etag":null,"topics":["language","pseudocode","schema","syntax"],"latest_commit_sha":null,"homepage":null,"language":null,"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/chriseaton.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":"2018-11-22T00:03:56.000Z","updated_at":"2018-11-22T05:57:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e4c2597-46c9-4f8a-9f1c-c54bc7998657","html_url":"https://github.com/chriseaton/spell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chriseaton/spell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriseaton%2Fspell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriseaton%2Fspell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriseaton%2Fspell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriseaton%2Fspell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chriseaton","download_url":"https://codeload.github.com/chriseaton/spell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriseaton%2Fspell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29574065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: 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":["language","pseudocode","schema","syntax"],"created_at":"2025-01-22T00:30:01.790Z","updated_at":"2026-02-18T09:01:59.376Z","avatar_url":"https://github.com/chriseaton.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# SPELL\n## *\"Sort-of Pseudocode\" Everyday Logical Language*\nSPELL is a pseudocode language created to maximize communication between technical and semi-technical individuals. It provides an open and expressive syntax that empowers the writer to convey clear, step-by-step information about a logical operation.\n\n\u003e The problem with most other pseudocode languages is that they are usually difficult for non-programmers to understand - either being too unstructured, or too complicated.    \n\u003e\n\u003e SPELL aims to be light-hearted and expressive, while still providing some consise structure where it is needed most to convey the details of a technical operation.\n\nThe language allows the writer to be as descriptive as needed to clearly convey operational intention, there are only a few keywords to remember and the syntax is simple and straight-forward.\n\nEvery SPELL operation (i.e. function, process, etc.) is written to include the `INPUTS`, followed by the `ACTION` steps of the process, and the `OUTPUT`. \n\n## Real World\nSPELL is battle-tested in the field, and has a stable core syntax - although it may be refined over time with minor updates. \n\nLearning to *write* SPELL properly is not difficult and can be picked up with just a small amount of practice. The important thing is that SPELL can be *read* and *interpretted* by anyone capable of forming a logical premise, without learning the formal syntax.\n\n## Try it Out\nThe following example describes a process that uses information from two web-service APIs, as well as a loaded customer profile to create an order for Toys starting with the letter \"A\". It then sends that order to another web-service API call to complete the entire operation.\n\nSee if you can understand what it's describing:\n\n```\n((Create Order for Toys))\nINPUTS\n------\n1. Toys = /api/toys (Web Service)\n    WITH Authentication (Header)\n2. Customer = Curstomer profile (Cache)\n3. Shipper = /api/shipping (Web Service)\n    WITH \n        - Authentication (Header)\n        - Customer:UID (Parameter)\n    WHERE    \n        - Shipper:ShippingMethod = truck    \n        - AND Shipper:Country = USA\n        - AND Shipper is ((Valid Shipper))\n4. Order = ((New Order))\n\nACTION\n------\n1. LOOP THROUGH Toys EACH CALLED Toy\n    1. WHEN Toy:Name starts with an \"A\" \n        THEN \n            1. OrderProduct = ((New Order Product))\n            2. OrderProduct:UPC = Toy:UPC\n            3. Order:TotalPrice = Order:TotalPrice + Toy:Price\n2. STOP LOOP\n3. Order:ShippingCode = Order:Code + Shipper:Carrier Name + ((Current Date))\n4. Order:ShippingPrice = ((Calculate Shipping))\n5. Order:CustomerName = Customer:Name\n6. Order:Address = Customer:Address\n7. WHEN Shipper:ShippingPrice \u003e 3.5   \n        THEN Order:TotalPrice = Order:Price + Shipper:ShippingPrice    \n        OTHERWISE Order:TotalPrice = Order:Price\n\nOUTPUT\n------\n1. SEND Order TO /api/orders (Web Service)\n```\n\nWant to see more? Check the our [examples](Examples).\n\n## Syntax\n\n### Schema\n```\n[(({Operation}))]\nINPUTS\n------\n{1..x}. {Item} = {Detail} [(Type|Attribute[, ...n])]\n    [WITH\n        [- {Detail} [(Type|Attribute[, ...n])]]\n        [...n] \n    ]\n    [WHERE\n        [- [...AND|OR ][{Item}[:{Item}...n] [comparison] [{Item}[:{Item}...n]|(({Operation}))]]]\n        [...n]\n    ]\n\nACTION\n------\n{1..x}.    \n    [{Item}[:{Item}...n] = {Item}[:{Item}...n]|(({Operation}))]    \n    [WHEN [{Item}[:{Item}...n] [comparison] {Item}[:{Item}...n]|(({Operation}))]\n        [{1..x}. [...AND|OR ][{Item}[:{Item}...n] [comparison] {Item}[:{Item}...n]|(({Operation}))]]\n        [...n]\n        THEN [action]\n            [{1..x}. action]\n            [...n]\n        [OTHERWISE [action]\n            [{1..x}. action]\n            [...n]\n        ]\n    ]\n\nOUTPUT\n------\n{1..x}. SEND {Item}[:{Item}...n] TO [{Item}[:{Item}...n]|(({Operation}))|{Detail} [(Type|Attribute[, ...n])]]\n    [WITH\n        [- {Detail} [(Type|Attribute[, ...n])]]\n        [...n] \n    ]\n    [WHERE\n        [- [...AND|OR ][{Item}[:{Item}...n] [comparison] [{Item}[:{Item}...n]|(({Operation}))]]]\n        [...n]\n    ]\n```\n\n\n### Conventions\n- Items should be made up of (mostly) nouns, not abbreviations or similified variable names.\n- Items, types, attributes, or details should always use [PascalCase (e.g UpperCamelCase)](https://en.wikipedia.org/wiki/Camel_case).\n- Keywords should be in ALL CAPS.\n- Sections (INPUT, ACTION, and OUTPUT) may be omitted if not used.\n- Filtering statements (following WITH, WHEN and WHERE keywords) are always expanded using bulletted-lists, all others (action statements) use numbered-lists.\n- Use consistent indents, tabs or four (4) spaces for readability.\n- If a statement is continued on a new line, indent that line from it's parent. Keep the indent level (after the initial indent) for continuations of descriptions, bulleted lists, or numbered lists.\n    \n    **Example**   \n    ```\n    1. WHEN ((Current Date)) is a Monday\n        THEN \u003c--Indent\n            1. Price = 2.5 \u003c--Initial indent\n            2. Smiles = 5 \u003c--No extra indent (bulleted list)\n    2. Dog = \"Cat\" \u003c-- Here is a long description, we're \n        always indenting the first continuation but will\n        not consider changing the indent level until we \n        are completely done.\n    3. WHEN ((Error))\n        THEN\n            1. Err = ((New Error Report)) \u003c--Initial indent.\n            2. Err.Code = 5294 \u003c--No extra indent (numbered list)\n            3. LOOP THROUGH Items\n               1. Err.Cnt = Err.Cnt + 1 \u003c--Indent (new numbered list)\n    ```\n- Sections should be underlined with hypens (\"-\").\n- All keywords are upper-case, avoid upper-case for non-keywords to minimize confusion.\n- Avoid using data types that wouldn't make sense to the laymen, for example:\n    - Instead of \"int\" or \"float\", just say \"integer\" or \"decimal\".\n    - Instead of \"True\" or \"False\", say \"Yes\" or \"No\", or \"Enabled\" or \"Disabled\".\n\n\n## Keywords\n- AND\n- EACH CALLED\n- EXIT\n- LOOP THROUGH\n- OR\n- OTHERWISE\n- STOP LOOP\n- THEN\n- WHEN\n- WHERE\n- WITH\n- SEND TO\n\n### Sections\nA spell operation has 3 sections, all are optional, however, they should appear in the exact order of `INPUTS`, `ACTION`, and finally `OUTPUT`. All sections should have the line below them (six \"-\" characters).\n\n#### INPUTS\nThe `INPUTS` section describes a number of \"items\" the operation will need before performing actions. You should list any items that you would create, load, or otherwise initialize before performing any actions. The `INPUTS` acts as a \"dictionary\" for the reader to reference when reading through the rest of the SPELL operation.\n\nAlthough you can declare new items at any time within the `ACTION` section, you should limit it as much as possible. \n\n#### ACTION\nThe `ACTION` section spells out the logical steps your operation needs to take in order to result in the desired `OUTPUT`. This can including looping through items (`LOOP THROUGH`), checking conditions (`WHEN`,`THEN`,`OTHERWISE`), and manipulating items (`{Item} = ...`).\n\n#### OUTPUT\nThe `OUTPUT` section is similar to the `INPUTS` but describes items being sent out of the operation, this is done using the `SEND [{Item}] TO` keywords on each `OUTPUT` statement. \n\n### Operators\n#### :    \n**Usage**: `{Item}[:{Item}...n]`    \nThe colon \":\" acts to indicate a child item (sometimes called \"properties\") of a parent-level item. Colons can be repeated to form a drill-down to a specific item.\n\n**Example**    \nBelow, we indicate that on the \"Order\" item, there is a child-item \"Price\" which needs to be set to the value 3.14.\n```\n1. Order:Price = 3.14\n```\n\n**Example**    \nIn the following example, we are indicating the \"Won\" item under the \"Games\" item, which is under the \"Player\" item, needs to be set to the value 56.\n```\n1. Player:Games:Won = 56\n```\n\n#### (( ))    \n**Usage**: `(({Operation}))`    \nIndicates an operation, such as a programmic function or process, or anoter SPELL script. This operator is optionally used to title each script (appearing on the line before the `INPUTS` statement).   \n`{Operation}` is the name of the operation.   \n\n**Example**    \nIn the following example, the item \"Orange\" will be the result of the \"New Fruit\" operation.\n```\n1. Orange = ((New Fruit))\n```\n\n#### ( )    \n**Usage**: `({Type|Attribute[,...n]})`    \nIndicates one or more types or attributes of the item named in a \"=\" statement (optionally). The meaning of \"type\" and \"attribute\" here is used in a general sense, meaning it can be any noun or descriptive keyword(s) - such as a mode of transport, a static type, a style of carpetting, as long as it's short, and descriptive.\n`{Type|Attribute[, ...n]}` is one or more type/attribute name, seperated by a comma.    \n\n**Example**    \nIn the following example, the `( )` indicates the \"Lookups\" item is from a \"Web Service\" type of data source, and uses a GET request method.\n```\n1. Lookups = /api/lookups (Web Service, GET)\n```\n\n#### \u003c--    \n**Usage**: `\u003c-- {Text}`    \nThe arrow indicator is followed by text to describe the current statement or add additional comments or notes.\n\n**Example**    \nIn this example we're commenting on a LOOP THROUGH statement to add clarity for our reader.\n```\n1. LOOP THROUGH Orders EACH CALLED o \u003c-- This means go through all the orders, Bob! \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriseaton%2Fspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchriseaton%2Fspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriseaton%2Fspell/lists"}