Terminal UI for erhanbaris/smartcalc, a new way to do calculations on-the-fly

Overview

smartcalc-tui

Terminal UI for erhanbaris/smartcalc, a new way to do calculations on-the-fly. From the README:

Do your calculation on text based queries and see the result immediately. Still it is under development but it is enough to use it on daily purpose. Supports money conversion, percentage calculation and basis time calculation but still not fully supported. For now, we support only in english language but if any want to help to translate, we can easily integrate new language.

A number of different operations are supported. To see the full list, see here.

tui-screenshot

Project Status

This project is under active development. Some existing functionality may not work as expected.

Use at your own risk 🙂

License

The SmartCalc project is distributed under the GNU General Public License. This project is available under the MIT License, © 2022 Aaron Ross. All rights reserved.

Comments
  • bot to watch smartcalc and open PR for version bumps

    bot to watch smartcalc and open PR for version bumps

    During initial development, I've been able to keep an eye on the upstream lib version, but now that we're mostly feature-complete, it'll be nice to automate this so things don't get out of sync.

    There may be something out there that does this already, but it could also be a fun side project 🤔

    opened by superhawk610 1
  • Won't compile: `libsmartcalc` doesn't exist

    Won't compile: `libsmartcalc` doesn't exist

    I tried to test this project but it looks like the dependancy libsmartcalc no longer exists, this is the output I get:

    ❯ cargo install --path .
      Installing smartcalc-tui v1.0.1 (/home/user/projects/smartcalc-tui)
        Updating crates.io index
        Updating git repository `https://github.com/erhanbaris/smartcalc`
    error: failed to compile `smartcalc-tui v1.0.1 (/home/user/projects/smartcalc-tui)`, intermediate artifacts can be found at `/home/user/projects/smartcalc-tui/target`
    
    Caused by:
      no matching package found
      searched package name: `libsmartcalc`
      perhaps you meant:      smartcalc
      location searched: https://github.com/erhanbaris/smartcalc
      required by package `smartcalc-tui v1.0.1 (/home/user/projects/smartcalc-tui)`
    

    replacing libsmartcalc with smartcalc produces the following errors:

    ❯ cargo install --path .
      Installing smartcalc-tui v1.0.1 (/home/user/projects/smartcalc-tui)
        Updating crates.io index
        Updating git repository `https://github.com/erhanbaris/smartcalc`
       Compiling smartcalc v1.0.4 (https://github.com/erhanbaris/smartcalc#507ed954)
       Compiling smartcalc-tui v1.0.1 (/home/user/projects/smartcalc-tui)
    error[E0432]: unresolved import `smartcalc::executer`
      --> src/lib.rs:55:28
       |
    55 |             use smartcalc::executer::initialize;
       |                            ^^^^^^^^ could not find `executer` in `smartcalc`
    
    error[E0603]: module `app` is private
      --> src/lib.rs:54:28
       |
    54 |             use smartcalc::app::{ExecuteLine, ExecuteLineResult, SmartCalc};
       |                            ^^^ private module
       |
    note: the module `app` is defined here
      --> /home/user/.cargo/git/checkouts/smartcalc-d93f0c50fe48d91c/507ed95/src/lib.rs:26:1
       |
    26 | pub(crate) mod app;
       | ^^^^^^^^^^^^^^^^^^^
    
    warning: ignoring -C extra-filename flag due to -o flag
    
    Some errors have detailed explanations: E0432, E0603.
    For more information about an error, try `rustc --explain E0432`.
    warning: `smartcalc-tui` (lib) generated 1 warning
    error: failed to compile `smartcalc-tui v1.0.1 (/home/user/projects/smartcalc-tui)`, intermediate artifacts can be found at `/home/user/projects/smartcalc-tui/target`
    
    Caused by:
      could not compile `smartcalc-tui` due to 2 previous errors; 1 warning emitted
    
    
    bug 
    opened by JacobTravers 1
  • syntax highlighting

    syntax highlighting

    The SmartCalc web UI supports real-time syntax highlighting, for inputs and outputs:

    image

    We can incorporate this using the colored package to highlight strings. I beleve tokens are available as part of the ExecuteLine or ExecuteLineResult struct, so (hopefully) this should be fairly straightforward.

    enhancement 
    opened by superhawk610 1
  • Update smartcalc to 1.0.8

    Update smartcalc to 1.0.8

    This is an auto-generated PR created because smartcalc appears to have recently released a new version. The dependency and package versions have been bumped automatically.

    You can check this branch out locally to make any required changes:

    git fetch origin
    git checkout chore/smartcalc-1.0.8
    

    Tests won't run automatically (bots can't trigger other workflows), so make sure to close and then re-open this PR to have the automated tests run.

    Once tests are passing, don't forget to publish to crates.io! :partying_face:

    opened by github-actions[bot] 0
  • Update smartcalc to 1.0.7

    Update smartcalc to 1.0.7

    This is an auto-generated PR created because smartcalc appears to have recently released a new version. The dependency and package versions have been bumped automatically.

    You can check this branch out locally to make any required changes:

    git fetch origin
    git checkout chore/smartcalc-1.0.7
    

    Once tests are passing, don't forget to publish to crates.io! :partying_face:

    opened by github-actions[bot] 0
  • Update smartcalc to 1.0.7

    Update smartcalc to 1.0.7

    This is an auto-generated PR created because smartcalc appears to have recently released a new version. The dependency and package versions have been bumped automatically. You can check this branch out locally to make any required changes: git fetch origin git checkout chore/smartcalc-1.0.7 Once tests are passing, don't forget to publish to crates.io! :partying_face:

    opened by github-actions[bot] 0
  • Update smartcalc to 1.0.7

    Update smartcalc to 1.0.7

    This is an auto-generated PR created because smartcalc appears to have recently released a new version. The dependency version has been incremented automatically - please make any additional changes required (if any) and merge/release on crates.io :slightly_smiling_face:

    opened by github-actions[bot] 0
  • Update smartcalc to

    Update smartcalc to

    This is an auto-generated PR created because smartcalc appears to have recently released a new version. The dependency version has been incremented automatically - please make any additional changes required (if any) and merge/release on crates.io :slightly_smiling_face:

    opened by github-actions[bot] 0
  • add support for syntax highlighting

    add support for syntax highlighting

    This PR adds support for real-time syntax highlighting.

    syntax-highlighting

    This depends on work in #9, as well as an upstream change to make smartcalc::token::ui_token::{UiToken, UiTokenType} pub here.

    enhancement 
    opened by superhawk610 0
  • support variable definition

    support variable definition

    Previously, we used Smartcalc::execute, which initializes a new session on each call and expects to receive/run the full text of all calculations so far (including variable definitions). Instead, we now track a single persistent session (which contains all variable definitions) and pass that to Smartcalc::execute_session, allowing us to execute only newly added lines while maintaining existing session state.

    This relies on an unpublished change to smartcalc (see referenced PR).

    enhancement 
    opened by superhawk610 0
  • publish on crates.io

    publish on crates.io

    Once a couple of the initial issues get knocked out, it would be nice to have this published alongside smartcalc on crates.io, to make it easier to discover.

    enhancement 
    opened by superhawk610 0
  • memoize smartcalc operation execution

    memoize smartcalc operation execution

    Currently, SmartCalc::execute is run every 250ms, regardless of whether any input is available or if the input has changed since the last time it was run. Ideally, execute should only be called when there is new/changed input. Some amount of caching may also be desirable.

    ~~This is currently all done inline inside spawn, which also isn't ideal. It should probably be moved into its own module.~~ Done in #9.

    enhancement good first issue 
    opened by superhawk610 0
