casparser icon indicating copy to clipboard operation
casparser copied to clipboard

getting Layout Error! Scheme found before folio entry. when i try to clone and run the code

Open bharath4793 opened this issue 5 years ago • 17 comments

Hi

when I try to run the example shown in README.md, getting the below error

raise CASParseError("Layout Error! Scheme found before folio entry.") casparser.exceptions.CASParseError: Layout Error! Scheme found before folio entry.

not sure if I have missed anything, the statement was downloaded from CAMS on 13/01/2021

bharath4793 avatar Jan 13 '21 10:01 bharath4793

If you don't mind, can you please send me a cropped screenshot of just the first scheme entry from the CAS (with all personal data removed) ? something like

cas_screenshot

codereverser avatar Jan 13 '21 10:01 codereverser

Hi Sandeep Somasekharan,

Please find the attach screenshot

Regards Bharath B

On Wed, Jan 13, 2021 at 4:20 PM Sandeep Somasekharan < [email protected]> wrote:

If you don't mind, can you please send me a cropped screenshot of just the first scheme entry from the CAS (with all personal data removed) ? something like

[image: cas_screenshot] https://user-images.githubusercontent.com/8553055/104442504-2997ed80-55bb-11eb-832c-be807f19a53f.jpg

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/codereverser/casparser/issues/20#issuecomment-759368306, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIZ2QN74ZPLMTYJXP7N57DSZV3GZANCNFSM4WAR5MHA .

bharath4793 avatar Jan 13 '21 10:01 bharath4793

looks like you missed to attach the file

codereverser avatar Jan 13 '21 11:01 codereverser

I have attached the file, still, I have attached once again. [image: Screen Shot 2021-01-13 at 4.24.07 PM.png]

On Wed, Jan 13, 2021 at 4:32 PM Sandeep Somasekharan < [email protected]> wrote:

looks like you missed to attach the file

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/codereverser/casparser/issues/20#issuecomment-759374775, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIZ2QIQDMBW4G7Q727GMV3SZV4TTANCNFSM4WAR5MHA .

bharath4793 avatar Jan 13 '21 11:01 bharath4793

do let me know once the issue is resolved

Regards Bharath B

On Wed, Jan 13, 2021 at 4:58 PM Bharath B [email protected] wrote:

I have attached the file, still, I have attached once again. [image: Screen Shot 2021-01-13 at 4.24.07 PM.png]

On Wed, Jan 13, 2021 at 4:32 PM Sandeep Somasekharan < [email protected]> wrote:

looks like you missed to attach the file

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/codereverser/casparser/issues/20#issuecomment-759374775, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIZ2QIQDMBW4G7Q727GMV3SZV4TTANCNFSM4WAR5MHA .

bharath4793 avatar Jan 13 '21 11:01 bharath4793

The image is still not visible here. Looks like github doesn't support attaching images in "Reply via email" .

Can you please email me the file if you are having issues uploading it here? My email is available in my profile. [codereverser .at. gmail .dot. com]

codereverser avatar Jan 13 '21 11:01 codereverser

I have mailed you and attaching the snapshot here

Screen Shot 2021-01-13 at 4 24 07 PM

bharath4793 avatar Jan 13 '21 12:01 bharath4793

Many thanks! I've pushed a commit that should resolve this issue. Can you please update your code and test?

codereverser avatar Jan 13 '21 12:01 codereverser

any idea on how to reimport the changes you have done because when I uninstall the requirements and reinstall it using pip, I think it's reinstalling from the cache.

bharath4793 avatar Jan 13 '21 12:01 bharath4793

the previous error seems to be resolved, but getting below error

raise CASParseError("Unable to parse investor data")

casparser.exceptions.CASParseError: Unable to parse investor data

bharath4793 avatar Jan 13 '21 12:01 bharath4793

I've pushed a new version to sort the issues . Try installing it by

pip install -U 'casparser[mupdf]==0.4.1'

If the error still persists, please give force_pdfminer option a try and let me know

via API,

data = read_cas_pdf(filename, password, force_pdfminer=True)

or via CLI,

casparser -p password --force-pdfminer filename

codereverser avatar Jan 13 '21 13:01 codereverser

even after adding the above parameter the error still persists

Traceback (most recent call last): File "<project dir>/parse_mf_cams_pdf.py", line 113, in <module> csv_json() File "<project dir>/parse_mf_cams_pdf.py", line 96, in csv_json data = casparser.read_cas_pdf(pdf_path, "password", force_pdfminer=True) File "<project dir>/venv/lib/python3.8/site-packages/casparser/parsers/__init__.py", line 25, in read_cas_pdf partial_cas_data = cas_pdf_to_text(filename, password) File "<project dir>/venv/lib/python3.8/site-packages/casparser/parsers/pdfminer.py", line 150, in cas_pdf_to_text investor_info = parse_investor_info(layout, *page.mediabox[2:]) File "<project dir>/venv/lib/python3.8/site-packages/casparser/parsers/pdfminer.py", line 53, in parse_investor_info raise CASParseError("Unable to parse investor data") casparser.exceptions.CASParseError: Unable to parse investor data

with Cli getting below error Error parsing pdf file:: Unable to parse investor data

bharath4793 avatar Jan 13 '21 14:01 bharath4793

fixed in https://github.com/codereverser/casparser/commit/76cf58265deb4142c7db3c6cc0b3b66d12461a41

codereverser avatar Jan 13 '21 17:01 codereverser

I installed the latest package still getting same issue "Unable to parse investor data"

developerdiary avatar Mar 12 '24 07:03 developerdiary

In that case, it would be difficult to fix this without looking at the actual CAS file (or at least the layout of investor info). It is working for all the sample files I have. May be the contact details are in a different format than the ones I've seen.

Can you please send me the casparser version?

casparser --version

codereverser avatar Mar 12 '24 10:03 codereverser

Version : 0.7.4 I can share with you my CAS file. Please share your email address

developerdiary avatar Mar 12 '24 14:03 developerdiary

CAS file would be super helpful. many thanks! may be it is some regression bug in one of the new releases.

my email id is there in the profile https://github.com/codereverser

codereverser avatar Mar 13 '24 07:03 codereverser