Skip to main content

Megaparse SDK

Project description

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

  1. Set up your API key: Make sure to set the MEGAPARSE_API_KEY environment variable with your MegaParse API key.
  2. 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 !

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

megaparse_sdk-0.1.5.tar.gz (407.0 kB view details)

Uploaded Source

Built Distribution

megaparse_sdk-0.1.5-py2.py3-none-any.whl (10.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file megaparse_sdk-0.1.5.tar.gz.

File metadata

  • Download URL: megaparse_sdk-0.1.5.tar.gz
  • Upload date:
  • Size: 407.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for megaparse_sdk-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6bff967e9e0f6984b26b6341b36cb3eccad3547aedc6c74b5431d7bafe39a8de
MD5 082c7d0301ec241887ffe8c4ab3ae64e
BLAKE2b-256 06fdc265624b7e50d8c87894850efdc89707b1f3e52b0b26abfc00ab0a8ea3cd

See more details on using hashes here.

File details

Details for the file megaparse_sdk-0.1.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for megaparse_sdk-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f484cfd7768576935d0bcadf1517838ddccf45abb767b30bcfbf519d4ce00541
MD5 fefb06ddc157d3bd9163f4f0efc14ba9
BLAKE2b-256 46429dc03828f797f690a48f0e1a09904651436c5a66887595cf7cc756ea8f43

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page