MegaParse SDK
Welcome to the MegaParse SDK! This SDK allows you to easily interact with the MegaParse API to upload URLs and files for processing.
Installation
To install the MegaParse SDK, use pip:
pip install megaparse-sdk
Usage
Here is an example of how to use the MegaParse SDK:
Uploading URLs
import asyncio
import os
from megaparse.sdk import MegaParseSDK
async def upload_url():
api_key = str(os.getenv("MEGAPARSE_API_KEY"))
megaparse = MegaParseSDK(api_key)
url = "https://www.quivr.com"
# Upload a URL
url_response = await megaparse.url.upload(url)
print(f"\n----- URL Response : {url} -----\n")
print(url_response)
await megaparse.close()
if __name__ == "__main__":
asyncio.run(upload_url())
Uploading Files
import asyncio
import os
from megaparse.sdk import MegaParseSDK
async def upload_file():
api_key = str(os.getenv("MEGAPARSE_API_KEY"))
megaparse = MegaParseSDK(api_key)
file_path = "your/file/path.pdf"
# Upload a file
response = await megaparse.file.upload(
file_path=file_path,
method="unstructured", # unstructured, llama_parser, megaparse_vision
strategy="auto",
)
print(f"\n----- File Response : {file_path} -----\n")
print(response)
await megaparse.close()
if __name__ == "__main__":
asyncio.run(upload_file())
Features
- Upload URLs: Easily upload URLs for processing.
- Upload Files: Upload files with different processing methods and strategies.
Getting Started
- Set up your API key: Make sure to set the
MEGAPARSE_API_KEYenvironment variable with your MegaParse API key. - Run the example: Use the provided example to see how to upload URLs and files.
For more details, refer to the usage example.
We hope you find the MegaParse SDK useful for your projects!
Enjoy, Quivr Team !
Metadata
Release files for megaparse-sdk 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| megaparse_sdk-0.1.12.tar.gz | 413.6 kB | Without provenance | Details for megaparse_sdk-0.1.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| megaparse_sdk-0.1.12-py3-none-any.whl | Python 3 | none | any | Details for megaparse_sdk-0.1.12-py3-none-any.whl |
Total release size: 427.8 kB
Release files / megaparse_sdk-0.1.12.tar.gz
| Download URL | megaparse_sdk-0.1.12.tar.gz |
|---|---|
| Size | 413.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81701326cf46bad2d5e8be2036e30721166d88fa7d33366bbbc0838c13761ea6
|
|
BLAKE2b-256 checksum How to use checksums |
a91a1e56bdca707f88a519ad1211f5ad8ea0f6a638c36370819941d4ccfe073e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.8
|
Release files / megaparse_sdk-0.1.12-py3-none-any.whl
| Download URL | megaparse_sdk-0.1.12-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a963faaf9a2d8a958dab7ea8bf63c167b32e739dbfd06caa9e47c01d428f59cb
|
|
BLAKE2b-256 checksum How to use checksums |
ddc24d496e2c06c46d69bdac24ee8cecdcbae7b8c6a408227856a44ebf410cb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.8
|
Security for megaparse-sdk 0.1.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.