Name | mpxpy JSON |
Version |
0.0.17
JSON |
| download |
home_page | None |
Summary | Official Mathpix client for Python |
upload_time | 2025-07-16 19:30:22 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License
Copyright (c) [year] [fullname]
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. |
keywords |
mathpix
mpx
mpxpy
py
client
ocr
api
sdk
python
package
development
|
VCS |
 |
bugtrack_url |
|
requirements |
requests
python-dotenv
pydantic
pytest
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# mpxpy
The official Python client for the Mathpix API. Process PDFs and images, and convert math/text content with the Mathpix API.
# Setup
## Installation
```bash
pip install mpxpy
```
## Authentication
You'll need a Mathpix API app_id and app_key to use this client. You can get these from [Mathpix Console](https://console.mathpix.com/).
Set your credentials by either:
- Using environment variables
- Passing them directly when initializing the client
MathpixClient will prioritize auth configs in the following order:
1. Passed through arguments
2. The `~/.mpx/config` file
3. ENV vars located in `.env`
4. ENV vars located in `local.env`
## Initialization
### Using environment variables
Create a config file at `~/.mpx/config` or add ENV variables to `.env` or `local.env` files:
```
MATHPIX_APP_ID=your-app-id
MATHPIX_APP_KEY=your-app-key
MATHPIX_URL=https://api.mathpix.com # optional, defaults to this value
```
Then initialize the client:
```python
from mpxpy.mathpix_client import MathpixClient
# Will use ~/.mpx/config or environment variables
client = MathpixClient()
```
### Using arguments
You can also pass in your App ID and App Key when initializing the client:
```python
from mpxpy.mathpix_client import MathpixClient
client = MathpixClient(
app_id="your-app-id",
app_key="your-app-key"
# Optional "api_url" argument sets the base URL. This can be useful for development with on-premise deployments
)
```
### Improve Mathpix
You can optionally set `improve_mathpix` to False to prevent Mathpix from retaining any outputs from a client. This can also be set on a per-request-basis, but if a client has `improve_mathpix` disabled, all requests made using that client will also be disabled.
```python
from mpxpy.mathpix_client import MathpixClient
client = MathpixClient(
improve_mathpix=False
)
```
# Process PDFs
## Basic Usage
```python
from mpxpy.mathpix_client import MathpixClient
client = MathpixClient(
app_id="your-app-id",
app_key="your-app-key"
)
# Process a PDF file with multiple conversion formats and options
pdf = client.pdf_new(
file_path='/path/to/pdf/sample.pdf',
convert_to_docx=True,
convert_to_md=True,
convert_to_pptx=True,
convert_to_md_zip=True,
# Optional pdf-level improve_mathpix argument is default True
)
# Wait for processing to complete. Optional timeout argument is 60 seconds by default.
pdf.wait_until_complete(timeout=30)
# Get the Markdown outputs
md_output_path = pdf.to_md_file(path='output/sample.md')
md_text = pdf.to_md_text() # is type str
print(md_text)
# Get the DOCX outputs
docx_output_path = pdf.to_docx_file(path='output/sample.docx')
docx_bytes = pdf.to_docx_bytes() # is type bytes
# Get the PowerPoint outputs
pptx_output_path = pdf.to_pptx_file(path='output/sample.pptx')
pptx_bytes = pdf.to_pptx_bytes() # is type bytes
# Get the Markdown ZIP outputs (includes embedded images)
md_zip_output_path = pdf.to_md_zip_file(path='output/sample.md.zip')
md_zip_bytes = pdf.to_md_zip_bytes() # is type bytes
# Get the JSON outputs
lines_json_output_path = pdf.to_lines_json_file(path='output/sample.lines.json')
lines_json = pdf.to_lines_json() # parses JSON into type Dict
```
# Process Images
## Basic Usage
```python
from mpxpy.mathpix_client import MathpixClient
client = MathpixClient(
app_id="your-app-id",
app_key="your-app-key"
)
# Process an image file
image = client.image_new(
file_path='/path/to/image/sample.jpg',
# Optional image-level improve_mathpix argument is default True
)
# Process an image file with various options
tagged_image = client.image_new(
file_path='/path/to/image/sample.jpg',
tags=['tag']
)
include_line_data = client.image_new(
file_path='/path/to/image/sample.jpg',
include_line_data=True
)
# Get the full response
result = image.results()
print(result)
# Get the Mathpix Markdown (MMD) representation
mmd = image.mmd()
print(mmd)
# Get line-by-line OCR data
lines = image.lines_json()
print(lines)
# Make an async image request and get its results
async_image = client.image_new(
file_path='/path/to/image/sample.jpg',
is_async=True
)
async_image.wait_until_complete(timeout=5)
result = async_image.results()
```
# Convert Mathpix Markdown (MMD)
## Basic Usage
```python
from mpxpy.mathpix_client import MathpixClient
client = MathpixClient(
app_id="your-app-id",
app_key="your-app-key"
)
# Similar to Pdf, Conversion class takes separate arguments for each conversion format
conversion = client.conversion_new(
mmd="\\frac{1}{2} + \\sqrt{3}",
convert_to_docx=True,
convert_to_md=True,
convert_to_mmd_zip=True,
convert_to_pptx=True,
)
# Wait for conversion to complete
conversion.wait_until_complete(timeout=30)
# Get the Markdown outputs
md_output_path = conversion.to_md_file(path='output/sample.md')
md_text = conversion.to_md_text() # is of type str
# Get the DOCX outputs
docx_output_path = conversion.to_docx_file(path='output/sample.docx')
docx_bytes = conversion.to_docx_bytes() # is of type bytes
# Get the Mathpix Markdown ZIP outputs (includes embedded images)
mmd_zip_output_path = conversion.to_mmd_zip_file(path='output/sample.mmd.zip')
mmd_zip_bytes = conversion.to_mmd_zip_bytes() # is of type bytes
# Get the PowerPoint outputs
pptx_output_path = conversion.to_pptx_file(path='output/sample.pptx')
pptx_bytes = conversion.to_pptx_bytes() # is of type bytes
```
# Class Definitions
## MathpixClient
The MathpixClient class is used to add authenticate and create requests using the following methods:
### `image_new`
Returns a new Image instance
**Arguments**
- `file_path`: Path to a local image file.
- `url`: URL of a remote image.
- `improve_mathpix`: Optional boolean to enable Mathpix to retain user output.
- `metadata`: Optional dict to attach metadata to a request
- `tags`: Optional list of strings which can be used to identify results using the /v3/ocr-results endpoint
- `is_async`: Optional boolean to enable non-interactive requests
- `callback`: Optional Callback Object (see https://docs.mathpix.com/#callback-object)
- `formats`: Optional list of formats ('text', 'data', 'html', or 'latex_styled')
- `data_options`: Optional DataOptions dict (see https://docs.mathpix.com/#dataoptions-object)
- `include_detected_alphabets`: Optional boolean to return the detected alphabets
- `alphabets_allowed`: Optional dict to list alphabets allowed in the output (see https://docs.mathpix.com/#alphabetsallowed-object)
- `region`: Optional dict to specify the image area with pixel coordinates 'top_left_x', 'top_left_y', 'width', 'height'
- `enable_blue_hsv_filter`: Optional boolean to enable a special mode of image processing where it processes blue hue text exclusively
- `confidence_threshold`: Optional number between 0 and 1 to specify a threshold for triggering confidence errors (file level threshold)
- `confidence_rate_threshold`: Optional number between 0 and 1 to specify a threshold for triggering confidence errors, default 0.75 (symbol level threshold)
- `include_equation_tags`: Optional boolean to specify whether to include equation number tags inside equations LaTeX. When set to True, it sets "idiomatic_eqn_arrays": True because equation numbering works better in those environments compared to the array environment
- `include_line_data`: Optional boolean to return information segmented line by line
- `include_word_data`: Optional boolean to return information segmented word by word
- `include_smiles`: Optional boolean to enable experimental chemistry diagram OCR via RDKIT normalized SMILES
- `include_inchi`: Optional boolean to include InChI data as XML attributes inside <smiles> elements
- `include_geometry_data`: Optional boolean to enable data extraction for geometry diagrams (currently only supports triangle diagrams)
- `include_diagram_text`: Optional boolean to enable text extraction from diagrams (for use with "include_line_data": True). The extracted text will be part of line data, and not part of the "text" or any other output format specified. the "parent_id" of these text lines will correspond to the "id" of one of the diagrams in the line data. Diagrams will also have "children_ids" to store references to those text lines
- `auto_rotate_confidence_threshold`: Optional number between 0 and 1 to specify threshold for auto rotating images to the correct orientation, default 0.99
- `rm_spaces`: Optional boolean to determine whether extra white space is removed from equations in "latex_styled" and "text" formats
- `rm_fonts`: Optional boolean to determine whether font commands such as \mathbf and \mathrm are removed from equations in "latex_styled" and "text" formats
- `idiomatic_eqn_arrays`: Optional boolean to specify whether to use aligned, gathered, or cases instead of an array environment for a list of equations
- `idiomatic_braces`: Optional boolean to specify whether to remove unnecessary braces for LaTeX output
- `numbers_default_to_math`: Optional boolean to specify whether numbers are always math
- `math_fonts_default_to_math`: Optional boolean to specify whether math fonts are always math
- `math_inline_delimiters`: Optional [str, str] tuple to specify begin inline math and end inline math delimiters for "text" outputs
- `math_display_delimiters`: Optional [str, str] tuple to specify begin display math and end display math delimiters for "text" outputs
- `enable_spell_check`: Optional boolean to enable a predictive mode for English handwriting
- `enable_tables_fallback`: Optional boolean to enable an advanced table processing algorithm that supports very large and complex tables
- `fullwidth_punctuation`: Optional boolean to specify whether punctuation will be fullwidth Unicode
### `pdf_new`
Returns a new Pdf instance.
**Arguments**
- `file_path`: Path to a local PDF file.
- `url`: URL of a remote PDF file.
- `metadata`: Optional dict to attach metadata to a request
- `alphabets_allowed`: Optional dict to list alphabets allowed in the output (see https://docs.mathpix.com/#alphabetsallowed-object)
- `rm_spaces`: Optional boolean to determine whether extra white space is removed from equations in "latex_styled" and "text" formats
- `rm_fonts`: Optional boolean to determine whether font commands such as \mathbf and \mathrm are removed from equations in "latex_styled" and "text" formats
- `idiomatic_eqn_arrays`: Optional boolean to specify whether to use aligned, gathered, or cases instead of an array environment for a list of equations
- `include_equation_tags`: Optional boolean to specify whether to include equation number tags inside equations LaTeX. When set to True, it sets "idiomatic_eqn_arrays": True because equation numbering works better in those environments compared to the array environment
- `include_smiles`: Optional boolean to enable experimental chemistry diagram OCR via RDKIT normalized SMILES
- `include_chemistry_as_image`: Optional boolean to return an image crop containing SMILES in the alt-text for chemical diagrams
- `include_diagram_text`: Optional boolean to enable text extraction from diagrams (for use with "include_line_data": True). The extracted text will be part of line data, and not part of the "text" or any other output format specified. the "parent_id" of these text lines will correspond to the "id" of one of the diagrams in the line data. Diagrams will also have "children_ids" to store references to those text lines
- `numbers_default_to_math`: Optional boolean to specify whether numbers are always math
- `math_inline_delimiters`: Optional [str, str] tuple to specify begin inline math and end inline math delimiters for "text" outputs
- `math_display_delimiters`: Optional [str, str] tuple to specify begin display math and end display math delimiters for "text" outputs
- `page_ranges`: Specifies a page range as a comma-separated string. Examples include 2,4-6 which selects pages [2,4,5,6] and 2 - -2 which selects all pages starting with the second page and ending with the next-to-last page
- `enable_spell_check`: Optional boolean to enable a predictive mode for English handwriting
- `auto_number_sections`: Optional[bool] = False,
- `remove_section_numbering`: Specifies whether to remove existing numbering for sections and subsections. Defaults to false
- `preserve_section_numbering`: Specifies whether to keep existing section numbering as is. Defaults to true
- `enable_tables_fallback`: Optional boolean to enable an advanced table processing algorithm that supports very large and complex tables
- `fullwidth_punctuation`: Optional boolean to specify whether punctuation will be fullwidth Unicode
- `convert_to_docx`: Optional boolean to automatically convert your result to docx
- `convert_to_md`: Optional boolean to automatically convert your result to md
- `convert_to_mmd`: Optional boolean to automatically convert your result to mmd
- `convert_to_tex_zip`: Optional boolean to automatically convert your result to tex.zip
- `convert_to_html`: Optional boolean to automatically convert your result to html
- `convert_to_pdf`: Optional boolean to automatically convert your result to pdf
- `convert_to_md_zip`: Optional boolean to automatically convert your result to md.zip
- `convert_to_mmd_zip`: Optional boolean to automatically convert your result to mmd.zip
- `convert_to_pptx`: Optional boolean to automatically convert your result to pptx
- `convert_to_html_zip`: Optional boolean to automatically convert your result to html.zip
- `improve_mathpix`: Optional boolean to enable Mathpix to retain user output. Default is true
- `file_batch_id`: Optional batch ID to associate this file with.
### `conversion_new`
Returns a new Conversion instance.
**Arguments**
- `mmd`: Mathpix Markdown content to convert.
- `convert_to_docx`: Optional boolean to convert your result to docx
- `convert_to_md`: Optional boolean to convert your result to md
- `convert_to_tex_zip`: Optional boolean to convert your result to tex.zip
- `convert_to_html`: Optional boolean to convert your result to html
- `convert_to_pdf`: Optional boolean to convert your result to pdf
- `convert_to_latex_pdf`: Optional boolean to convert your result to pdf containing LaTeX
- `convert_to_md_zip`: Optional boolean to automatically convert your result to md.zip
- `convert_to_mmd_zip`: Optional boolean to automatically convert your result to mmd.zip
- `convert_to_pptx`: Optional boolean to automatically convert your result to pptx
- `convert_to_html_zip`: Optional boolean to automatically convert your result to html.zip
## Pdf Class Documentation
### Properties
- `auth`: An Auth instance with Mathpix credentials.
- `pdf_id`: The unique identifier for this PDF.
- `file_path`: Path to a local PDF file.
- `url`: URL of a remote PDF file.
- `convert_to_docx`: Optional boolean to automatically convert your result to docx
- `convert_to_md`: Optional boolean to automatically convert your result to md
- `convert_to_mmd`: Optional boolean to automatically convert your result to mmd
- `convert_to_tex_zip`: Optional boolean to automatically convert your result to tex.zip
- `convert_to_html`: Optional boolean to automatically convert your result to html
- `convert_to_pdf`: Optional boolean to automatically convert your result to pdf
- `convert_to_md_zip`: Optional boolean to automatically convert your result to md.zip (markdown with local images folder)
- `convert_to_mmd_zip`: Optional boolean to automatically convert your result to mmd.zip (Mathpix markdown with local images folder)
- `convert_to_pptx`: Optional boolean to automatically convert your result to pptx (PowerPoint)
- `convert_to_html_zip`: Optional boolean to automatically convert your result to html.zip (HTML with local images folder)
- `improve_mathpix`: Optional boolean to enable Mathpix to retain user output. Default is true
### Methods
- `wait_until_complete`: Wait for the PDF processing and optional conversions to complete
- `pdf_status`: Get the current status of the PDF processing
- `pdf_conversion_status`: Get the current status of the PDF conversions
- `to_docx_file`: Save the processed PDF result to a DOCX file at a local path
- `to_docx_bytes`: Get the processed PDF result as DOCX bytes
- `to_md_file`: Save the processed PDF result to a Markdown file at a local path
- `to_md_text`: Get the processed PDF result as a Markdown string
- `to_mmd_file`: Save the processed PDF result to a Mathpix Markdown file at a local path
- `to_mmd_text`: Get the processed PDF result as a Mathpix Markdown string
- `to_tex_zip_file`: Save the processed PDF result to a tex.zip file at a local path
- `to_tex_zip_bytes`: Get the processed PDF result in tex.zip format as bytes
- `to_html_file`: Save the processed PDF result to a HTML file at a local path
- `to_html_bytes`: Get the processed PDF result in HTML format as bytes
- `to_pdf_file`: Save the processed PDF result to a PDF file at a local path
- `to_pdf_bytes`: Get the processed PDF result in PDF format as bytes
- `to_lines_json_file`: Save the processed PDF line-by-line result to a JSON file at a local path
- `to_lines_json`: Get the processed PDF result in JSON format
- `to_lines_mmd_json_file`: Save the processed PDF line-by-line result, including Mathpix Markdown, to a JSON file at a local path
- `to_lines_mmd_json`: Get the processed PDF result in JSON format with text in Mathpix Markdown
- `to_md_zip_file`: Save the processed PDF result to a ZIP file containing markdown output and any embedded images
- `to_md_zip_bytes`: Get the processed PDF result in ZIPPED markdown format as bytes
- `to_mmd_zip_file`: Save the processed PDF result to a ZIP file containing Mathpix Markdown output and any embedded images
- `to_mmd_zip_bytes`: Get the processed PDF result in ZIPPED Mathpix Markdown format as bytes
- `to_pptx_file`: Save the processed PDF result to a PPTX file
- `to_pptx_bytes`: Get the processed PDF result in PPTX format as bytes
- `to_html_zip_file`: Save the processed PDF result to a ZIP file containing HTML output and any embedded images
- `to_html_zip_bytes`: Get the processed PDF result in ZIPPED HTML format as bytes
## Image Class Documentation
### Properties
- `auth`: An Auth instance with Mathpix credentials
- `request_id`: A string storing the request_id of the image
- `file_path`: Path to a local image file, if using a local file
- `url`: URL of a remote image, if using a remote file
- `improve_mathpix`: Optional boolean to enable Mathpix to retain user output. Default is true
- `include_line_data`: Optional boolean to include line by line OCR data
- `metadata`: Optional dict to attach metadata to a request
- `is_async`: Optional boolean to enable non-interactive requests
- `result`: A Dict to containing a request's result as initially configured
### Methods
- `results`: Get the full JSON response for the image
- `wait_until_complete`: Wait for async image processing to complete
- `lines_json`: Get line-by-line OCR data for the image
- `mmd`: Get the Mathpix Markdown (MMD) representation of the image
- `latex_styled`: Get the latex_styled representation of the image.
- `html`: Get the html representation of the image.
## Conversion Class Documentation
### Properties
- `auth`: An Auth instance with Mathpix credentials.
- `conversion_id`: The unique identifier for this conversion.
- `convert_to_docx`: Optional boolean to automatically convert your result to docx
- `convert_to_md`: Optional boolean to automatically convert your result to md
- `convert_to_tex_zip`: Optional boolean to automatically convert your result to tex.zip
- `convert_to_html`: Optional boolean to automatically convert your result to html
- `convert_to_pdf`: Optional boolean to automatically convert your result to pdf
- `convert_to_latex_pdf`: Optional boolean to automatically convert your result to pdf containing LaTeX
- `convert_to_md_zip`: Optional boolean to automatically convert your result to md.zip (markdown with local images folder)
- `convert_to_mmd_zip`: Optional boolean to automatically convert your result to mmd.zip (Mathpix markdown with local images folder)
- `convert_to_pptx`: Optional boolean to automatically convert your result to pptx (PowerPoint)
- `convert_to_html_zip`: Optional boolean to automatically convert your result to html.zip (HTML with local images folder)
### Methods
- `wait_until_complete`: Wait for the conversion to complete
- `conversion_status`: Get the current status of the conversion
- `to_docx_file`: Save the processed conversion result to a DOCX file at a local path
- `to_docx_bytes`: Get the processed conversion result as DOCX bytes
- `to_md_file`: Save the processed conversion result to a Markdown file at a local path
- `to_md_text`: Get the processed conversion result as a Markdown string
- `to_mmd_file`: Save the processed conversion result to a Mathpix Markdown file at a local path
- `to_mmd_text`: Get the processed conversion result as a Mathpix Markdown string
- `to_tex_zip_file`: Save the processed conversion result to a tex.zip file at a local path
- `to_tex_zip_bytes`: Get the processed conversion result in tex.zip format as bytes
- `to_html_file`: Save the processed conversion result to a HTML file at a local path
- `to_html_bytes`: Get the processed conversion result in HTML format as bytes
- `to_pdf_file`: Save the processed conversion result to a PDF file at a local path
- `to_pdf_bytes`: Get the processed conversion result in PDF format as bytes
- `to_latex_pdf_file`: Save the processed conversion result to a PDF file containing LaTeX at a local path
- `to_latex_pdf_bytes`: Get the processed conversion result in PDF format as bytes (with LaTeX)
- `to_md_zip_file`: Save the processed conversion result to a ZIP file containing markdown output and any embedded images
- `to_md_zip_bytes`: Get the processed conversion result in ZIPPED markdown format as bytes
- `to_mmd_zip_file`: Save the processed conversion result to a ZIP file containing Mathpix Markdown output and any embedded images
- `to_mmd_zip_bytes`: Get the processed conversion result in ZIPPED Mathpix Markdown format as bytes
- `to_pptx_file`: Save the processed conversion result to a PPTX file
- `to_pptx_bytes`: Get the processed conversion result in PPTX format as bytes
- `to_html_zip_file`: Save the processed PDF result to a ZIP file containing HTML output and any embedded images
- `to_html_zip_bytes`: Get the processed PDF result in ZIPPED HTML format as bytes
# Error Handling
The client provides detailed error information in the following classes:
- MathpixClientError
- AuthenticationError
- ValidationError
- FilesystemError
- ConversionIncompleteError
```python
from mpxpy.mathpix_client import MathpixClient
from mpxpy.errors import MathpixClientError, ConversionIncompleteError
client = MathpixClient(app_id="your-app-id", app_key="your-app-key")
try:
pdf = client.pdf_new(file_path="example.pdf", convert_to_docx=True)
except FileNotFoundError as e:
print(f"File not found: {e}")
except MathpixClientError as e:
print(f"File upload error: {e}")
try:
pdf.to_docx_file('output/path/example.pdf')
except ConversionIncompleteError as e:
print(f'Conversions are not complete')
```
# Development
## Setup
```bash
# Clone the repository
git clone git@github.com:Mathpix/mpxpy.git
cd mpxpy
# Install in development mode
pip install -e .
# Or install using the requirements.txt file
pip install -r requirements.txt
```
## Running Tests
To run tests you will need to add [authentication](#authentication).
```bash
# Install test dependencies
pip install -e ".[dev]"
# Or install using the requirements.txt file
pip install -r requirements.txt
# Run tests
pytest
```
## Logging
To configure the logger level, which is set at `INFO` by default, set the MATHPIX_LOG_LEVEL env variable to the desired logger level.
- `DEBUG`: logs all events, including polling events
- `INFO`: logs all events except for polling events
```
MATHPIX_LOG_LEVEL=DEBUG
```
Raw data
{
"_id": null,
"home_page": null,
"name": "mpxpy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "mathpix, mpx, mpxpy, py, client, ocr, api, sdk, python, package, development",
"author": null,
"author_email": "Nico Jimenez <nicodjimenez@mathpix.com>, Matt Chang <mattchang@mathpix.com>",
"download_url": "https://files.pythonhosted.org/packages/cc/02/41c0669cd87f108e8e686ca9da810c34b0fc51545579d78b4c108e5a2d63/mpxpy-0.0.17.tar.gz",
"platform": null,
"description": "# mpxpy\n\nThe official Python client for the Mathpix API. Process PDFs and images, and convert math/text content with the Mathpix API.\n\n# Setup\n\n## Installation\n\n```bash\npip install mpxpy\n```\n\n## Authentication\n\nYou'll need a Mathpix API app_id and app_key to use this client. You can get these from [Mathpix Console](https://console.mathpix.com/).\n\nSet your credentials by either:\n\n- Using environment variables\n- Passing them directly when initializing the client\n\nMathpixClient will prioritize auth configs in the following order:\n\n1. Passed through arguments\n2. The `~/.mpx/config` file\n3. ENV vars located in `.env`\n4. ENV vars located in `local.env`\n\n## Initialization\n\n### Using environment variables\n\nCreate a config file at `~/.mpx/config` or add ENV variables to `.env` or `local.env` files:\n\n```\nMATHPIX_APP_ID=your-app-id\nMATHPIX_APP_KEY=your-app-key\nMATHPIX_URL=https://api.mathpix.com # optional, defaults to this value\n```\n\nThen initialize the client:\n\n```python\nfrom mpxpy.mathpix_client import MathpixClient\n\n# Will use ~/.mpx/config or environment variables\nclient = MathpixClient()\n```\n\n### Using arguments\n\nYou can also pass in your App ID and App Key when initializing the client:\n\n```python\nfrom mpxpy.mathpix_client import MathpixClient\n\nclient = MathpixClient(\n app_id=\"your-app-id\",\n app_key=\"your-app-key\"\n # Optional \"api_url\" argument sets the base URL. This can be useful for development with on-premise deployments\n)\n```\n\n### Improve Mathpix\n\nYou can optionally set `improve_mathpix` to False to prevent Mathpix from retaining any outputs from a client. This can also be set on a per-request-basis, but if a client has `improve_mathpix` disabled, all requests made using that client will also be disabled.\n\n```python\nfrom mpxpy.mathpix_client import MathpixClient\n\nclient = MathpixClient(\n improve_mathpix=False\n)\n```\n\n# Process PDFs\n\n## Basic Usage\n\n```python\nfrom mpxpy.mathpix_client import MathpixClient\n\nclient = MathpixClient(\n app_id=\"your-app-id\",\n app_key=\"your-app-key\"\n)\n\n# Process a PDF file with multiple conversion formats and options\npdf = client.pdf_new(\n file_path='/path/to/pdf/sample.pdf',\n convert_to_docx=True,\n convert_to_md=True,\n convert_to_pptx=True,\n convert_to_md_zip=True,\n # Optional pdf-level improve_mathpix argument is default True\n)\n\n# Wait for processing to complete. Optional timeout argument is 60 seconds by default.\npdf.wait_until_complete(timeout=30)\n\n# Get the Markdown outputs\nmd_output_path = pdf.to_md_file(path='output/sample.md')\nmd_text = pdf.to_md_text() # is type str\nprint(md_text)\n\n# Get the DOCX outputs\ndocx_output_path = pdf.to_docx_file(path='output/sample.docx')\ndocx_bytes = pdf.to_docx_bytes() # is type bytes\n\n# Get the PowerPoint outputs\npptx_output_path = pdf.to_pptx_file(path='output/sample.pptx')\npptx_bytes = pdf.to_pptx_bytes() # is type bytes\n\n# Get the Markdown ZIP outputs (includes embedded images)\nmd_zip_output_path = pdf.to_md_zip_file(path='output/sample.md.zip')\nmd_zip_bytes = pdf.to_md_zip_bytes() # is type bytes\n\n# Get the JSON outputs\nlines_json_output_path = pdf.to_lines_json_file(path='output/sample.lines.json')\nlines_json = pdf.to_lines_json() # parses JSON into type Dict\n```\n\n# Process Images\n\n## Basic Usage\n\n```python\nfrom mpxpy.mathpix_client import MathpixClient\n\nclient = MathpixClient(\n app_id=\"your-app-id\",\n app_key=\"your-app-key\"\n)\n# Process an image file\nimage = client.image_new(\n file_path='/path/to/image/sample.jpg',\n # Optional image-level improve_mathpix argument is default True\n)\n\n# Process an image file with various options\ntagged_image = client.image_new(\n file_path='/path/to/image/sample.jpg',\n tags=['tag']\n)\ninclude_line_data = client.image_new(\n file_path='/path/to/image/sample.jpg',\n include_line_data=True\n)\n\n# Get the full response\nresult = image.results()\nprint(result)\n\n# Get the Mathpix Markdown (MMD) representation\nmmd = image.mmd()\nprint(mmd)\n\n# Get line-by-line OCR data\nlines = image.lines_json()\nprint(lines)\n\n# Make an async image request and get its results\nasync_image = client.image_new(\n file_path='/path/to/image/sample.jpg',\n is_async=True\n)\nasync_image.wait_until_complete(timeout=5)\nresult = async_image.results()\n```\n\n\n# Convert Mathpix Markdown (MMD)\n\n## Basic Usage\n\n```python\nfrom mpxpy.mathpix_client import MathpixClient\n\nclient = MathpixClient(\n app_id=\"your-app-id\",\n app_key=\"your-app-key\"\n)\n\n# Similar to Pdf, Conversion class takes separate arguments for each conversion format\nconversion = client.conversion_new(\n mmd=\"\\\\frac{1}{2} + \\\\sqrt{3}\",\n convert_to_docx=True,\n convert_to_md=True,\n convert_to_mmd_zip=True,\n convert_to_pptx=True,\n)\n\n# Wait for conversion to complete\nconversion.wait_until_complete(timeout=30)\n\n# Get the Markdown outputs\nmd_output_path = conversion.to_md_file(path='output/sample.md')\nmd_text = conversion.to_md_text() # is of type str\n\n# Get the DOCX outputs\ndocx_output_path = conversion.to_docx_file(path='output/sample.docx')\ndocx_bytes = conversion.to_docx_bytes() # is of type bytes\n\n# Get the Mathpix Markdown ZIP outputs (includes embedded images)\nmmd_zip_output_path = conversion.to_mmd_zip_file(path='output/sample.mmd.zip')\nmmd_zip_bytes = conversion.to_mmd_zip_bytes() # is of type bytes\n\n# Get the PowerPoint outputs\npptx_output_path = conversion.to_pptx_file(path='output/sample.pptx')\npptx_bytes = conversion.to_pptx_bytes() # is of type bytes\n```\n\n# Class Definitions\n\n## MathpixClient\n\nThe MathpixClient class is used to add authenticate and create requests using the following methods:\n\n### `image_new`\n\nReturns a new Image instance\n\n**Arguments**\n\n- `file_path`: Path to a local image file.\n- `url`: URL of a remote image.\n- `improve_mathpix`: Optional boolean to enable Mathpix to retain user output.\n- `metadata`: Optional dict to attach metadata to a request\n- `tags`: Optional list of strings which can be used to identify results using the /v3/ocr-results endpoint\n- `is_async`: Optional boolean to enable non-interactive requests\n- `callback`: Optional Callback Object (see https://docs.mathpix.com/#callback-object)\n- `formats`: Optional list of formats ('text', 'data', 'html', or 'latex_styled')\n- `data_options`: Optional DataOptions dict (see https://docs.mathpix.com/#dataoptions-object)\n- `include_detected_alphabets`: Optional boolean to return the detected alphabets\n- `alphabets_allowed`: Optional dict to list alphabets allowed in the output (see https://docs.mathpix.com/#alphabetsallowed-object)\n- `region`: Optional dict to specify the image area with pixel coordinates 'top_left_x', 'top_left_y', 'width', 'height'\n- `enable_blue_hsv_filter`: Optional boolean to enable a special mode of image processing where it processes blue hue text exclusively\n- `confidence_threshold`: Optional number between 0 and 1 to specify a threshold for triggering confidence errors (file level threshold)\n- `confidence_rate_threshold`: Optional number between 0 and 1 to specify a threshold for triggering confidence errors, default 0.75 (symbol level threshold)\n- `include_equation_tags`: Optional boolean to specify whether to include equation number tags inside equations LaTeX. When set to True, it sets \"idiomatic_eqn_arrays\": True because equation numbering works better in those environments compared to the array environment\n- `include_line_data`: Optional boolean to return information segmented line by line\n- `include_word_data`: Optional boolean to return information segmented word by word\n- `include_smiles`: Optional boolean to enable experimental chemistry diagram OCR via RDKIT normalized SMILES\n- `include_inchi`: Optional boolean to include InChI data as XML attributes inside <smiles> elements\n- `include_geometry_data`: Optional boolean to enable data extraction for geometry diagrams (currently only supports triangle diagrams)\n- `include_diagram_text`: Optional boolean to enable text extraction from diagrams (for use with \"include_line_data\": True). The extracted text will be part of line data, and not part of the \"text\" or any other output format specified. the \"parent_id\" of these text lines will correspond to the \"id\" of one of the diagrams in the line data. Diagrams will also have \"children_ids\" to store references to those text lines\n- `auto_rotate_confidence_threshold`: Optional number between 0 and 1 to specify threshold for auto rotating images to the correct orientation, default 0.99\n- `rm_spaces`: Optional boolean to determine whether extra white space is removed from equations in \"latex_styled\" and \"text\" formats\n- `rm_fonts`: Optional boolean to determine whether font commands such as \\mathbf and \\mathrm are removed from equations in \"latex_styled\" and \"text\" formats\n- `idiomatic_eqn_arrays`: Optional boolean to specify whether to use aligned, gathered, or cases instead of an array environment for a list of equations\n- `idiomatic_braces`: Optional boolean to specify whether to remove unnecessary braces for LaTeX output\n- `numbers_default_to_math`: Optional boolean to specify whether numbers are always math\n- `math_fonts_default_to_math`: Optional boolean to specify whether math fonts are always math\n- `math_inline_delimiters`: Optional [str, str] tuple to specify begin inline math and end inline math delimiters for \"text\" outputs\n- `math_display_delimiters`: Optional [str, str] tuple to specify begin display math and end display math delimiters for \"text\" outputs\n- `enable_spell_check`: Optional boolean to enable a predictive mode for English handwriting\n- `enable_tables_fallback`: Optional boolean to enable an advanced table processing algorithm that supports very large and complex tables\n- `fullwidth_punctuation`: Optional boolean to specify whether punctuation will be fullwidth Unicode\n\n### `pdf_new`\n\nReturns a new Pdf instance. \n\n**Arguments**\n\n- `file_path`: Path to a local PDF file.\n- `url`: URL of a remote PDF file.\n- `metadata`: Optional dict to attach metadata to a request\n- `alphabets_allowed`: Optional dict to list alphabets allowed in the output (see https://docs.mathpix.com/#alphabetsallowed-object)\n- `rm_spaces`: Optional boolean to determine whether extra white space is removed from equations in \"latex_styled\" and \"text\" formats\n- `rm_fonts`: Optional boolean to determine whether font commands such as \\mathbf and \\mathrm are removed from equations in \"latex_styled\" and \"text\" formats\n- `idiomatic_eqn_arrays`: Optional boolean to specify whether to use aligned, gathered, or cases instead of an array environment for a list of equations\n- `include_equation_tags`: Optional boolean to specify whether to include equation number tags inside equations LaTeX. When set to True, it sets \"idiomatic_eqn_arrays\": True because equation numbering works better in those environments compared to the array environment\n- `include_smiles`: Optional boolean to enable experimental chemistry diagram OCR via RDKIT normalized SMILES\n- `include_chemistry_as_image`: Optional boolean to return an image crop containing SMILES in the alt-text for chemical diagrams\n- `include_diagram_text`: Optional boolean to enable text extraction from diagrams (for use with \"include_line_data\": True). The extracted text will be part of line data, and not part of the \"text\" or any other output format specified. the \"parent_id\" of these text lines will correspond to the \"id\" of one of the diagrams in the line data. Diagrams will also have \"children_ids\" to store references to those text lines\n- `numbers_default_to_math`: Optional boolean to specify whether numbers are always math\n- `math_inline_delimiters`: Optional [str, str] tuple to specify begin inline math and end inline math delimiters for \"text\" outputs\n- `math_display_delimiters`: Optional [str, str] tuple to specify begin display math and end display math delimiters for \"text\" outputs\n- `page_ranges`: Specifies a page range as a comma-separated string. Examples include 2,4-6 which selects pages [2,4,5,6] and 2 - -2 which selects all pages starting with the second page and ending with the next-to-last page\n- `enable_spell_check`: Optional boolean to enable a predictive mode for English handwriting\n- `auto_number_sections`: Optional[bool] = False,\n- `remove_section_numbering`: Specifies whether to remove existing numbering for sections and subsections. Defaults to false\n- `preserve_section_numbering`: Specifies whether to keep existing section numbering as is. Defaults to true\n- `enable_tables_fallback`: Optional boolean to enable an advanced table processing algorithm that supports very large and complex tables\n- `fullwidth_punctuation`: Optional boolean to specify whether punctuation will be fullwidth Unicode\n- `convert_to_docx`: Optional boolean to automatically convert your result to docx\n- `convert_to_md`: Optional boolean to automatically convert your result to md\n- `convert_to_mmd`: Optional boolean to automatically convert your result to mmd\n- `convert_to_tex_zip`: Optional boolean to automatically convert your result to tex.zip\n- `convert_to_html`: Optional boolean to automatically convert your result to html\n- `convert_to_pdf`: Optional boolean to automatically convert your result to pdf\n- `convert_to_md_zip`: Optional boolean to automatically convert your result to md.zip\n- `convert_to_mmd_zip`: Optional boolean to automatically convert your result to mmd.zip\n- `convert_to_pptx`: Optional boolean to automatically convert your result to pptx\n- `convert_to_html_zip`: Optional boolean to automatically convert your result to html.zip\n- `improve_mathpix`: Optional boolean to enable Mathpix to retain user output. Default is true\n- `file_batch_id`: Optional batch ID to associate this file with.\n\n### `conversion_new`\n\nReturns a new Conversion instance. \n\n**Arguments**\n\n- `mmd`: Mathpix Markdown content to convert.\n- `convert_to_docx`: Optional boolean to convert your result to docx\n- `convert_to_md`: Optional boolean to convert your result to md\n- `convert_to_tex_zip`: Optional boolean to convert your result to tex.zip\n- `convert_to_html`: Optional boolean to convert your result to html\n- `convert_to_pdf`: Optional boolean to convert your result to pdf\n- `convert_to_latex_pdf`: Optional boolean to convert your result to pdf containing LaTeX\n- `convert_to_md_zip`: Optional boolean to automatically convert your result to md.zip\n- `convert_to_mmd_zip`: Optional boolean to automatically convert your result to mmd.zip\n- `convert_to_pptx`: Optional boolean to automatically convert your result to pptx\n- `convert_to_html_zip`: Optional boolean to automatically convert your result to html.zip\n\n## Pdf Class Documentation\n\n### Properties\n\n- `auth`: An Auth instance with Mathpix credentials.\n- `pdf_id`: The unique identifier for this PDF.\n- `file_path`: Path to a local PDF file.\n- `url`: URL of a remote PDF file.\n- `convert_to_docx`: Optional boolean to automatically convert your result to docx\n- `convert_to_md`: Optional boolean to automatically convert your result to md\n- `convert_to_mmd`: Optional boolean to automatically convert your result to mmd\n- `convert_to_tex_zip`: Optional boolean to automatically convert your result to tex.zip\n- `convert_to_html`: Optional boolean to automatically convert your result to html\n- `convert_to_pdf`: Optional boolean to automatically convert your result to pdf\n- `convert_to_md_zip`: Optional boolean to automatically convert your result to md.zip (markdown with local images folder)\n- `convert_to_mmd_zip`: Optional boolean to automatically convert your result to mmd.zip (Mathpix markdown with local images folder)\n- `convert_to_pptx`: Optional boolean to automatically convert your result to pptx (PowerPoint)\n- `convert_to_html_zip`: Optional boolean to automatically convert your result to html.zip (HTML with local images folder)\n- `improve_mathpix`: Optional boolean to enable Mathpix to retain user output. Default is true\n\n### Methods\n\n- `wait_until_complete`: Wait for the PDF processing and optional conversions to complete\n- `pdf_status`: Get the current status of the PDF processing\n- `pdf_conversion_status`: Get the current status of the PDF conversions\n- `to_docx_file`: Save the processed PDF result to a DOCX file at a local path\n- `to_docx_bytes`: Get the processed PDF result as DOCX bytes\n- `to_md_file`: Save the processed PDF result to a Markdown file at a local path\n- `to_md_text`: Get the processed PDF result as a Markdown string\n- `to_mmd_file`: Save the processed PDF result to a Mathpix Markdown file at a local path\n- `to_mmd_text`: Get the processed PDF result as a Mathpix Markdown string\n- `to_tex_zip_file`: Save the processed PDF result to a tex.zip file at a local path\n- `to_tex_zip_bytes`: Get the processed PDF result in tex.zip format as bytes\n- `to_html_file`: Save the processed PDF result to a HTML file at a local path\n- `to_html_bytes`: Get the processed PDF result in HTML format as bytes\n- `to_pdf_file`: Save the processed PDF result to a PDF file at a local path\n- `to_pdf_bytes`: Get the processed PDF result in PDF format as bytes\n- `to_lines_json_file`: Save the processed PDF line-by-line result to a JSON file at a local path\n- `to_lines_json`: Get the processed PDF result in JSON format\n- `to_lines_mmd_json_file`: Save the processed PDF line-by-line result, including Mathpix Markdown, to a JSON file at a local path\n- `to_lines_mmd_json`: Get the processed PDF result in JSON format with text in Mathpix Markdown\n- `to_md_zip_file`: Save the processed PDF result to a ZIP file containing markdown output and any embedded images\n- `to_md_zip_bytes`: Get the processed PDF result in ZIPPED markdown format as bytes\n- `to_mmd_zip_file`: Save the processed PDF result to a ZIP file containing Mathpix Markdown output and any embedded images\n- `to_mmd_zip_bytes`: Get the processed PDF result in ZIPPED Mathpix Markdown format as bytes\n- `to_pptx_file`: Save the processed PDF result to a PPTX file\n- `to_pptx_bytes`: Get the processed PDF result in PPTX format as bytes\n- `to_html_zip_file`: Save the processed PDF result to a ZIP file containing HTML output and any embedded images\n- `to_html_zip_bytes`: Get the processed PDF result in ZIPPED HTML format as bytes\n\n## Image Class Documentation\n\n### Properties\n\n- `auth`: An Auth instance with Mathpix credentials\n- `request_id`: A string storing the request_id of the image\n- `file_path`: Path to a local image file, if using a local file\n- `url`: URL of a remote image, if using a remote file\n- `improve_mathpix`: Optional boolean to enable Mathpix to retain user output. Default is true\n- `include_line_data`: Optional boolean to include line by line OCR data\n- `metadata`: Optional dict to attach metadata to a request\n- `is_async`: Optional boolean to enable non-interactive requests\n- `result`: A Dict to containing a request's result as initially configured\n\n### Methods\n\n- `results`: Get the full JSON response for the image\n- `wait_until_complete`: Wait for async image processing to complete\n- `lines_json`: Get line-by-line OCR data for the image\n- `mmd`: Get the Mathpix Markdown (MMD) representation of the image\n- `latex_styled`: Get the latex_styled representation of the image.\n- `html`: Get the html representation of the image.\n\n## Conversion Class Documentation\n\n### Properties\n\n- `auth`: An Auth instance with Mathpix credentials.\n- `conversion_id`: The unique identifier for this conversion.\n- `convert_to_docx`: Optional boolean to automatically convert your result to docx\n- `convert_to_md`: Optional boolean to automatically convert your result to md\n- `convert_to_tex_zip`: Optional boolean to automatically convert your result to tex.zip\n- `convert_to_html`: Optional boolean to automatically convert your result to html\n- `convert_to_pdf`: Optional boolean to automatically convert your result to pdf\n- `convert_to_latex_pdf`: Optional boolean to automatically convert your result to pdf containing LaTeX\n- `convert_to_md_zip`: Optional boolean to automatically convert your result to md.zip (markdown with local images folder)\n- `convert_to_mmd_zip`: Optional boolean to automatically convert your result to mmd.zip (Mathpix markdown with local images folder)\n- `convert_to_pptx`: Optional boolean to automatically convert your result to pptx (PowerPoint)\n- `convert_to_html_zip`: Optional boolean to automatically convert your result to html.zip (HTML with local images folder)\n\n### Methods\n\n- `wait_until_complete`: Wait for the conversion to complete\n- `conversion_status`: Get the current status of the conversion\n- `to_docx_file`: Save the processed conversion result to a DOCX file at a local path\n- `to_docx_bytes`: Get the processed conversion result as DOCX bytes\n- `to_md_file`: Save the processed conversion result to a Markdown file at a local path\n- `to_md_text`: Get the processed conversion result as a Markdown string\n- `to_mmd_file`: Save the processed conversion result to a Mathpix Markdown file at a local path\n- `to_mmd_text`: Get the processed conversion result as a Mathpix Markdown string\n- `to_tex_zip_file`: Save the processed conversion result to a tex.zip file at a local path\n- `to_tex_zip_bytes`: Get the processed conversion result in tex.zip format as bytes\n- `to_html_file`: Save the processed conversion result to a HTML file at a local path\n- `to_html_bytes`: Get the processed conversion result in HTML format as bytes\n- `to_pdf_file`: Save the processed conversion result to a PDF file at a local path\n- `to_pdf_bytes`: Get the processed conversion result in PDF format as bytes\n- `to_latex_pdf_file`: Save the processed conversion result to a PDF file containing LaTeX at a local path\n- `to_latex_pdf_bytes`: Get the processed conversion result in PDF format as bytes (with LaTeX)\n- `to_md_zip_file`: Save the processed conversion result to a ZIP file containing markdown output and any embedded images\n- `to_md_zip_bytes`: Get the processed conversion result in ZIPPED markdown format as bytes\n- `to_mmd_zip_file`: Save the processed conversion result to a ZIP file containing Mathpix Markdown output and any embedded images\n- `to_mmd_zip_bytes`: Get the processed conversion result in ZIPPED Mathpix Markdown format as bytes\n- `to_pptx_file`: Save the processed conversion result to a PPTX file\n- `to_pptx_bytes`: Get the processed conversion result in PPTX format as bytes\n- `to_html_zip_file`: Save the processed PDF result to a ZIP file containing HTML output and any embedded images\n- `to_html_zip_bytes`: Get the processed PDF result in ZIPPED HTML format as bytes\n\n# Error Handling\n\nThe client provides detailed error information in the following classes:\n\n- MathpixClientError\n- AuthenticationError\n- ValidationError\n- FilesystemError\n- ConversionIncompleteError\n\n```python\nfrom mpxpy.mathpix_client import MathpixClient\nfrom mpxpy.errors import MathpixClientError, ConversionIncompleteError\n\nclient = MathpixClient(app_id=\"your-app-id\", app_key=\"your-app-key\")\n\ntry:\n pdf = client.pdf_new(file_path=\"example.pdf\", convert_to_docx=True)\nexcept FileNotFoundError as e:\n print(f\"File not found: {e}\")\nexcept MathpixClientError as e:\n print(f\"File upload error: {e}\")\ntry:\n pdf.to_docx_file('output/path/example.pdf')\nexcept ConversionIncompleteError as e:\n print(f'Conversions are not complete')\n```\n\n# Development\n\n## Setup\n\n```bash\n# Clone the repository\ngit clone git@github.com:Mathpix/mpxpy.git\ncd mpxpy\n\n# Install in development mode\npip install -e .\n# Or install using the requirements.txt file\npip install -r requirements.txt\n```\n\n## Running Tests\n\nTo run tests you will need to add [authentication](#authentication).\n\n```bash\n# Install test dependencies\npip install -e \".[dev]\"\n# Or install using the requirements.txt file\npip install -r requirements.txt\n# Run tests\npytest\n```\n\n## Logging\n\nTo configure the logger level, which is set at `INFO` by default, set the MATHPIX_LOG_LEVEL env variable to the desired logger level. \n\n- `DEBUG`: logs all events, including polling events\n- `INFO`: logs all events except for polling events\n\n```\nMATHPIX_LOG_LEVEL=DEBUG\n```\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) [year] [fullname]\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Official Mathpix client for Python",
"version": "0.0.17",
"project_urls": {
"Bug Tracker": "https://github.com/Mathpix/mpxpy/issues",
"Homepage": "https://github.com/Mathpix/mpxpy",
"Repository": "https://github.com/Mathpix/mpxpy"
},
"split_keywords": [
"mathpix",
" mpx",
" mpxpy",
" py",
" client",
" ocr",
" api",
" sdk",
" python",
" package",
" development"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "190420bae57f11314004d2ec7ee9a17998e7741c47efa55b6d2cdf2cdd241568",
"md5": "33546f9a73fc678e38b18b92295e2041",
"sha256": "4c44899c4ed41edb49741b1a2e8e99497230b4550b2bd2347c32678310518463"
},
"downloads": -1,
"filename": "mpxpy-0.0.17-py3-none-any.whl",
"has_sig": false,
"md5_digest": "33546f9a73fc678e38b18b92295e2041",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 27362,
"upload_time": "2025-07-16T19:30:21",
"upload_time_iso_8601": "2025-07-16T19:30:21.834022Z",
"url": "https://files.pythonhosted.org/packages/19/04/20bae57f11314004d2ec7ee9a17998e7741c47efa55b6d2cdf2cdd241568/mpxpy-0.0.17-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "cc0241c0669cd87f108e8e686ca9da810c34b0fc51545579d78b4c108e5a2d63",
"md5": "8ba03f53d06067c32e7b5450d5150314",
"sha256": "09700ac7efce5fa7ebd7dc8f15a5ed5f49d4756aa4375f5953d265642d84d339"
},
"downloads": -1,
"filename": "mpxpy-0.0.17.tar.gz",
"has_sig": false,
"md5_digest": "8ba03f53d06067c32e7b5450d5150314",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 30926,
"upload_time": "2025-07-16T19:30:22",
"upload_time_iso_8601": "2025-07-16T19:30:22.630093Z",
"url": "https://files.pythonhosted.org/packages/cc/02/41c0669cd87f108e8e686ca9da810c34b0fc51545579d78b4c108e5a2d63/mpxpy-0.0.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-16 19:30:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Mathpix",
"github_project": "mpxpy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
">=",
"2.20.0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
">=",
"0.15.0"
]
]
},
{
"name": "pydantic",
"specs": [
[
">=",
"2.10.6"
]
]
},
{
"name": "pytest",
"specs": [
[
">=",
"7.0.0"
]
]
}
],
"lcname": "mpxpy"
}