{"id":19780464,"url":"https://github.com/cbetta/doxie","last_synced_at":"2025-04-30T21:33:23.900Z","repository":{"id":48771487,"uuid":"59962518","full_name":"cbetta/doxie","owner":"cbetta","description":"Ruby Doxie API library for getting scans off your Doxie scanner 🖨   ","archived":false,"fork":false,"pushed_at":"2022-10-05T22:46:51.000Z","size":242,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T14:43:56.496Z","etag":null,"topics":["doxie","doxie-api","libraries","scanner","sdk"],"latest_commit_sha":null,"homepage":"https://getdoxie.com/","language":"Ruby","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/cbetta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"cbetta"}},"created_at":"2016-05-29T20:29:50.000Z","updated_at":"2020-06-26T10:09:21.000Z","dependencies_parsed_at":"2022-09-09T03:51:21.740Z","dependency_job_id":null,"html_url":"https://github.com/cbetta/doxie","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbetta%2Fdoxie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbetta%2Fdoxie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbetta%2Fdoxie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbetta%2Fdoxie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbetta","download_url":"https://codeload.github.com/cbetta/doxie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224225351,"owners_count":17276435,"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":["doxie","doxie-api","libraries","scanner","sdk"],"created_at":"2024-11-12T05:39:53.653Z","updated_at":"2024-11-12T05:39:54.248Z","avatar_url":"https://github.com/cbetta.png","language":"Ruby","funding_links":["https://github.com/sponsors/cbetta"],"categories":[],"sub_categories":[],"readme":"# Ruby API library for Doxie Go Wifi\n\n[![Gem Version](https://badge.fury.io/rb/doxie.svg)](https://badge.fury.io/rb/doxie) [![Build Status](https://travis-ci.com/cbetta/doxie.svg?branch=master)](https://travis-ci.com/cbetta/doxie)\n\nA client library for the API available on WiFi-enabled [Doxie scanners](http://getdoxie.com). The specification of the API is available in their [developer documentation](/docs).\n\n## Scanners Supported\n\nThis library supports the following scanners:\n\n* Doxie Go Wifi (DX250)\n* Doxie Go SE (DX255)\n* Doxie Q (DX300)\n\n## Installation\n\nEither install directly or via bundler.\n\n```rb\ngem 'doxie'\ngem 'doxie-scanner' # optional if your Doxie is not on a fixed IP\n```\n\n## Usage\n\n### Optional: Finding your Doxie's IP\n\nThis optional step requires the [`doxie-scanner`](https://github.com/cbetta/doxie-scanner) gem. This gem has a bigger dependency than the `doxie` gem, which is why it has been intentionally separated into a seperate library.\n\n```rb\nrequire 'doxie/scanner'\nDoxie::Scanner.ips\n=\u003e [\n    [0] \"192.168.1.2\"\n]\n```\n\n### Client\n\nThe client accepts an `ip` address, a scanner model number (defaults to `Doxie::GO`) and an optional `password`. You can omit the `password` if your Doxie has non set.\n\n```rb\nrequire 'doxie'\nclient = Doxie::Client.new(\n    ip: '192.168.1.2', \n    model: Doxie::Q, # of Doxie::GO, or Doxie::GO_SE\n    password: 'test'\n)\n```\n\nAlternatively, you can use the [`doxie-scanner`](https://github.com/cbetta/doxie-scanner) gem to automatically connect to any scanner found. \n\n```rb\nrequire 'doxie'\nrequire 'doxie/scanner'\n\nclient = Doxie::Client.new(\n  Doxie::Scanner.devices.first\n)\n```\n\n### `GET /hello.json`\n\nReturns status information for the scanner, firmware, network mode, and password\nconfiguration. Accessing this command does not require a password if one has been\nset. The values returned depend on whether the scanner is creating its own\nnetwork or joining an existing network.\n\n```rb\nclient.hello\n=\u003e {\n           \"model\" =\u003e \"DX250\",\n            \"name\" =\u003e \"Doxie_062300\",\n    \"firmwareWiFi\" =\u003e \"1.29\",\n     \"hasPassword\" =\u003e true,\n             \"MAC\" =\u003e \"00:11:11:11:11:00\",\n            \"mode\" =\u003e \"Client\",\n         \"network\" =\u003e \"YourWifi\",\n              \"ip\" =\u003e \"192.168.1.2\"\n}\n```\n\n* `model`: DX250 for the Doxie Go WiFi, DX255 for the Doxie Go SE, and DX300 for the Doxie Q.\n* `name`: The name of the scanner, which defaults to the form \"Doxie_XXXXXX\".\n  The name of a scanner can be changed by using the Doxie desktop app.\n* `firmwareWiFi`: The Wi-Fi firmware version.\n* `hasPassword`: Indicates whether a password has been set to authenticate API\n  access. Passwords can be set and removed by using the Doxie desktop app.\n* `MAC`: The MAC address of the scanner as shown on the scanner's bottom\n  label.\n* `mode`: \"AP\" if the scanner is creating its own network or \"Client\" if the\n  scanner is joining an existing network.\n* `network`: If the scanner is in \"Client\" mode, this is the name of the\n  network it has joined.\n* `ip`: If the scanner is in \"Client\" mode, this is the IP of the scanner on\n  the network it has joined.\n\n### `GET /hello_extra.json`\n\nReturns additional status values. These values are accessed separately from\nthose in `/hello.json` because there can be a delay of several seconds in\nloading them. Accessing this command does not require a password if one has\nbeen set.\n\n```rb\nclient.hello_extra\n=\u003e {\n                    \"firmware\" =\u003e \"0.26\",\n    \"connectedToExternalPower\" =\u003e true\n}\n```\n\n* `firmware`: The scanner firmware version.\n* `connectedToExternalPower`: Indicates whether the scanner is connected to\n  its AC adapter versus running on battery power. This value is not cached, so\n  it immediately reflects any state changes.\n\nThis method is only available for the original Doxie Go WiFi model.\n\n### `GET /restart.json`\n\nRestarts the scanner's Wi-Fi system. The scanner's status light blinks blue\nduring the restart.\n\n```rb\nclient.restart\n=\u003e true\n```\n\n### `GET /scans.json`\n\nReturns an array of all scans currently in the scanner’s memory. After scanning\na document, the scan will available via the API several second later.\n\n```rb\nclient.scans\n=\u003e [\n    [0] {\n            \"name\" =\u003e \"/DOXIE/JPEG/IMG_0001.JPG\",\n            \"size\" =\u003e 900964,\n        \"modified\" =\u003e \"2010-05-01 00:02:38\"\n    }\n]\n```\n\nCalling this function immediately after scanning something may return a blank\nresult, even if there are other scans on the scanner, due to the scanner's\nmemory being in use. Consider retrying if a successful HTTP status code is\nreturned along with a blank body.\n\n### `GET /scans/recent.json`\n\nReturns the path to the last scan if available. Monitoring this value for\nchanges provides a simple way to detect new scans without having to fetch the\nentire list of scans.\n\n```rb\nclient.recent_scans\n=\u003e {\n    \"path\" =\u003e \"/DOXIE/JPEG/IMG_0001.JPG\"\n}\n```\n\n### `GET /scans/DOXIE/JPEG/IMG_XXXX.JPG`\n\nThere are 2 ways to get a scan off your Doxie. The first is to get the raw binary content and then do something with it yourself.\n\n```rb\nclient.scan \"/DOXIE/JPEG/IMG_0001.JPG\"\n=\u003e \"...?]?1:Xt?????'A??}:\u003c??13???z*???}?rT???????z!ESj?/?...\"\n```\n\nThe other is to pass in a filename:\n\n```rb\nclient.scan \"/DOXIE/JPEG/IMG_0001.JPG\", 'test.jpg'\n=\u003e true\n```\n\n### `GET /thumbnails/DOXIE/JPEG/IMG_XXXX.JPG`\n\nThere are 2 ways to get a thumbnail off your Doxie. The first is to get the raw binary content and then do something with it yourself.\n\n```rb\nclient.thumbnail \"/DOXIE/JPEG/IMG_0001.JPG\"\n=\u003e \"...?]?1:Xt?????'A??}:\u003c??13???z*???}?rT???????z!ESj?/?...\"\n```\n\nThe other is to pass in a filename:\n\n```rb\nclient.thumbnail \"/DOXIE/JPEG/IMG_0001.JPG\", 'test.jpg'\n=\u003e true\n```\n\nThumbnails are constrained to fit within 240x240 pixels. Thumbnails for new\nscans are not generated until after the scan has been made available in\n`/scans.json` and `/scans/recent.json`. This function will return 404 Not Found\nif the thumbnail has not yet been generated. Retrying after a delay is\nrecommended to handle such cases.\n\n### `DELETE /scans/DOXIE/JPEG/IMG_XXXX.JPG`\n\nDeletes the scan at the specified path.\n\n```rb\nclient.delete_scan \"/DOXIE/JPEG/IMG_0001.JPG\"\n=\u003e true\n```\n\nDeleting takes several seconds because a lock on the internal storage must be\nobtained and released. Deleting may fail if the lock cannot be obtained\n(e.g., the scanner is busy), so consider retrying on failure conditions. When\ndeleting multiple scans, use `/scans/delete.json` for best performance.\n\nThis will raise an error if the file is no longer present (`Doxie::Client::Error\u003cNet::HTTPForbidden\u003e`)\n\n### `POST /scans/delete.json`\n\nDeletes multiple scans in a single operation. This is much faster than deleting\neach scan individually.\n\n```rb\nclient.delete_scans [\"/DOXIE/JPEG/IMG_0001.JPG\", \"/DOXIE/JPEG/IMG_0002.JPG\"]\n=\u003e true\n```\n\nThis will raise an error if the files are no longer present (`Doxie::Client::Error\u003cNet::HTTPForbidden\u003e`)\n\n## Contributing\n\n 1. **Fork** the repo on GitHub\n 2. **Clone** the project to your own machine\n 3. **Commit** changes to your own branch\n 4. **Push** your work back up to your fork\n 5. Submit a **Pull request** so that we can review your changes\n\n### Development\n\n* `bundle install` to get dependencies\n* `rake` to run tests\n* `rake console` to run a local console with the library loaded\n\n## Credits and License\n\nThanks to [@timcraft](https://github.com/timcraft) for the excellent [Nexmo Ruby library](https://github.com/Nexmo/nexmo-ruby) which helped me remember how to nicely wrap the Doxie API.\n\nThis library is released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbetta%2Fdoxie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbetta%2Fdoxie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbetta%2Fdoxie/lists"}