Releases(v1.0.7)
  • v1.0.7(Mar 20, 2022)

    What's Changed

    • add GitHub Action to watch upstream for new releases by @superhawk610 in https://github.com/superhawk610/smartcalc-tui/pull/18
    • Update smartcalc to 1.0.7 by @github-actions in https://github.com/superhawk610/smartcalc-tui/pull/22

    New Contributors

    • @github-actions made their first contribution in https://github.com/superhawk610/smartcalc-tui/pull/22

    Full Changelog: https://github.com/superhawk610/smartcalc-tui/compare/v1.0.6...v1.0.7

    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(Mar 17, 2022)

    This is the first official release 🎉

    Release versions will be kept in sync with erhanbaris/smartcalc, and new versions should be published to crates.io shortly after the upstream library is updated.

    What's Changed

    • upgrade [email protected] to [email protected]
    • support variable definition by @superhawk610 in https://github.com/superhawk610/smartcalc-tui/pull/9
    • add support for syntax highlighting by @superhawk610 in https://github.com/superhawk610/smartcalc-tui/pull/10
    • remove spinner by @superhawk610 in https://github.com/superhawk610/smartcalc-tui/pull/12
    • configure tests in CI by @superhawk610 in https://github.com/superhawk610/smartcalc-tui/pull/13
    • Cross-platform support by @zX3no in https://github.com/superhawk610/smartcalc-tui/pull/14
    • v1.0.6 release by @superhawk610 in https://github.com/superhawk610/smartcalc-tui/pull/15

    New Contributors

    • @zX3no made their first contribution in https://github.com/superhawk610/smartcalc-tui/pull/14

    Full Changelog: https://github.com/superhawk610/smartcalc-tui/commits/v1.0.6

    Source code(tar.gz)
    Source code(zip)
