Skip to main content

Turn Python calculations into well-formatted, math-rich documents.

Project description

Rubberize Banner

Rubberize

Rubberize converts raw Python code into readable mathematical notation so calculations can be clearly presented, reviewed, and documented.

Who is Rubberize For?

Rubberize is designed for:

  • Scientists and Engineers: Simplify the presentation of complex calculations in Jupyter notebooks by rendering them as clear, typeset math.
  • Educators and Students: Create visually appealing and easy-to-understand mathematical explanations directly from Python code.
  • Technical Writers: Generate LaTeX representations of Python calculations for seamless integration into professional-grade documents.

If you work with Python code that involves mathematical computations and want to bridge the gap between raw code and polished documentation, Rubberize is for you!

Installation

Install Rubberize with pip:

pip install rubberize

To include dependencies that allow Rubberize to be used with Jupyter Notebooks:

pip install "rubberize[jupyter]"

Quick Start

[!WARNING] Use of eval(): This project uses Python's built-in eval() to evaluate some expressions. Since it executes code already present in the input source (e.g., a Jupyter cell or script), it poses no additional risk in such environments. However, be cautious when handling untrusted inputs outside controlled settings.

In a Jupyter notebook, load the extension:

%load_ext rubberize

Use the %%tap magic:

%%tap
import math
a = 3
b = 4
c = math.sqrt(a**2 + b**2)

  $\displaystyle a = 3$

  $\displaystyle b = 4$

  $\displaystyle c = \sqrt{a^{2} + b^{2}} = \sqrt{3^{2} + 4^{2}} = 5.00$

Documentation

Full tutorials, configuration options, and examples are found in Rubberize Documentation.

Why The Names?

Rubberize is inspired by tapping rubber trees for latex.

The %%tap command taps a code cell and extracts LaTeX, turning ordinary Python calculations into structured mathematical output.

Contributing

If you’re interested in contributing or mentoring, please feel free to contact me. I’m eager to collaborate to make Rubberize even better.

Setting Up for Development

Clone the repository:

git clone https://github.com/chitoperalta/rubberize.git
cd rubberize

Set up a virtual environment (recommended):

python -m venv .venv
source .venv/bin/activate
# Windows: .venv\Scripts\activate

Install Rubberize in editable mode with development dependencies:

pip install -e ".[dev]"

License

MIT License © 2025-2026 Chito Peralta and contributors.

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

rubberize-0.4.2.post1.tar.gz (62.7 kB view details)

Uploaded Source

Built Distribution

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

rubberize-0.4.2.post1-py3-none-any.whl (77.0 kB view details)

Uploaded Python 3

File details

Details for the file rubberize-0.4.2.post1.tar.gz.

File metadata

  • Download URL: rubberize-0.4.2.post1.tar.gz
  • Upload date:
  • Size: 62.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rubberize-0.4.2.post1.tar.gz
Algorithm Hash digest
SHA256 e410688cfe38fa806a495377111e187ad90c623ce5805a1907258c4ed8ac4bb8
MD5 8c7c00441df8a1c86bffe06abe8de244
BLAKE2b-256 5a7696c75351afc0bda20d03a3d36d9497d2f29585eea4c859d9af4625c9ae1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rubberize-0.4.2.post1.tar.gz:

Publisher: publish.yml on chitoperalta/rubberize

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rubberize-0.4.2.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for rubberize-0.4.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 26c4da0f431182fad90710a105347ac804f1827373b451501c5eb0b3534d7ae9
MD5 da1e31d33fcc9295a7bc8cac74adbfad
BLAKE2b-256 12500c081e30caa92f21aa628378fb7f336e27956e783fafaa7e48a262a34104

See more details on using hashes here.

Provenance

The following attestation bundles were made for rubberize-0.4.2.post1-py3-none-any.whl:

Publisher: publish.yml on chitoperalta/rubberize

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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