{"id":28999913,"url":"https://github.com/zeldamods/sarc","last_synced_at":"2025-06-25T08:09:27.271Z","repository":{"id":57463937,"uuid":"142900287","full_name":"zeldamods/sarc","owner":"zeldamods","description":"Nintendo SARC archive reader and writer","archived":false,"fork":false,"pushed_at":"2024-06-19T20:28:03.000Z","size":82,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-27T17:48:46.483Z","etag":null,"topics":["modding-tools","nintendo","nintendo-switch","nintendo-wii-u","python3","sarc"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeldamods.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}},"created_at":"2018-07-30T16:23:08.000Z","updated_at":"2025-01-10T21:00:08.000Z","dependencies_parsed_at":"2022-09-05T05:51:29.875Z","dependency_job_id":null,"html_url":"https://github.com/zeldamods/sarc","commit_stats":null,"previous_names":["leoetlino/sarc"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/zeldamods/sarc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeldamods%2Fsarc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeldamods%2Fsarc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeldamods%2Fsarc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeldamods%2Fsarc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeldamods","download_url":"https://codeload.github.com/zeldamods/sarc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeldamods%2Fsarc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261832976,"owners_count":23216500,"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","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":["modding-tools","nintendo","nintendo-switch","nintendo-wii-u","python3","sarc"],"created_at":"2025-06-25T08:09:25.424Z","updated_at":"2025-06-25T08:09:27.252Z","avatar_url":"https://github.com/zeldamods.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Nintendo SARC archive reader and writer\n\n### Setup\n\nInstall Python 3.6+ (**64 bit version**) then run `pip install sarc`.\n\n### List files in an archive\n\n    sarc list ARCHIVE\n\n### Extract an archive\n\n    sarc extract ARCHIVE\n\n### Create an archive\n\n    sarc create [--be] FILES_TO_ADD  DEST_SARC\n\nYou can give it directories too, in which case the entire directory will be added to the archive\nrecursively.\n\nPass `--be` (shorthand: `-b`) if you want `sarc` to use big endian mode (for the Wii U).\n\nAn important option is `--base-path`. This option lets you remove parts of the path.\nFor example, if you pass a path like `Mods/BotW/System/Version.txt`, you will likely want to pass\n`--base-path Mods/BotW` to get rid of the leading components.\n\nIf only a single directory is passed, the base path is set for you automatically.\n\nSo typical usage example:\n\n    sarc create  ~/botw/Bootup/  ~/botw/ModifiedBootup.pack\n\n### Update an archive\n\n    sarc update  FILES_TO_ADD  SARC_TO_MODIFY\n\nThis is almost identical to `create`.\n\nBy default, `sarc` will keep the endianness of the original archive. You can override this\nwith `--endian {le,be}` (le for little and be for big endian).\n\n### Delete files from an archive\n\n    sarc delete  FILES_TO_DELETE  SARC_TO_MODIFY\n\nNothing much to say here. Just keep in mind FILES_TO_DELETE takes archive paths\n(those that are printed by `list`).\n\n### Library usage\n\n```python\nimport sarc\n\narchive = sarc.read_file_and_make_sarc(file)\n# or if you already have a buffer\narchive = sarc.SARC(archive_bytes)\nif archive:\n    for file_name in archive.list_files():\n        size = archive.get_file_size(file_name)\n        data = archive.get_file_data(file_name)\n\n```\n\nTo modify an archive:\n\n```python\nimport sarc\n\nwriter = sarc.make_writer_from_sarc(archive)\n# or if you're reading from a file\nwriter = sarc.read_sarc_and_make_writer(file)\n# or for a blank archive\nwriter = sarc.SARCWriter(be=big_endian)\n\nwriter.add_file('test.bfevfl', b'file contents')\nwriter.add_file('another_file.txt', b'file contents')\nwriter.add_file('test.bfevfl', b'replacing a file')\n\nwriter.delete_file('another_file.txt')\n\nwriter.write(output_stream)\n```\n\nFor more information, please look at [sarc.py](sarc/sarc.py).\n\n### License\n\nThis software is licensed under the terms of the GNU General Public License, version 2 or later.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeldamods%2Fsarc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeldamods%2Fsarc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeldamods%2Fsarc/lists"}