Owner
Aaron Ross
Full stack developer.
Aaron Ross
A Decimal Implementation written in pure Rust suitable for financial calculations.

Decimal   A Decimal implementation written in pure Rust suitable for financial calculations that require significant integral and fractional digits wi

Paul Mason 702 Jan 5, 2023
Shell Of A New Machine: Quickly configure new environments

Shell Of A New Machine soanm is a dead-simple tool for easily configuring new UNIX machines, with almost zero prerequisites on the target machine. All

Ben Weinstein-Raun 41 Dec 22, 2022
McFly - fly through your shell history

McFly - fly through your shell history McFly replaces your default ctrl-r shell history search with an intelligent search engine that takes into accou

Andrew Cantino 4.8k Jan 7, 2023
The-way - A code snippets manager for your terminal.

The Way A code snippets manager for your terminal. Record and retrieve snippets you use every day, or once in a blue moon, without having to spin up a

OutOfCheeseError 254 Jan 7, 2023
🚩 Show sensitive command summary when open a new terminal

?? Show sensitive command summary when open a new terminal ?? Clear sensitive commands from shell history ?? Stash your history command before present

Rusty Ferris Club 161 Dec 26, 2022
A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.

Terminal Media Player View images, videos (files or YouTube links), webcam, etc directly in the terminal as ASCII. All images you see below are just m

Max Curzi 36 May 8, 2023
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

hmirin 5 Jun 20, 2023
A simple and efficient terminal UI implementation with ratatui.rs for getting quick insights from csv files right on the terminal

CSV-GREP csv-grep is an intuitive TUI application writting with ratatui.rs for reading, viewing and quickly analysing csv files right on the terminal.

Anthony Ezeabasili 16 Mar 10, 2024
🤖 just is a handy way to save and run project-specific commands.

just just is a handy way to save and run project-specific commands. (非官方中文文档,这里,快看过来!) Commands, called recipes, are stored in a file called justfile

Casey Rodarmor 8.2k Jan 5, 2023
The dead easy way to use config files in your rust project

Configr The dead easy way to use config files in your project This will load a config.toml file if it exists, otherwise it will create the needed fold

Carsten Kragelund Jørgensen 4 Jul 1, 2022
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your V

Guillem Jara 86 Dec 12, 2022
⚡️ A blazing fast way of maintaining powerful notes with connections between them.

Zettl ⚡️ A blazing fast way of maintaining powerful notes with connections between them. Installing Zettl To install Zettl, you will need the Rust too

Tirth Jain 26 Dec 2, 2022
Irx-config - The library provides convenient way to represent/parse configuration from different sources

The irx-config library provides convenient way to represent/parse configuration from different sources. The main goals is to be very easy to use and t

Andriy Bakay 2 Sep 14, 2022
Oxygen is a voice journal and audio analysis toolkit for people who want to change the way their voice comes across.

Oxygen Voice Journal Oxygen is a voice journal and audio analysis toolkit for people who want to change the way their voice comes across. Or rather, i

Jocelyn Stericker 32 Oct 20, 2022
A handy way to handle sh/bash cli parameters

Argc A handy way to handle sh/bash cli parameters. How Argc works To write a command line program with Argc, we only need to do two things: Describe t

null 398 Jan 3, 2023
tkn-watch - watch a PipelineRuns on its way to success or failures

tkn-watch - watch a PipelineRuns on its way to success or failures tkn-watch is a simple extension to the tkn command line tool that watches a Pipelin

Chmouel Boudjnah 11 Dec 15, 2022
🚀 A fast & easy way to interface w/ Farcaster.xyz via Rust 🦀

farcaster-rs ?? A simple & easy way to interface with Farcaster via Rust ?? Author: Landon Boles GitHub | Farcaster | Bird App Credits MistApproach To

Landon 29 Dec 15, 2022
Execute Rust code carefully, with extra checking along the way

cargo-careful cargo careful is a tool to run your Rust code extra carefully -- opting into a bunch of nightly-only extra checks that help detect Undef

Ralf Jung 240 Dec 28, 2022
An ascii webcam in your console, written as a way of learning rust.

asciicam An ascii webcam in your console, written as a way of learning rust. asciicam picture of me holding a basketball usage only linux is supported

Vilhelm Bergsøe 3 Nov 15, 2022