Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Invoice2Data class for object oriented usage #480

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rmilecki
Copy link
Collaborator

This will allow using invoice2data in an object oriented way like:

import invoice2data

i2d = invoice2data.Invoice2Data()
i2d.extract_data("foo.pdf")

@rmilecki
Copy link
Collaborator Author

I was wondering if there is any interest in providing an Invoice2Data class so this project can be used as a library in an object oriented way.

That idea originally came from #392 but maybe it could be a generic improvement.

This will allow using invoice2data in an object oriented way like:

import invoice2data

i2d = invoice2data.Invoice2Data()
i2d.extract_data("foo.pdf")

Signed-off-by: Rafał Miłecki <[email protected]>
@m3nu
Copy link
Collaborator

m3nu commented Feb 19, 2023

Sounds good. So the class would be instantiated with some templates and then read invoices? Makes sense, since we already keep some state via templates and the input source.

@m3nu
Copy link
Collaborator

m3nu commented Feb 19, 2023

I'd still carefully consider which objects make sense. Maybe you also want an Invoice class to hold the read invoice.

Copy link
Collaborator

@bosd bosd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! :+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants