cdpop


Namecdpop JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryPop open cash drawer with http GET request
upload_time2024-03-01 00:06:38
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT
keywords tornado
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cdpop

Pop open cash drawer using http or https GET request:

	GET /status	Return cash drawer status
	GET /open	Request cash drawer open

If authentication is configured, supply user and/or auth
as query parameters, eg:

	GET /status?auth=Ricim8Knak

Requests to open drawer will return successfully (200) as
soon as possible, but will be processed in turn once access
to the attached device is available. No feedback is provided for
an open request.

Requests for status will block until a valid status can be read
from the attached device. In the case of a hardware error,
status requests will return Internal Server Error (500).

## Usage

	$ cdpop [config.json]

## Requirements

   - python >= 3.9
   - tornado
   - posiflex-hidcd

## Configuration

Copy example config to a new file and edit as required.
Available configuration options:

   - port (int) TCP service port, default: 41514 (optional)
   - host (string) Listen address, default: "localhost" (optional)
   - cert (string) TLS certificate path, default: None (optional)
   - key (string) TLS private key path, default: None (optional)
   - auth (string) Authorisation key, default: None (optional)
   - user (string) Authorisation username, default: None (optional)
   - drawer (int) Cash drawer number, default: None (optional)

Notes:

   - If drawer number is not specified, cdpop will connect to
     the first hid cash drawer found. See related project
     [posiflex-hidcd](https://github.com/ndf-zz/posiflex-hidcd)
     for details.
   - To listen on all addresses, specify the empty string "" for host.


## MacOS Installation

Install xcode developer tools:

	$ xcode-select --install

Install brew according to [brew website](https://brew.sh/).

Install hidapi using brew:

	$ brew install hidapi

Install python3 if not already installed:

	$ brew install python@3.12

Using python, create a venv and install cdpop packages using pip:

	$ python3 -m venv cdpop --system-site-packages
	$ ./cdpop/bin/pip install cdpop

Optionally, create a cdpop config file.

Create launch agent plist file (see example cdpop.plist),
copy to ~/Library/LaunchAgents and enable using launchctl:

	$ cp cdpop.plist /Library/LaunchAgents
	$ launchctl load ~/Library/LaunchAgents/cdpop.plist
	$ launchctl enable xxx/yyy/cdpop
	$ launchctl kickstart -k xxx/yyy/cdpop

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "cdpop",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "tornado",
    "author": "",
    "author_email": "Nathan Fraser <ndf-zz@6-v.org>",
    "download_url": "https://files.pythonhosted.org/packages/53/74/9aae6297ac2b06a2e41b639ba3db64534df6429da5c71e456169ab4daafb/cdpop-1.0.0.tar.gz",
    "platform": null,
    "description": "# cdpop\n\nPop open cash drawer using http or https GET request:\n\n\tGET /status\tReturn cash drawer status\n\tGET /open\tRequest cash drawer open\n\nIf authentication is configured, supply user and/or auth\nas query parameters, eg:\n\n\tGET /status?auth=Ricim8Knak\n\nRequests to open drawer will return successfully (200) as\nsoon as possible, but will be processed in turn once access\nto the attached device is available. No feedback is provided for\nan open request.\n\nRequests for status will block until a valid status can be read\nfrom the attached device. In the case of a hardware error,\nstatus requests will return Internal Server Error (500).\n\n## Usage\n\n\t$ cdpop [config.json]\n\n## Requirements\n\n   - python >= 3.9\n   - tornado\n   - posiflex-hidcd\n\n## Configuration\n\nCopy example config to a new file and edit as required.\nAvailable configuration options:\n\n   - port (int) TCP service port, default: 41514 (optional)\n   - host (string) Listen address, default: \"localhost\" (optional)\n   - cert (string) TLS certificate path, default: None (optional)\n   - key (string) TLS private key path, default: None (optional)\n   - auth (string) Authorisation key, default: None (optional)\n   - user (string) Authorisation username, default: None (optional)\n   - drawer (int) Cash drawer number, default: None (optional)\n\nNotes:\n\n   - If drawer number is not specified, cdpop will connect to\n     the first hid cash drawer found. See related project\n     [posiflex-hidcd](https://github.com/ndf-zz/posiflex-hidcd)\n     for details.\n   - To listen on all addresses, specify the empty string \"\" for host.\n\n\n## MacOS Installation\n\nInstall xcode developer tools:\n\n\t$ xcode-select --install\n\nInstall brew according to [brew website](https://brew.sh/).\n\nInstall hidapi using brew:\n\n\t$ brew install hidapi\n\nInstall python3 if not already installed:\n\n\t$ brew install python@3.12\n\nUsing python, create a venv and install cdpop packages using pip:\n\n\t$ python3 -m venv cdpop --system-site-packages\n\t$ ./cdpop/bin/pip install cdpop\n\nOptionally, create a cdpop config file.\n\nCreate launch agent plist file (see example cdpop.plist),\ncopy to ~/Library/LaunchAgents and enable using launchctl:\n\n\t$ cp cdpop.plist /Library/LaunchAgents\n\t$ launchctl load ~/Library/LaunchAgents/cdpop.plist\n\t$ launchctl enable xxx/yyy/cdpop\n\t$ launchctl kickstart -k xxx/yyy/cdpop\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Pop open cash drawer with http GET request",
    "version": "1.0.0",
    "project_urls": {
        "homepage": "https://github.com/ndf-zz/cdpop"
    },
    "split_keywords": [
        "tornado"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b73d0f11eb26d2357b506a649306a711e6d92433b99913f02b5ccf0916ae726",
                "md5": "ab7e51d9a97161c4118b0663578f51c6",
                "sha256": "459fa696d3ff7812c62f20d675c251abe782cba3b3ef1be4da9dd52329959c71"
            },
            "downloads": -1,
            "filename": "cdpop-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab7e51d9a97161c4118b0663578f51c6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 5536,
            "upload_time": "2024-03-01T00:06:35",
            "upload_time_iso_8601": "2024-03-01T00:06:35.670319Z",
            "url": "https://files.pythonhosted.org/packages/9b/73/d0f11eb26d2357b506a649306a711e6d92433b99913f02b5ccf0916ae726/cdpop-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53749aae6297ac2b06a2e41b639ba3db64534df6429da5c71e456169ab4daafb",
                "md5": "296abb57dd4193c39ff7e122c710f414",
                "sha256": "a4bade716310c8b6ea0b575f114308446741dfac3142941c38f212afa83812ea"
            },
            "downloads": -1,
            "filename": "cdpop-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "296abb57dd4193c39ff7e122c710f414",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5215,
            "upload_time": "2024-03-01T00:06:38",
            "upload_time_iso_8601": "2024-03-01T00:06:38.319472Z",
            "url": "https://files.pythonhosted.org/packages/53/74/9aae6297ac2b06a2e41b639ba3db64534df6429da5c71e456169ab4daafb/cdpop-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-01 00:06:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ndf-zz",
    "github_project": "cdpop",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cdpop"
}
        
Elapsed time: 0.29393s