Skip to main content

A Python client for the Parseur.com API to manage mailboxes, documents, uploads, and listen for new parsing events.

Project description

🤖🧙parseur-py

parseur-py is a modern Python client for the Parseur API.

It lets you manage mailboxes, documents, uploads, and webhooks programmatically or from the command line.

Built to help you automate document parsing at scale, parseur-py makes integrating with Parseur fast, easy, and Pythonic.

GitHub Repo PyPI version License: MIT Read the Docs


✨ Features

✅ List, search, and sort mailboxes
✅ Get mailbox details and schema
✅ List, search, filter, and sort documents
✅ Upload documents by file or email content
✅ Reprocess, skip, copy, or delete documents
✅ Manage custom webhooks for real-time events
✅ Fully-featured Command Line Interface (CLI)


🚀 Quick Start

Install the package

pip install parseur-py

Install the package from source

pip install -e .

Build documentation

pip install -r requirements-doc.txt
cd docs
make html

Initialize your configuration

Store your Parseur API credentials securely:

parseur init --api-key YOUR_PARSEUR_API_KEY

Your config is saved (by default) in:

~/.parseur.conf

Example usage

List all your mailboxes:

parseur list-mailboxes

List documents in a mailbox:

parseur list-documents 12345

Upload a file to a mailbox:

parseur upload-file 12345 ./path/to/document.pdf

Register a custom webhook:

parseur create-webhook --event document.processed --target-url https://yourserver.com/webhook --mailbox-id 12345

📜 CLI Commands

Run:

parseur --help

for a full list of available commands.

Highlights

  • init: Set your API token and (optional) base URL
  • list-mailboxes: Search and sort mailboxes
  • get-mailbox: Fetch a mailbox by ID
  • get-mailbox-schema: Get the mailbox parsing schema
  • list-documents: Advanced document search, filtering, sorting
  • get-document: Fetch document details
  • reprocess-document / skip-document / delete-document: Document lifecycle operations
  • upload-file / upload-text: Upload new documents
  • create-webhook / get-webhook / list-webhooks / delete-webhook: Create, get, list, and delete custom webhook integrations.
  • enable-webhook / pause-webhook: Activate or pause a webhook for a specific mailbox.

🔎 Advanced Search & Filtering

Mailbox listing supports:

  • Search by name or email prefix
  • Sort by:
    • name
    • document_count
    • template_count
    • PARSEDOK_count (processed)
    • PARSEDKO_count (failed)
    • QUOTAEXC_count (quota exceeded)
    • EXPORTKO_count (export failed)

Document listing supports:

  • Search in:
    • document ID
    • document name
    • template name
    • email addresses (from, to, cc, bcc)
    • document metadata header
  • Sort by:
    • name
    • created (received date)
    • processed date
    • status
  • Filter by:
    • received_after / received_before dates
  • Include parsed result in response

⚡ Webhooks Support

Easily register custom webhooks for events like:

  • document.processed
  • document.processed.flattened
  • document.template_needed
  • document.export_failed
  • table.processed
  • table.processed.flattened

Your webhook endpoint will receive POST notifications with Parseur payloads, enabling real-time integrations with your systems.


🛠️ Configuration

Your API token and settings are stored in a simple INI file:

[parseur]
api_token = YOUR_API_KEY
base_url = https://api.parseur.com

You can customize the path by setting `--config-path` in your calls if needed.


🐍 Python Client Usage

Beyond the CLI, parseur-py is a standard Python library. Example:

import parseur

parseur.api_key = "YOUR_API_KEY"

for mailbox in parseur.Mailbox.list():
    print(mailbox.name)

📖 Documentation

  • Parseur Official API Docs
  • This package mirrors Parseur’s REST API, adding pagination handling, schema support, and convenient CLI commands.

💼 License

MIT License


🤝 Contributing

We welcome contributions! Please:

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/foo)
  3. Commit your changes (git commit -am 'Add foo')
  4. Push to the branch (git push origin feature/foo)
  5. Open a pull request

✨ Credits

Developed with ❤️ by the Parseur team.


Parseur is the easiest way to automatically extract data from emails and documents. Stop copy-pasting data and automate your workflows!

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

parseur_py-1.3.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parseur_py-1.3.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file parseur_py-1.3.0.tar.gz.

File metadata

  • Download URL: parseur_py-1.3.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for parseur_py-1.3.0.tar.gz
Algorithm Hash digest
SHA256 d10eff012930c0fffc0b95c4325462df6b7e5cda09508fdcaadfa70083f73d28
MD5 fe4beacf4f23750eecd5ed765b5b8fbf
BLAKE2b-256 80861c2a55214468f673e69fba3485c28e81e9188dd0a99b56dc95fd7d26928f

See more details on using hashes here.

File details

Details for the file parseur_py-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: parseur_py-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for parseur_py-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfcad3b4a941ee1e2b2d42f6682dbc6ff0e2e3b85a902f5eb0176a0dbd306f90
MD5 29fb2f5d682135e8c7fe58b34830f5e0
BLAKE2b-256 7dae66f228d399d64220a4fa4d4a5e408e32e1310f4e2235c4a1977021e2d4d3

See more details on using hashes here.

Supported by

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