Metadata-Version: 2.1
Name: desmos2python
Version: 0.3.2
Summary: seamless conversion between Desmos LaTeX equations and executable Python code.
Home-page: https://github.com/rocapp/desmos2python
Author: Robert Ahlroth Capps
Author-email: rocapp@gmail.com
License: MIT License
        
        Copyright (c) 2022 Robbie Capps
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/rocapp/desmos2python
Project-URL: Issue Tracker, https://github.com/rocapp/desmos2python/issues
Project-URL: Source Code, https://github.com/rocapp/desmos2python
Keywords: desmos,graphing calculator,conversion,convert to python,mathematical modeling
Platform: Windows
Platform: macOS
Platform: Linux
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: setuptools (>=40.6.0)
Requires-Dist: setuptools-scm
Requires-Dist: wheel
Requires-Dist: flake8
Requires-Dist: mypy
Requires-Dist: autopep8
Requires-Dist: pypandoc
Requires-Dist: ipython (>=8.11.0)
Requires-Dist: twine
Requires-Dist: build[virtualenv] (>=0.3.1)
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: jinja2 (==3.1.2)
Requires-Dist: jinja2-cli
Requires-Dist: sympy (==1.11.1)
Requires-Dist: antlr4-python3-runtime (==4.10)
Requires-Dist: selenium
Requires-Dist: pandas (>=1.5.3)
Requires-Dist: svg.path

desmos2python
=============

convert Desmos equations to executable Python code

Links
-----

-  `desmos2python (PyPI) <https://pypi.org/project/desmos2python/>`__
-  `Desmos Graphing Caculator <https://desmos.com/calculator>`__

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:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   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``
