Skip to main content

A general-purpose computer algebra system.

Project description

CI status Pypi Installs Latest Version Supported Python Versions

Packaging status

mathicsscript is a command-line interface to Mathics.

screenshot

See the screenshot directory for a description and another example.

Features

  • prompt_toolkit and GNU Readline terminal interaction. This includes:
    • saving command history between sessions.
    • variable completion, even for symbol names like \\[Sigma]
    • limited ESC keyboard input; for example esc p esc is π
  • Syntax highlighting using mathics-pygments which includes dynamically created variables and functions.
  • Automatic detection of light or dark terminal background color.
  • Optional Graphics rendering via matplotlib for 2D graphics, and Asymptote for 3D graphcs.
  • Entering and displaying Unicode symbols such as used for Pi or Rule arrows
  • Provision for running in non-interactive batch mode which an be used inside POSIX shells

Installing

To install, run

$ make install

To install from git sources so that you run from the git source tree:

$ make develop

Running

Once install run using mathicsscript:

$ mathicsscript
Mathicscript: 3.2.2.dev0, Mathics 3.1.0.dev0
on CPython 3.7.10 (default, Feb 23 2021, 10:13:46)
using SymPy 1.8, mpmath 1.2.1, numpy 1.20.2, cython 0.29.22

Copyright (C) 2011-2021 The Mathics Team.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
See the documentation for the full license.

Quit by evaluating Quit[] or by pressing CONTROL-D.

In[1]:=

For batch use:

$ mathicsscript -c "N[Pi, 30]"
3.14159265358979323846264338328

To read from a file

In file /tmp/test.m:

sum=2+2
integral=Integrate[1,x]
Print["Results: ",{sum,integral}]

Feeding this into mathicsscript:

$ mathicsscript --no-prompt </tmp/test.m
4
x
Results: {4, x}
None

For a full list of options, type mathicsscript --help.

Why not IPython via Jupyter?

There will always be a need for simple terminal-like interaction. Although there is IPython support via Jupyter all of this is pretty heavy-weight. To code to this protocol, a developer needs to write a kernel, and use a wire protocol. This adds complexity not only for the person developing this package, but also for the user who needs to load the extra layers that aren’t used. And when something goes wrong, it is harder to track down problems.

At the other end of the spectrum, if the dependencies of this package are too onerous and you want even simpler, lighter-weight terminal interaction without any of the features mentioned above, use mathics which is distributed as part of the core Mathic3 package.

Download files

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

Files for mathicsscript, version 4.0.0
Filename, size File type Python version Upload date Hashes
Filename, size mathicsscript-4.0.0.tar.gz (56.9 kB) File type Source Python version None Upload date Hashes View
Filename, size mathicsscript-4.0.0-py3.9.egg (83.8 kB) File type Egg Python version 4.0.0 Upload date Hashes View
Filename, size mathicsscript-4.0.0-py3.8.egg (83.8 kB) File type Egg Python version 4.0.0 Upload date Hashes View
Filename, size mathicsscript-4.0.0-py3.7.egg (83.4 kB) File type Egg Python version 4.0.0 Upload date Hashes View
Filename, size mathicsscript-4.0.0-py3.6.egg (83.3 kB) File type Egg Python version 4.0.0 Upload date Hashes View
Filename, size mathicsscript-4.0.0-py2.py3-none-any.whl (57.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page