{"id":34935929,"url":"https://github.com/jkulhanek/pyoverleaf","last_synced_at":"2025-12-26T18:06:32.318Z","repository":{"id":190200225,"uuid":"682149867","full_name":"jkulhanek/pyoverleaf","owner":"jkulhanek","description":"Python Overleaf API and simple CLI","archived":false,"fork":false,"pushed_at":"2025-06-17T11:21:27.000Z","size":38,"stargazers_count":27,"open_issues_count":2,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T12:28:54.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkulhanek.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-23T14:46:55.000Z","updated_at":"2025-06-17T11:16:00.000Z","dependencies_parsed_at":"2025-06-17T12:22:31.369Z","dependency_job_id":"52bfdb29-8d10-42e0-9091-70fae110c750","html_url":"https://github.com/jkulhanek/pyoverleaf","commit_stats":null,"previous_names":["jkulhanek/pyoverleaf"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jkulhanek/pyoverleaf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulhanek%2Fpyoverleaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulhanek%2Fpyoverleaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulhanek%2Fpyoverleaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulhanek%2Fpyoverleaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkulhanek","download_url":"https://codeload.github.com/jkulhanek/pyoverleaf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulhanek%2Fpyoverleaf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28057678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-12-26T18:05:02.096Z","updated_at":"2025-12-26T18:06:32.306Z","avatar_url":"https://github.com/jkulhanek.png","language":"Python","readme":"# PyOverleaf\nUnofficial Python API to access Overleaf.\n\n## Tasks\n- [x] List projects\n- [x] Download project as zip\n- [x] List and download individual files/docs\n- [x] Upload new files/docs\n- [x] Delete files, create folders\n- [x] Python CLI interface to access project files\n- [ ] Move, rename files\n- [ ] Create, delete, archive, and rename projects\n- [ ] Access/update comments, perform live changes\n- [ ] Access/update profile details\n- [ ] Robust login\n\n## Getting started\nInstall the project by running the following:\n```bash\npip install 'pyoverleaf[cli]'\n```\n\nBefore using the API, make sure you are logged into Overleaf in your default web browser.\nCurrently, only Google Chrome and Mozilla Firefox are supported: https://github.com/richardpenman/browsercookie\nTest if everything is working by listing the projects:\n```bash\npyoverleaf ls\n```\n\n\n## Python API\nThe low-level Python API provides a way to access Overleaf projects from Python.\nThe main entrypoint is the class `pyoverleaf.Api`\n\n### Accessing projects\n```python\nimport pyoverleaf\n\napi = pyoverleaf.Api()\napi.login_from_browser()\n\n# Lists the projects\nprojects = api.get_projects()\n\n# Download the project as a zip\nproject_id = projects[0].id\napi.download_project(project_id, \"project.zip\")\n```\n\n### Managing project files\n```python\nimport pyoverleaf\n\napi = pyoverleaf.Api()\napi.login_from_browser()\n# Choose a project\nproject_id = projects[0].id\n\n# Get project files\nroot_folder = api.project_get_files(project_id)\n\n# Create new folder\nnew_folder = api.project_create_folder(project_id, root_folder.id, \"new-folder\")\n\n# Upload new file to the newly created folder\nfile_bytes = open(\"test-image.jpg\", \"rb\").read()\nnew_file = api.project_upload_file(project_id, new_folder.id, \"file-name.jpg\", file_bytes)\n\n# Delete newly added folder containing the file\napi.project_delete_entity(project_id, new_folder)\n```\n\n## Higher-level Python IO API\nThe higher-level Python IO API allows users to access the project files in a Pythonic way.\nThe main entrypoint is the class `pyoverleaf.ProjectIO`\n\nHere are some examples on how to use the API:\n```python\nimport pyoverleaf\n\napi = pyoverleaf.Api()\napi.login_from_browser()\n# Choose a project\nproject_id = projects[0].id\n\n# Get project IO API\nio = pyoverleaf.ProjectIO(api, project_id)\n\n# Check if a path exists\nexists = io.exists(\"path/to/a/file/or/folder\")\n\n# Create a directory\nio.mkdir(\"path/to/new/directory\", parents=True, exist_ok=True)\n\n# Listing a directory\nfor entity in io.listdir(\"path/to/a/directory\"):\n    print(entity.name)\n\n# Reading a file\nwith io.open(\"path/to/a/file\", \"r\") as f:\n    print(f.read())\n\n# Creating a new file\nwith io.open(\"path/to/a/new/file\", \"w+\") as f:\n    f.write(\"new content\")\n```\n\n\n## Using the CLI\nThe CLI provides a way to access Overleaf from the shell.\nTo get started, run `pyoverleaf --help` to list available commands and their arguments.\n\n### Listing projects and files\n```bash\n# Listing projects\npyoverleaf ls\n\n# Listing project files\npyoverleaf ls project-name\n\n# Listing project files in a folder\npyoverleaf ls project-name/path/to/files\n```\n\n### Downloading existing projects\n```bash\npyoverleaf download-project project-name output.zip\n```\n\n### Creating and deleting directories\n```bash\n# Creating a new directory (including parents)\npyoverleaf mkdir -p project-name/path/to/new/directory\n\n# Deleting\npyoverleaf rm project-name/path/to/new/directory\n```\n\n### Reading and writing files\n```bash\n# Writing to a file\necho \"new content\" | pyoverleaf write project-name/path/to/file.txt\n\n# Uploading an image\ncat image.jpg | pyoverleaf write project-name/path/to/image.jpg\n\n# Reading a file\npyoverleaf read project-name/path/to/file.txt\n```\n","funding_links":[],"categories":["Research \u0026 Academic"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkulhanek%2Fpyoverleaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkulhanek%2Fpyoverleaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkulhanek%2Fpyoverleaf/lists"}