Skip to main content

A CLI tool for displaying simple bar graphs from an equation or a csv file

Project description

GraphCalc

About

I consider Desmos funni, so I decided to bring a similar graphing calculator to the terminal! I originally didn't want to bother with pyinstaller, so I didn't even use regex and instead coded parsing logic myself. The program takes in a math function (currently limited in operator support, i plan on adding more math functions later) and samples its value at multiple points. The values are then saved as a .csv and the program renders them with a bar graph

Options

  • --function basic mathematic expression including x. the default (for quick testing) is x*x/4.
  • --x-offset positive integer, moves the "frame of sampling"
  • --x-range range over which the program should sample, default is 8
  • --sample number of samples to use, default is 16
  • --file file for csv output, default is function.csv Run options:
  • --run, invokes termgraph(.py) after outputting the csv values
  • --x-space space available for x axis in terminal, default is 86 to support small terminals, 126 and 168 work well.
  • --label provides termgraph with x axis labels for each sample

Installation

Pyinstaller Download both termgraph and termgraph-calc from the pybuilds folder and place them in the same folder.

Windows Run pip install argparse Download both termgraph.py and termgraph-calc.py from the root folder and place them in the same folder.

Linux/macOS Download both termgraph.py and termgraph-calc.py from the root folder and place them into a folder of your choice. In that folder, run

python3 -m venv .venv
source .venv/bin/activate
pip install argparse

To start the program in the venv, run

source .venv/bin/activate
python3 termgraph-calc.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hc_term_graph-1.0.0.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hc_term_graph-1.0.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file hc_term_graph-1.0.0.tar.gz.

File metadata

  • Download URL: hc_term_graph-1.0.0.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for hc_term_graph-1.0.0.tar.gz
Algorithm Hash digest
SHA256 30918de763aae9ca0eaed54c567a2813655828add574dbb760a287a4c0b318dd
MD5 da936b99a64604a528545f7931cb47ed
BLAKE2b-256 0d6043543a78d826b725b5a5dba7d7e7c865df929c78bc8ba456a620a514cb81

See more details on using hashes here.

File details

Details for the file hc_term_graph-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hc_term_graph-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 040f5b3a8183502bc09eab7351a750d18f90bd55eb3568c779cc2eb45a6b2358
MD5 4e1337395db91366beca061bd322e0e0
BLAKE2b-256 38e90533fd719fb4badf09e054dc0b968358afdbf0197775a07a1691d6ad4ee1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page