Skip to main content

Minimalist CLI for math & cryptography exploration 🦊

Project description

FoxMath 🦊

Minimalist CLI for math & cryptography exploration.

One binary. Clean output. Zero footguns. Educational by design.

Built with curiosity — for students, tinkerers, and crypto/math enthusiasts.

Features

  • Legendre symbol
  • Euler/Hermann Machin-like π approximation
  • Elliptic curve point addition (over finite fields), including named curves (secp256k1) with on-curve result validation
  • Chinese Remainder Theorem solver (handles non-coprime moduli)
  • Continued fraction expansion and convergents
  • Challenge/quiz mode — practice problems with scoring, or a worksheet mode for self-study
  • Symlink-friendly (foxmath-legendre, foxmath-pi, foxmath-ecadd, foxmath-crt, foxmath-cf, foxmath-challenge)
  • JSON output mode

Installation

pip install foxmath

Or from source:

git clone https://github.com/Abhrankan-Chakrabarti/foxmath.git
cd foxmath
pip install -e .

Usage Examples

foxmath pi --terms 200
π ≈ 3.1415926535897932384626433832795028841971693993752  (200 terms)
foxmath legendre 5 17
Legendre (5/17) = -1
# Symlinks (optional)
foxmath-ecadd --x1 1 --y1 2 --x2 3 --y2 4 --p 17
Result point: (14, 2)
# Named curve (secp256k1) — computes 2G by default
foxmath ecadd --curve secp256k1
Result point: (89565891926547004231252920425935692360644145829622209833684329913297188986597, 12158399299693830322967808612713398636155367887041628176798871954788371653930)
  ✓ on curve
# Chinese Remainder Theorem
foxmath crt --r 2 3 2 --m 3 5 7
x ≡ 23 (mod 105)
# Continued fraction expansion + convergents
foxmath cf --num 355 --den 113
[3; 7, 16]
  3/1
  22/7
  355/113
# Challenge/quiz mode — worksheet (no prompting)
foxmath challenge --topic legendre --count 2 --seed 1 --reveal
1. Legendre symbol (10/13)
   Answer: 1
2. Legendre symbol (3/7)
   Answer: -1

Drop --reveal to answer interactively instead, with scoring at the end. --topic accepts legendre, crt, or mixed (default).

# JSON output
foxmath pi --terms 100 --json
{
  "tool": "foxmath",
  "command": "pi",
  "terms": 100,
  "approx": "3.1415926535897932384626433832795028841971693993752"
}

Why FoxMath?

Because math and cryptography are more fun when you can play with them instantly in the terminal — with the same reliability as FoxPipe and fox-vault.

Simple. Practical. Reliable.

License

MIT © Abhrankan Chakrabarti


Star if you find it useful! Issues and PRs welcome.

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

foxmath-0.5.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

foxmath-0.5.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file foxmath-0.5.0.tar.gz.

File metadata

  • Download URL: foxmath-0.5.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for foxmath-0.5.0.tar.gz
Algorithm Hash digest
SHA256 861945047b53d5bca724914857f0caffcef3f67952c5135e8c8fdfc3add54423
MD5 a83124b7fd5aa7dc9ac86747a7edab43
BLAKE2b-256 149090ba3892a139eebd68c1894a2d201cd43d81b661b436338f7abb4eb2129c

See more details on using hashes here.

File details

Details for the file foxmath-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: foxmath-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for foxmath-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b7146d13e3a324d8575201fd336064608ee4a50cca85ff280a770f96bb4c186
MD5 0728a8cca995ae65c722eae6c096d43d
BLAKE2b-256 6a4ff6541ca79515e8e1abc410b6c998c1feafd9a18101852d225bb81ef13c7e

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