Gemini Data Extractor
This tool is a prof-of-concept for extracting data from PDFs and images, using the gemini-2.0-flash-001 LLM from Google. This model attracted a lot of attention lately due to its good performances ad affordable API prices.
It uses Google's GenAI library to interact with the model and extract data from a given document using your prompt. The extracted date is returned in JSON format.
Installation
You can install the tool using pip:
pip install gemini-data-extractor
Usage
You can use the tool by running the following command (see also "Authentication" below):
gemini-data-extractor --path path/to/your/file.pdf --prompt-text "Your prompt here"
The tool will return the extracted data in JSON format to the standard output. In case of a long prompt, you can save it to a file and pass the path to the file using the --prompt-file argument:
gemini-data-extractor --path path/to/your/file.png --prompt-file path/to/your/prompt.txt
Authentication
In order to use the gemini API you need to authenticate either using a gemini studio API key or via the Google Cloud SDK. You can obtain a key from Google AI Studio. You can then authenticate using the --api-key argument or setting the GEMINI_API_KEY environment variable:
gemini-data-extractor --path path/to/your/file.pdf --prompt "Your prompt here" --api-key your-api-key
or
export GEMINI_API_KEY=your-api-key
gemini-data-extractor --path path/to/your/file.pdf --prompt "Your prompt here"
Alternatively, if you have a working Google Cloud Account and the Google Cloud SDK installed, you can authenticate using the gcloud command:
gcloud auth application-default login
Then you can use the tool with the options --project-id and --location (or by setting the GCP_PROJECT_ID and GCP_LOCATION environment variables):
gemini-data-extractor --path path/to/your/file.pdf --prompt "Your prompt here" --project-id your-project-id --location your-location
or
export GCP_PROJECT_ID=your-project-id
export GCP_LOCATION=your-location
gemini-data-extractor --path path/to/your/file.pdf --prompt "Your prompt here"
License
This tool is licensed under the MIT license. You can find more information in the LICENSE file.
Disclaimer
Gemini is a trademark of Google LLC. This project is not affiliated with Google LLC. The tool uses the GenAI library to interact with the gemini-2.0-flash-001 LLM from Google.
The tool is provided as-is and is not officially supported by Google LLC. Use it at your own risk.
Metadata
Release files for gemini-data-extractor 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gemini_data_extractor-0.1.2.tar.gz | 36.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gemini_data_extractor-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.0 kB
Release files / gemini_data_extractor-0.1.2.tar.gz
| Download URL | gemini_data_extractor-0.1.2.tar.gz |
|---|---|
| Size | 36.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75a4f8e6ef24e71a3fcd14475f6d5f069f48635e1c2e1373c028f263c2690b23
|
|
BLAKE2b-256 checksum How to use checksums |
2d72ee23a597d302c3f207f200e41fb5f1ca06d452d686d87e9699927fee179d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.3
|
Release files / gemini_data_extractor-0.1.2-py3-none-any.whl
| Download URL | gemini_data_extractor-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
351a68fa8f8b253281f7841781464985097a9a7aa0ffecae486fa761c0f55481
|
|
BLAKE2b-256 checksum How to use checksums |
7b0f554f823029831a413c55fcd050bb5c600e0662dc6a2e1b42b0d86389627d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.3
|