{"id":13420654,"url":"https://github.com/bfabiszewski/libmobi","last_synced_at":"2025-10-21T04:00:15.145Z","repository":{"id":17011998,"uuid":"19775360","full_name":"bfabiszewski/libmobi","owner":"bfabiszewski","description":"C library for handling Kindle (MOBI) formats of ebook documents","archived":false,"fork":false,"pushed_at":"2024-10-29T17:50:02.000Z","size":48334,"stargazers_count":421,"open_issues_count":2,"forks_count":70,"subscribers_count":21,"default_branch":"public","last_synced_at":"2024-10-29T18:47:52.862Z","etag":null,"topics":["c","ebook","kindle","library"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bfabiszewski.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-14T10:23:18.000Z","updated_at":"2024-10-29T17:50:06.000Z","dependencies_parsed_at":"2024-02-04T14:29:45.585Z","dependency_job_id":"6e8155aa-c82a-4604-98b2-3d8f24ecb0ae","html_url":"https://github.com/bfabiszewski/libmobi","commit_stats":{"total_commits":362,"total_committers":4,"mean_commits":90.5,"dds":"0.011049723756906049","last_synced_commit":"18566ff22cd93c6968828ca4bfc82e6b5a0bb6d9"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfabiszewski%2Flibmobi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfabiszewski%2Flibmobi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfabiszewski%2Flibmobi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfabiszewski%2Flibmobi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfabiszewski","download_url":"https://codeload.github.com/bfabiszewski/libmobi/tar.gz/refs/heads/public","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243701037,"owners_count":20333614,"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":["c","ebook","kindle","library"],"created_at":"2024-07-30T22:01:38.361Z","updated_at":"2025-10-21T04:00:10.057Z","avatar_url":"https://github.com/bfabiszewski.png","language":"C","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"readme":"# Libmobi\n\nC library for handling Mobipocket/Kindle (MOBI) ebook format documents.\n\nLibrary comes with several [command line tools](https://github.com/bfabiszewski/libmobi/tree/public/tools) for working with mobi ebooks.\nThe tools source may also be used as an example on how to use the library.\n\n## Features:\n- reading and parsing:\n  - some older text Palmdoc formats (pdb),\n  - Mobipocket files (prc, mobi),\n  - newer MOBI files including KF8 format (azw, azw3),\n  - Replica Print files (azw4)\n- recreating source files using indices\n- reconstructing references (links and embedded) in html files\n- reconstructing source structure that can be fed back to kindlegen\n- reconstructing dictionary markup (orth, infl tags)\n- writing back loaded documents\n- metadata editing\n- handling encrypted documents\n- encrypting documents for use on eInk Kindles\n\n## Todo:\n- improve writing\n- serialize rawml into raw records\n- process RESC records\n\n## Doxygen documentation:\n- [functions](http://www.fabiszewski.net/libmobi/group__mobi__export.html),\n- [structures for the raw, unparsed records metadata and data](http://www.fabiszewski.net/libmobi/group__raw__structs.html),\n- [structures for the parsed records metadata and data](http://www.fabiszewski.net/libmobi/group__parsed__structs.html),\n- [enums](http://www.fabiszewski.net/libmobi/group__mobi__enums.html)\n\n## Source:\n- [on github](https://github.com/bfabiszewski/libmobi/)\n\n## Packages:\n[![Packaging status](https://repology.org/badge/vertical-allrepos/libmobi.svg)](https://repology.org/project/libmobi/versions)\n\n## Installation:\n\n    [for git] $ ./autogen.sh\n    $ ./configure\n    $ make\n    [optionally] $ make test\n    $ sudo make install\n\nOn macOS, you can install via [Homebrew](https://brew.sh/) with `brew install libmobi`.\n\n## Alternative build systems\n- The supported way of building project is by using autotools.\n- Optionally project provides basic support for CMake, Xcode and MSVC++ systems. However these alternative configurations are not covering all options of autotools project. They are also not tested and not updated regularly. \n\n## Usage\n- single include file: `#include \u003cmobi.h\u003e`\n- linker flag: `-lmobi`\n- basic usage:\n```c\n#include \u003cmobi.h\u003e\n\n/* Initialize main MOBIData structure */\n/* Must be deallocated with mobi_free() when not needed */\nMOBIData *m = mobi_init();\nif (m == NULL) { \n  return ERROR; \n}\n\n/* Open file for reading */\nFILE *file = fopen(fullpath, \"rb\");\nif (file == NULL) {\n  mobi_free(m);\n  return ERROR;\n}\n\n/* Load file into MOBIData structure */\n/* This structure will hold raw data/metadata from mobi document */\nMOBI_RET mobi_ret = mobi_load_file(m, file);\nfclose(file);\nif (mobi_ret != MOBI_SUCCESS) { \n  mobi_free(m);\n  return ERROR;\n}\n\n/* Initialize MOBIRawml structure */\n/* Must be deallocated with mobi_free_rawml() when not needed */\n/* In the next step this structure will be filled with parsed data */\nMOBIRawml *rawml = mobi_init_rawml(m);\nif (rawml == NULL) {\n  mobi_free(m);\n  return ERROR;\n}\n/* Raw data from MOBIData will be converted to html, css, fonts, media resources */\n/* Parsed data will be available in MOBIRawml structure */\nmobi_ret = mobi_parse_rawml(rawml, m);\nif (mobi_ret != MOBI_SUCCESS) {\n  mobi_free(m);\n  mobi_free_rawml(rawml);\n  return ERROR;\n}\n\n/* Do something useful here */\n/* ... */\n/* For examples how to access data in MOBIRawml structure see mobitool.c */\n\n/* Free MOBIRawml structure */\nmobi_free_rawml(rawml);\n\n/* Free MOBIData structure */\nmobi_free(m);\n\nreturn SUCCESS;\n```\n- for examples of usage, see [tools](https://github.com/bfabiszewski/libmobi/tree/public/tools)\n\n\n## Requirements\n- compiler supporting C99\n- zlib (optional, configure --with-zlib=no to use included miniz.c instead)\n- libxml2 (optional, configure --with-libxml2=no to use internal xmlwriter)\n- tested with gcc (\u003e=4.2.4), clang (llvm \u003e=3.4), sun c (\u003e=5.13), MSVC++ (2015)\n- builds on Linux, MacOS, Windows (MSVC++, MinGW), Android, Solaris\n- tested architectures: x86, x86-64, arm, ppc\n- works cross-compiled on Kindle :)\n\n## Tests\n- [![Github Action status](https://github.com/bfabiszewski/libmobi/actions/workflows/build.yml/badge.svg)](https://github.com/bfabiszewski/libmobi/actions)\n- [![Travis status](https://travis-ci.com/bfabiszewski/libmobi.svg?branch=public)](https://travis-ci.com/bfabiszewski/libmobi)\n- [![Coverity status](https://scan.coverity.com/projects/3521/badge.svg)](https://scan.coverity.com/projects/3521)\n\n## Projects using libmobi\n- [KyBook 2 Reader](http://kybook-reader.com)\n- [@Voice Aloud Reader](http://www.hyperionics.com/atVoice/)\n- [QLMobi quicklook plugin](https://github.com/bfabiszewski/QLMobi/tree/master/QLMobi)\n- [Librera Reader](http://librera.mobi)\n- ... (let me know to include your project)\n\n## License:\n- LGPL, either version 3, or any later\n\n## Credits:\n- The huffman decompression and KF8 parsing algorithms were learned by studying python source code of [KindleUnpack](https://github.com/kevinhendricks/KindleUnpack).\n- Thanks to all contributors of Mobileread [MOBI wiki](http://wiki.mobileread.com/wiki/MOBI)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfabiszewski%2Flibmobi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfabiszewski%2Flibmobi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfabiszewski%2Flibmobi/lists"}