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.4.tar.gz (343.0 kB view details)

Uploaded Source

Built Distribution

megaparse_sdk-0.1.4-py2.py3-none-any.whl (4.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: megaparse_sdk-0.1.4.tar.gz
  • Upload date:
  • Size: 343.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.4.tar.gz
Algorithm Hash digest
SHA256 19861f036402377a52a20d4a826b9952ce81e99177c798960fa18e342103ce03
MD5 ccfafa31e0b88f88c7acf515ca1f351e
BLAKE2b-256 93200b79c5fb7c91cdb855fdcaaf70a0fb918f637bfd1dd878c6cb0e420350a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for megaparse_sdk-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 54d0b6080f5f95f2d9dc26fc3111875d93fd9b6a420fae4608537f0b3651a6b2
MD5 16ec1766899e5330e0c9f672bfc99f54
BLAKE2b-256 2abeba48ba7454806226f89a372274a40b08d02f9bd1ff49ffa511d31d27370d

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