-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: unnecessary dep and readme (#107)
* fix: unnecessary dep and readme * fix: rename src to megaparse_sdk * fix: rename src to megaparse_sdk
- Loading branch information
Showing
9 changed files
with
172 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,84 @@ | ||
## MegaParse SDK | ||
|
||
What if you just don't care about the code and just want to call a service that does everythink for you ? | ||
We thought of that (since we do to), just use our 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: | ||
|
||
```sh | ||
pip install megaparse-sdk | ||
``` | ||
|
||
### Usage | ||
|
||
Here is an example of how to use the MegaParse SDK: | ||
|
||
#### Uploading URLs | ||
|
||
```python | ||
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 | ||
|
||
```python | ||
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](#file:usage_example.py-context). | ||
|
||
We hope you find the MegaParse SDK useful for your projects! | ||
|
||
Enjoy, *Quivr Team* ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from megaparse.sdk.src import MegaParseSDK | ||
from megaparse.sdk.megaparse_sdk import MegaParseSDK | ||
|
||
__all__ = ["MegaParseSDK"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions
5
megaparse/sdk/src/endpoints/file_upload.py → ...dk/megaparse_sdk/endpoints/file_upload.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
megaparse/sdk/src/endpoints/url_upload.py → ...sdk/megaparse_sdk/endpoints/url_upload.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters