{"id":37083318,"url":"https://github.com/ixalodecte/filestruct","last_synced_at":"2026-01-14T10:09:32.606Z","repository":{"id":218724943,"uuid":"746327395","full_name":"ixalodecte/filestruct","owner":"ixalodecte","description":"A python package to structure files using visual and style informations","archived":false,"fork":false,"pushed_at":"2024-03-09T21:26:04.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-05T16:14:10.275Z","etag":null,"topics":["layout-analysis","parser","pdf"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ixalodecte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-21T18:27:11.000Z","updated_at":"2024-03-10T10:41:59.000Z","dependencies_parsed_at":"2024-03-09T22:38:05.296Z","dependency_job_id":null,"html_url":"https://github.com/ixalodecte/filestruct","commit_stats":null,"previous_names":["ixalodecte/filestruct"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ixalodecte/filestruct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixalodecte%2Ffilestruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixalodecte%2Ffilestruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixalodecte%2Ffilestruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixalodecte%2Ffilestruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ixalodecte","download_url":"https://codeload.github.com/ixalodecte/filestruct/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixalodecte%2Ffilestruct/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28416617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["layout-analysis","parser","pdf"],"created_at":"2026-01-14T10:09:31.930Z","updated_at":"2026-01-14T10:09:32.599Z","avatar_url":"https://github.com/ixalodecte.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FileStruct\n\n**FileStruct** is a high-level Python library that aims to extract the overall structure of documents, particularly PDFs, based on visual information such as size, color and font.\n\n## How does it work ?\n\nAs clever human beings, we are able to detect titles, subtitles, and paragraphs using the visual appearence of the document. A big text in red most certainly represent a title (or subtitle). Using these heuristics, we are able to structure a document : _This paragraph belongs to this section_. The same method is used by this package to provide an automated, while realistic way to structure a document. The method is described bellow :\n\n1.  **Text and style extraction :** We rely on lower level librairies (like PyMuPDF) for the extraction of the text and style information, and the ordering of each block of text.\n2.  **Tree creation :** A tree is created, in which each block of text is a node of the tree. A child of a node in the tree is a subsection of a section in the document.\n3.  **Data exportation :** The data can be exported in JSON format.\n\nFor now, filestruct can only read formats that are supported by PyMuPDF. This includes pdf, epub, xps, mobi, fb2, cbz and svg. I plan to add more file formats in the future.\n\n## Installation\n\nInstall **FileStruct** using **pip** :\n\n```sh\npip install filestruct\n```\n\n\n## Getting Started\n\nBellow, a basic usage for a PDF document :\n\n```python\nfrom filestruct.document import PDFDocument\n\ndoc = Document(\"PATH_TO_YOUR_FILE.pdf\")\ndata = doc.to_json()   # Export the tree into json format\nprint(data)\nprint(doc)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixalodecte%2Ffilestruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fixalodecte%2Ffilestruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixalodecte%2Ffilestruct/lists"}