Skip to main content

convert Desmos equations to executable Python code

Dependencies

Build/Dev

  • GNU Make

  • docker

Libraries

required

  • pandoc (e.g. apt-get install pandoc for Debian-based, or pacman -S pandoc for Arch Linux)

(optional) For headless browser functionality (uses ``selenium``):

  • pyenv

  • libxext6

  • libxt6

  • geckodriver and firefox

Compatibility

  • python3.10

  • NOTE: working on expanding compatibility…

  • NOTE: still a work in progress for sure.

Helpful tips

…definitely recommend using a virtual environment, e.g. via docker or conda.

Install

From PyPi:

python3 -m pip install desmos2python

Examples

DesmosLatexParser API Example:

import desmos2python as d2p

# `file` contains a JSON-formatted list of latex equations
# loads the example defined in 'resources/latex_json/ex.json'
dlp = d2p.DesmosLatexParser(file='ex.json')

# `pycode_string` contains the ready-to-eval Desmos model namespace
print(dlp.pycode_string)

# Instantiate a model namespace
# The attributes define any formulas, parameters from the specified Desmos graph
dmn = dlp.DesmosModelNS()

# for example, evaluate the function E(x) over the domain x=(1, 2, 3)
result = dmn.E([1, 2, 3])
print(result)

# see ./tests for more examples!

Development

  • Build locally: make build

  • Testing: pytest

Release files for desmos2python 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for desmos2python 0.3.4
File Size Uploaded
desmos2python-0.3.4.tar.gz 2.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for desmos2python 0.3.4
File Interpreter ABI Platform
desmos2python-0.3.4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 2.6 MB

Release files / desmos2python-0.3.4.tar.gz

Download URL desmos2python-0.3.4.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
36803b3d9f1fde20964405c63bec0bd062a58109bd8cdc60bf67016c0a7d7654
BLAKE2b-256 checksum
How to use checksums
f7d3ce821fd255a22c6848a59b67d49f5680a50979c0c32ade517cef60829cc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / desmos2python-0.3.4-py2.py3-none-any.whl

Download URL desmos2python-0.3.4-py2.py3-none-any.whl
Size 299.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
13ef67c7eb9212b71349aaa35527a1bfd217cf4be9b8a2b5d786d810b752f73a
BLAKE2b-256 checksum
How to use checksums
5f9e533a3aa3fe7acca2c7d9573d4aa86583fc2dd51649c53e4fd4bb0e7b2f38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.1.1

2 release files

0.0.5

2 release files

0.0.3

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page