extractor
Version, currently main branch1 version
- main branchlatestAug 30, 2021
github.com/postmodern/extractor.cr
Crystal bindings to libextractor, a library for extracting metadata from a variety of file formats.
Installation
# Add this to your shard.yml
dependencies:
extractor:
github: postmodern/extractor.cr
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 0.35.1- License
- GPL-3
- Author
- Postmodern
Dependencies
Development Dependencies
- spectator~> 0.9, >= 0.9.9gitlab: arctic-fox/spectatordev
README
extractor.cr
Crystal bindings to libextractor, a library for extracting metadata from a variety of file formats. Inspired by the Ruby [ffi-extractor] gem and should be API compatible.
libextractor is a simple library for keyword extraction. libextractor does not support all formats but supports a simple plugging mechanism such that you can quickly add extractors for additional formats, even without recompiling libextractor. libextractor typically ships with a dozen helper-libraries that can be used to obtain keywords from common file-types.
libextractor is a part of the GNU project.
Installation
-
Install
libextractor-
Debian / Ubuntu:
$ sudo apt-get install libextractor-dev libextractor-plugins-all -
RedHat / Fedora:
$ sudo dnf install libextractor-devel libextractor-plugins -
Brew:
$ brew install libextractor
-
-
Add the dependency to your
shard.yml:dependencies: extractor: github: postmodern/extractor.cr -
Run
shards install
Requirements
- libextractor >= 0.6.0
Examples
require "extractor"
Extractor.extract(string) do |plugin_name,type,format,mime_type,data|
p {plugin, type, format, mime_type,data}
end
Extractor.extract_from("path/to/image.jpg") do |plugin_name,type,format,mime_type,data|
p {plugin, type, format, mime_type,data}
end
Development
- Install
libextractor(See Installation) git clone https://github.com/postmodern/extractor.cr.gitcd extractor.crcrystal spec
Contributing
- Fork it (https://github.com/postmodern/extractor.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Postmodern - creator and maintainer
Copyright
extractor.cr - Crystal bindings for libextractor
Copyright (c) 2020 - Hal Brodigan (postmodern.mod3 at gmail.com)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Aug 30, 2021
- Crystal
>= 0.35.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/postmodern/extractor.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1