{"id":24993126,"url":"https://github.com/AceCentre/ace-aac-calc","last_synced_at":"2025-10-19T12:31:47.400Z","repository":{"id":274714041,"uuid":"923833330","full_name":"willwade/scicalccli","owner":"willwade","description":"A scientific calculator for the command line. Designed really for AAC users to be used with AAC Software","archived":false,"fork":false,"pushed_at":"2025-01-28T22:51:30.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T23:31:01.414Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/willwade.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":"2025-01-28T22:38:12.000Z","updated_at":"2025-01-28T22:51:34.000Z","dependencies_parsed_at":"2025-01-28T23:31:11.026Z","dependency_job_id":"5f00adca-da31-4ebd-a92a-0dcdac0eeedc","html_url":"https://github.com/willwade/scicalccli","commit_stats":null,"previous_names":["willwade/scicalccli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fscicalccli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fscicalccli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fscicalccli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fscicalccli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willwade","download_url":"https://codeload.github.com/willwade/scicalccli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237129141,"owners_count":19259863,"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":[],"created_at":"2025-02-04T13:59:38.613Z","updated_at":"2025-10-19T12:31:47.395Z","avatar_url":"https://github.com/willwade.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AAC Based Scientific Calculator\n\n\u003cimg src=\"./resources/logo.png\" width=\"50\" alt=\"AAC Calculator\"\u003e\n\nA scientific calculator project with multiple implementations - all with the aim to work with AAC Software:\n\n1. [Vanilla HTML Calculator](#vanilla-html-calculator). This is the current main way we recommend to use this. Its offline, works in the browser and as such as a webview in a AAC software system such as the Grid. Try it [here](https://raw.githack.com/AceCentre/ace-aac-calc/main/vanilla-html/calcstandalone.html)\n2. [Python CLI Calculator](#python-cli-version). This is a command line calculator that can be used in any system that can execute Python scripts. It requires either a pythoon interpreter or a comppiled version. We build this together with a web server that can be used to serve the calculator. **IF you want/must have a calculator with minimal screen space eg. in the message bar you need this**\n3. [React Version](#react-version). This is a modern React implementation of the calculator. It is a work in progress and does not yet have all the features of the other implementations.\n\n\n\nhttps://github.com/user-attachments/assets/b5c1cbdd-1850-4be5-aa9d-2be025a8bceb\n\n\n\n## Vanilla HTML Calculator\nLocated in `/vanilla-html/`\n\nSee a demo of this in action [here](https://raw.githack.com/AceCentre/ace-aac-calc/main/vanilla-html/calcstandalone.html)\n\n- Single HTML file calculator that runs in any browser\n- No dependencies or installation required\n- Supports keyboard shortcuts and memory operations\n- Windows installer available for Grid 3 integration\n\n### Features\n- Basic arithmetic operations (+, -, *, /)\n- Scientific functions (sin, cos, tan, log, etc.)\n- Memory operations\n- Expression history with recall\n- Adjustable decimal places (0-15)\n- Radians/Degrees toggle\n- Unicode math symbol support\n- Algebraic expressions\n- Random number generation\n- Bracket completion preview\n\n### Input Methods\n\nThe calculator accepts both text and Unicode math symbols:\n\n| Text Input | Symbol Input | Description |\n|------------|-------------|-------------|\n| `sqrt(x)`  | `√x`        | Square root |\n| `pi`       | `π`         | Pi constant |\n| `*`        | `×`         | Multiplication |\n| `/`        | `÷`         | Division |\n| `^2`       | `²`         | Square |\n| `^3`       | `³`         | Cube |\n| `e`        | `ℯ`         | Euler's number |\n\n### Example Expressions\n\n#### Basic Math\n```\n2 + 2 = 4\n1/2 × 20 = 10\n√16 = 4\nπ × 2 = 6.283185307\n```\n\n#### Scientific Functions\n```\nsin(45) = 0.7071067812\nlog(100) = 2\n√(π) = 1.7724538509\n```\n\n#### Random Numbers\n```\nrand() = 0.7324846372         # Random number between 0-1\nfloor(rand() * 6) + 1 = 4    # Roll a die (1-6)\nfloor(rand() * 100) + 1 = 42 # Random number 1-100\n```\n\n#### Algebraic Expressions\n```\nx^2 + 2x + 1                 # Quadratic expression\n2x + 2y                      # Linear expression with variables\n```\n\n#### Memory Operations\n- Store current result: Ctrl/⌘ + P (M+)\n- Subtract from memory: Ctrl/⌘ + M (M-)\n- Recall memory: Ctrl/⌘ + R (MR)\n\n### Line References with @\n\nMaybe slightly easier that using M+,M- etc you can reference previous results using the @ symbol followed by the line number. Each line in the history is numbered for easy reference.\n\n```\n1. 10 + 5 = 15\n2. 20 + 12.5 = 32.5\n3. @2−@1 → (32.5)−(15) = 17.5\n```\n\n#### Examples\n- `@1` references the result from line 1\n- `1000 - @3` subtracts line 3's result from 1000\n- `@2 * @1` multiplies results from lines 2 and 1\n- `floor(@1 * 6)` uses line 1's result in a function\n\nThe calculator will show both your expression with @ references and the expanded calculation with actual values.\n\n\n### Keyboard Shortcuts\n- `Enter` or `=` - Evaluate expression\n- `Escape` - Clear workpad\n- `↑` - Previous expression\n- `↓` - Next expression\n- `Alt/⌘ + D` - Toggle Degrees/Radians\n- `Ctrl + (0-9)` - Set decimal places\n\n### Tips\n- Brackets are automatically completed as you type\n- History is scrollable and expressions can be recalled\n- Click the DP button or use Ctrl + number to set decimal places\n- Toggle between degrees/radians for trigonometry\n- Unicode symbols can be typed directly or using text equivalents\n\n### Installation\nDownload the latest installer from the [Releases](https://github.com/AceCentre/ScientificCalculator/releases) page.\n\n## Python CLI Version\nLocated in `/python-cli/`\n- Command-line interface calculator\n- Python implementation with web server option\n- Clipboard integration\n- Designed for AAC software integration\n\n### Features\n- Command-line operation\n- Clipboard monitoring mode\n- Web server interface\n- Full mathematical function support\n\n\n### Examples\n\n```bash\nscicalc \"2+2\"              # Basic arithmetic\nscicalc \"sin(30)\"          # Trigonometry (degrees)\nscicalc \"log₂(8)\"         # Logarithms\nscicalc \"√16\"             # Square root\nscicalc \"5!\"              # Factorial\nscicalc \"200+10%\"         # Percentages\nscicalc \"2π\"              # Implicit multiplication\nscicalc \"2EE3\"            # Scientific notation\n```\n\n### Output Formats\n\nYou can control how results are displayed using the `--return` option:\n\n```bash\nscicalc --return answer \"2+2\"        # Only shows the result: \"4\"\nscicalc --return answer,calc \"2+2\"   # Shows both: \"4\\n2+2 = 4\"\nscicalc --return full \"2+2\"          # Shows full: \"2+2 = 4\" (default)\n```\n\n### Clipboard Integration\n\nThe calculator can interact with the system clipboard in two ways:\n\n#### Watch Mode\n```bash\nscicalc --readpasteboard\n```\nThis mode continuously monitors your clipboard. When you copy a mathematical expression, \nit automatically calculates the result and updates the clipboard with both the expression \nand its result. Great for doing a series of calculations!\n\n#### Output to Clipboard\n```bash\nscicalc --output-to-pasteboard \"2+2\"\n```\nThis copies the result directly to your clipboard instead of displaying it.\nCan be combined with --return options:\n```bash\nscicalc --output-to-pasteboard --return answer \"2+2\"  # Only copies the number\n```\n\nNote: You cannot use --output-to-pasteboard with --readpasteboard\n\n## Integration with AAC Software\n\nThis calculator is designed to work seamlessly with AAC software. The command-line interface makes it easy to:\n- Call from any AAC software that can execute commands\n- Copy results to clipboard for pasting\n- Use with keyboard shortcuts or switch access\n\n### Example AAC Integration\n\n1. **Basic Calculation**: Set up a button that runs:\n   ```bash\n   scicalc --return answer \"YOUR_EXPRESSION\"\n   ```\n\n2. **Clipboard Watch Mode**: Create a button for continuous calculation:\n   ```bash\n   scicalc --readpasteboard\n   ```\n   Then users can copy expressions and get results automatically.\n\n3. **Direct to Clipboard**: For AAC systems that work better with clipboard:\n   ```bash\n   scicalc --output-to-pasteboard --return answer \"YOUR_EXPRESSION\"\n   ```\n\n## Development\n\n### Requirements\n- Python 3.8 or higher\n- Dependencies listed in pyproject.toml\n- uv (Python package installer)\n\n### Setup Development Environment\n\n```bash\n# Install uv if you haven't already\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Clone and install\ngit clone https://github.com/yourusername/scicalccli.git\ncd scicalccli\nuv pip install -e \".[test]\"\n```\n\n### Running Tests\n\n```bash\nuv run pytest\n```\n\n### Input Methods\n\nThe calculator accepts both text and Unicode math symbols:\n\n| Text Input | Symbol Input | Description |\n|------------|-------------|-------------|\n| `sqrt(x)`  | `√x`        | Square root |\n| `pi`       | `π`         | Pi constant |\n| `*`        | `×`         | Multiplication |\n| `/`        | `÷`         | Division |\n| `^2`       | `²`         | Square |\n| `^3`       | `³`         | Cube |\n| `e`        | `ℯ`         | Euler's number |\n\nExamples:\n- `2×π` or `2*pi` → `6.283185...`\n- `√25` or `sqrt(25)` → `5`\n- `3²` or `3^2` → `9`\n\nBoth notation styles work interchangeably, so you can mix and match based on your preference.\n\n\n## React Version\nLocated in `/react/`\n- Modern React implementation\n- Component-based architecture\n- Enhanced UI/UX\n- Work in progress\n\n\n(NB: this was the precursor to the vanilla html version. We are not actively developing it further. I ❤️ old skool html)\n\n## Development\nEach implementation has its own development setup. Its pretty obvious. Read the code.\n\n## License\n[GPL-3.0](LICENSE)\n\n\n## Credits\n\n- Will Wade @ [AceCentre](https://www.acecentre.org.uk)\n- Marion \u0026 Katie Stanton @ [Candle](https://candleaac.com) for nudging me towards how to do this\n- [Desmos](https://www.desmos.com/) for the math rendering engine inspiration (its still good and free! but there is no clear shortcut and its not easy to run offline)\n\n## User Testing / Inspiration\n\n- Patrick McCabe and Failbroome Academy for the initial idea and testing\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAceCentre%2Face-aac-calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAceCentre%2Face-aac-calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAceCentre%2Face-aac-calc/lists"}