{ "info": { "author": "Dan Michael O. Hegg\u00f8", "author_email": "d.m.heggo@ub.uio.no", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "[![PyPI](https://img.shields.io/pypi/v/slipsomat.svg)](https://pypi.org/project/slipsomat/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/slipsomat.svg)](https://pypi.org/project/slipsomat/)\n[![PyPI - License](https://img.shields.io/pypi/l/slipsomat.svg)](https://github.com/scriptotek/alma-slipsomat/blob/master/LICENSE)\n\n`slipsomat` is a small tool for pulling and pushing letters to Alma using\nSelenium browser automation. It allows to you to keep an up-to-date local\ncopy of all the letters, so you can keep them under version control. And\nby storing checksums of all the letters, it can warn you if you're about\nto overwrite a letter that has been modified by someone else without pulling\nin their changes.\n\nThis tool exists because Alma doesn't provide a way to synchronize the letters,\nonly a web form to edit them. With over 100 different letters, editing them\nusing a web form (with no syntax highlighting) is very tedious. We have also\nbrought this up on Ideas Exchange \u2013 feel free to add your vote to\n[our idea there](http://ideas.exlibrisgroup.com/forums/308173-alma/suggestions/12471084-synchronizing-xsl-templates-with-external-systems).\n\n## Setup\n\nSlipsomat should work with Python 3.5 and later on most platforms.\nPlease use our\n[issue tracker](https://github.com/scriptotek/alma-slipsomat/issues)\nto report any problems.\n\nInstall with pip:\n\n pip install -U slipsomat\n\nOnce installed, you can run `slipsomat` from any directory containing a\n`slipsomat.cfg` config file.\nTo get started, create an empty directory with a `slipsomat.cfg` file with the\nfollowing contents:\n\n```\n[login]\nauth_type=\ndomain=\ninstance=\ninstitution=\nusername=\npassword=\n\n[selenium]\nbrowser=firefox\ndefault_timeout=20\n\n[window]\nwidth=1300\nheight=700\n```\n\nwhere you fill in the blank values.\n\n* Set `auth_type=Feide` if you authenticate using Feide SAML. Set `auth_type=SAML`\n for Shibboleth or other SAML providers (submit an issue if it doesn't work with\n your provider!).\n Set `auth_type=basic` to use the standard Alma login.\n* `domain` is your Feide domain, e.g. `uio.no`. If you don't use Feide as your\n SAML provider, you can leave this empty.\n* `instance` is the Alma instance name, which is the first part of your ALMA URL.\n If your Alma URL is `bibsys-k.alma.exlibrisgroup.com`, then `bibsys-k` is the\n instance name.\n* `institution` the Alma institution name, e.g. `47BIBSYS_UBO`\n* `username` is your username.\n* `password` can be left blank if you want to be asked for it each time. This\n is the recommended solution, since the password is stored in plain text.\n* `browser` can be set to `firefox`, `chrome` or `phantomjs`. The corresponding\n driver must be installed (GeckoDriver for Firefox, ChromeDriver for Chrome).\n I've had success with all three browsers, but from time to time a browser can\n start crashing or freezing at some point. First thing to try then is to upgrade\n both Selenium and the browser driver. If there's still problems, switch to\n another browser for some time. If *that* doesn't help, there might be an issue\n with slipsomat. Please file an issue.\n\n## Debugging\n\nIf you have `inquirer` installed (does not work on Windows), slipsomat will give\nyou some options for starting a debug session if the script crashes.\n\n## Getting started\n\nThe `slipsomat` command will give you an interactive shell where you can type various\ncommands. Type `help` for an overview.\n\nTo get started in an empty directory, type `pull` to pull in all the XSLT files from your Alma\ninstance and store them in a folder named `xsl` (will be created if not there already).\nOptionally, type `defaults` to pull in all default letters too. Note that a `status.json` file\nis also created. This holds the checksums for all the letters, allowing the script to easily keep\ntrack of which files have been modified (locally or in Alma).\n\nOnce you have a directory with all your files you're free to put them under version control\nif you like. Here's the repo we use for our files: https://github.com/scriptotek/alma-letters-ubo\n\n## Workflow\n\nIn a workspace directory (a directory having a `slipsomat.cfg` file):\n\n1. Start by doing `git pull` to pull in changes from other users.\n\n2. `slipsomat` to start the script\n\n3. Optional: the slipsomat command `pull` will check if any files have been updated\n directly in Alma (without using `slipsomat`), fetch those and update `status.json`.\n Comparison is done by comparing the update date in Alma with the update date in `status.json`.\n Alma does not provide time granularity for updates, only date, so for files that have been\n modified today, the script will open the letter in Alma to get the text and calculate a\n checksum to compare with the checksum in `status.json`.\n Note: If you skip this step, `slipsomat` will still warn you if you try to push a\n letter that have been modified remotely (checksums not matching), but then you will\n have to merge manually.\n\n4. After having made modifications to one or more letters, run the slipsomat command `push`\n to push the updates to Alma. Comparison is done by comparing checksums of the local files\n with the checksums in `status.json`. Before making any changes, the script will print a list\n of files and confirm that you want to upload these.\n\n5. After having tested the modifications, do a `git commit` (remember to include the updated\n `status.json`) and `git push`\n\nThe shell has a command history, and tab completion. For example `test Ful`.\n\n### Updating default letters\n\n- Use the `slipsomat` command `defaults` to pull in all default letters.\n Note that the command takes quite some time to run, since all letters have to\n be checked as Alma provides no information whatsoever on when the default\n letters were last updated.\n\n\n### Testing the output of a letter\n\nAlma lets you test the output on the Notification Template page, but doing this\nmanually each time is boring, so slipsomat provides you with the `test` command\nto automate that.\n\nCreate a folder called \"test-data\" in the same folder as the `slipsomat.cfg` file.\nAdd one or more XML files you want to test there.\n\nStart `slipsomat` and run the command\n\n test filename.xml\n\nwhere `filename.xml` is a file in the \"test-data\" folder. This will upload the\nXML file to the Notification Template page and store the resulting HTML output\nand a screenshot in the \"test-data\" folder.\n\nTo test multiple files at the same time, you can use Unix style pathname pattern\nexpansion (\"globbing\"). E.g. to test all XML files in the \"test-data\" folder, use the\n`*` wildcard character:\n\n test *.xml\n\nBy default, the command will use English as the letter language. To test\nanother language, just append `@` and the language code to the filename.\nExample:\n\n test filename.xml@nn\n\nYou can even test multiple languages in one go by specifying multiple language\ncodes separated by comma like so:\n\n test filename.xml@en,no,nn\n\nThis can also be used in combination with globbing. To test all XML files in the\n\"test-data\" folder in three languages:\n\n test *.xml@en,no,nn\n\n## See also\n\n* [open issues](https://github.com/scriptotek/alma-slipsomat/issues)\n* the [alma-letters-ubo repo](https://github.com/scriptotek/alma-letters-ubo) for our XSLT files\n\n\n## Development\n\n### Editable install\n\nIf you want an *editable install* that you can hack on yourself:\n\n git clone https://github.com/scriptotek/alma-slipsomat.git\n cd alma-slipsomat\n pip install -U -e .\n\n\n### Using slipsomat as a Python library\n\nGiven that you have created a `slipsomat.cfg` file, here's how to start\nexperimenting:\n\n```python\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support import expected_conditions as EC\nfrom slipsomat.worker import Worker\nfrom slipsomat.slipsomat import TemplateConfigurationTable\n\nworker = Worker('slipsomat.cfg')\n\n# Start the browser and log in using the credentials from slipsomat.cfg\nworker.connect()\n\n# Open and parse the letters table\ntable = TemplateConfigurationTable(worker)\n\n# Open the default version of the SmsFulCancelRequestLetter letter\ntable.open_default_letter('xsl/letters/sms/SmsFulCancelRequestLetter.xsl')\n\n# Use Selenium to click some element\nwait = worker.waiter()\nelement = wait.until(EC.element_to_be_clickable((By.XPATH, '//button[@aria-label=\"Open Alma configuration\"]')))\nelement.click()\n```\n\nNote: During development, it might be a good idea to set `default_timeout` in\n`slipsomat.cfg` to a small value (like 3 seconds) to avoid having to wait a\nlong time every time you write a wrong selector.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/scriptotek/alma-slipsomat", "keywords": "alma browser-automation", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "slipsomat", "package_url": "https://pypi.org/project/slipsomat/", "platform": "", "project_url": "https://pypi.org/project/slipsomat/", "project_urls": { "Homepage": "https://github.com/scriptotek/alma-slipsomat" }, "release_url": "https://pypi.org/project/slipsomat/0.3.1/", "requires_dist": [ "selenium", "colorama", "python-dateutil", "questionary" ], "requires_python": "", "summary": "Sync Alma slips & letters", "version": "0.3.1" }, "last_serial": 5188555, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "d8e264d19a387ebab25c56d549d7bbed", "sha256": "92cab58a27206fb115e1028f90ae361f1b05b50dd916063f7b383b70289a557e" }, "downloads": -1, "filename": "slipsomat-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d8e264d19a387ebab25c56d549d7bbed", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17091, "upload_time": "2018-05-10T20:37:49", "url": "https://files.pythonhosted.org/packages/83/3a/b297add2b55a14c74535f367cd182688d19406b3133927e4744ea6ceb06c/slipsomat-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "77688ef8c937c52a5f7b10d63799dda1", "sha256": "58f89a8434ec62498e86ca89ac393048100b07a15e6f72c4fa880fb90c001ecb" }, "downloads": -1, "filename": "slipsomat-0.2.1.tar.gz", "has_sig": false, "md5_digest": "77688ef8c937c52a5f7b10d63799dda1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15906, "upload_time": "2018-05-10T20:37:51", "url": "https://files.pythonhosted.org/packages/db/6b/fa39ebfe1d6ad7bd3a7bf541631cfb8b247966bedb391f9e29bb78e58baf/slipsomat-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "cf7c943852b31e20381ca1e3d40c5cb4", "sha256": "6fa31348f1a314b7d56ab99eb4ce377bdcdf6921ff7ae5202b24f4a6f40ade5b" }, "downloads": -1, "filename": "slipsomat-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cf7c943852b31e20381ca1e3d40c5cb4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17112, "upload_time": "2018-05-10T21:26:50", "url": "https://files.pythonhosted.org/packages/1b/13/34028a099aaca77a78a4611fefdf1647a9f7cf19ecd791407a463920c88b/slipsomat-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4dceeffb0e8c09b97b9030d45582ac6f", "sha256": "d4a0ad7d0742da8bd323d46b08616d36f8862c6297c1484c936d05f696a275fe" }, "downloads": -1, "filename": "slipsomat-0.2.2.tar.gz", "has_sig": false, "md5_digest": "4dceeffb0e8c09b97b9030d45582ac6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16020, "upload_time": "2018-05-10T21:26:52", "url": "https://files.pythonhosted.org/packages/38/78/307c2c0c4903768963a203890b57940ed39a512447e251a41758180b4f1d/slipsomat-0.2.2.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "571b93c977bc48360090664605ec0e26", "sha256": "cb78614414ad06695d53ffb52b0dc62b88a71f2600a9f0f380aca6c9bb3be20b" }, "downloads": -1, "filename": "slipsomat-0.2.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "571b93c977bc48360090664605ec0e26", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17128, "upload_time": "2018-05-23T15:13:51", "url": "https://files.pythonhosted.org/packages/ae/e2/9e65449779cd2fee97445588db908469f24c015afe3c95b453e3eb29cfa7/slipsomat-0.2.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3bcfb9739e8ec35c04b0842568958f46", "sha256": "63b47b4dd9d3830a2a1951081cada7b7204c34e797e564fc4fa14a27003f37e2" }, "downloads": -1, "filename": "slipsomat-0.2.4.tar.gz", "has_sig": false, "md5_digest": "3bcfb9739e8ec35c04b0842568958f46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16050, "upload_time": "2018-05-23T15:13:53", "url": "https://files.pythonhosted.org/packages/de/b4/42b7b8ad005616d438e6e46f7700c6faac25cece8a2af58ca31e26d5195b/slipsomat-0.2.4.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "440c6f5bb9479e267793c7fda5411712", "sha256": "cda0d75cdde8e2845c90097143445fc6c0756a165cc88de41c4eebb316aae75b" }, "downloads": -1, "filename": "slipsomat-0.2.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "440c6f5bb9479e267793c7fda5411712", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17140, "upload_time": "2018-09-25T12:15:18", "url": "https://files.pythonhosted.org/packages/08/2f/58c03205c2dd906b36bf80fdf1988545d9cea66940fd67dc4c721a54654a/slipsomat-0.2.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0105a99e4df5123cee87bfe096132a76", "sha256": "7dbc078c902dba1eeee8639e5a6ad40f95086fb31cc10ccd5922826362d1983e" }, "downloads": -1, "filename": "slipsomat-0.2.6.tar.gz", "has_sig": false, "md5_digest": "0105a99e4df5123cee87bfe096132a76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16065, "upload_time": "2018-09-25T12:15:20", "url": "https://files.pythonhosted.org/packages/39/b8/0a66c57cd1a421e57acef9eba22934cccd0b8502b4c4a787c382d267bcf2/slipsomat-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "deb6781b2baf054d29edbc577c1277af", "sha256": "268ee0dab2f7cc00f623d89964e198b331dac25c330e6f9eb303de688e665f0d" }, "downloads": -1, "filename": "slipsomat-0.2.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "deb6781b2baf054d29edbc577c1277af", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17193, "upload_time": "2018-11-14T19:23:50", "url": "https://files.pythonhosted.org/packages/de/b9/95a98c7391a3ec274fa6f94671e35ba01e5156478f3a355d4337274002b3/slipsomat-0.2.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8bf65314e9726d471c6a84bc38fb8c28", "sha256": "fd70498633ffa3551f1f4162065c0aa11f79be398e3e9bed10c7191d3f1e25e9" }, "downloads": -1, "filename": "slipsomat-0.2.7.tar.gz", "has_sig": false, "md5_digest": "8bf65314e9726d471c6a84bc38fb8c28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19679, "upload_time": "2018-11-14T19:23:52", "url": "https://files.pythonhosted.org/packages/04/9b/cd2fab52141f2cd4696cf0554ee016e74814d5fba5149caa0e7bcbcc3890/slipsomat-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "58a4b8d1f5a9a50b5e6d7bff339dceb7", "sha256": "4c623aa6582b43056a40af531b783d56392f3b7f4646a49f379d3cd40895ee14" }, "downloads": -1, "filename": "slipsomat-0.2.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "58a4b8d1f5a9a50b5e6d7bff339dceb7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17245, "upload_time": "2019-01-08T16:05:25", "url": "https://files.pythonhosted.org/packages/55/01/e64dc177b7defefd6eba97f9df28612e6776494b6ad5cff175ec149a4c82/slipsomat-0.2.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8a1e553929a13181ce825a2867dd155e", "sha256": "dd942977ae170b72a550e35cfa76045b0d9afb412601e65e03f4be443193d3d9" }, "downloads": -1, "filename": "slipsomat-0.2.8.tar.gz", "has_sig": false, "md5_digest": "8a1e553929a13181ce825a2867dd155e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16157, "upload_time": "2019-01-08T16:05:27", "url": "https://files.pythonhosted.org/packages/b1/bc/1956b55df401857096d0d16375c416a50dec007c71715de161bdff017c51/slipsomat-0.2.8.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "39b28e365e64da2c94a349eb6f76ca0a", "sha256": "f023b70dbe53127062fcbe9f35edefb734104dbef1803d9b6d823b6b8d6e9943" }, "downloads": -1, "filename": "slipsomat-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "39b28e365e64da2c94a349eb6f76ca0a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17339, "upload_time": "2019-02-05T10:23:03", "url": "https://files.pythonhosted.org/packages/4c/19/44c84e4b3f1ab0d9294963b3ac08ba04f0da6a1831e96c12c8fd891409d7/slipsomat-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3d4ca102859591d6bb6f72b2af510a62", "sha256": "a4448ee1e1f84fdd9330ab74f2d1a73992876e992d4100342b16b6d582a77a47" }, "downloads": -1, "filename": "slipsomat-0.3.0.tar.gz", "has_sig": false, "md5_digest": "3d4ca102859591d6bb6f72b2af510a62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16221, "upload_time": "2019-02-05T10:23:05", "url": "https://files.pythonhosted.org/packages/94/27/26c90bfb8f79542ae531afa6a7f5bb02432b7db13e75ae6f22121749000b/slipsomat-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "61671771cec989e90bd05450bc11c294", "sha256": "eb0a598b3a35ed1289781d8816aae9845e101f3f837f5aaf4c65729bdbd47ec6" }, "downloads": -1, "filename": "slipsomat-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "61671771cec989e90bd05450bc11c294", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17388, "upload_time": "2019-04-25T15:06:18", "url": "https://files.pythonhosted.org/packages/d5/4b/a52e10c1e502d498be2a6efa9fde252163b8571c61308cf1239102be6bc5/slipsomat-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df0f75919ed417d940cc03432a9a9d2f", "sha256": "698e262dcb10322b1b4242f9aa77f954b27b149a7136630327d7aa9d8cc226cc" }, "downloads": -1, "filename": "slipsomat-0.3.1.tar.gz", "has_sig": false, "md5_digest": "df0f75919ed417d940cc03432a9a9d2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16301, "upload_time": "2019-04-25T15:06:21", "url": "https://files.pythonhosted.org/packages/86/55/6bcf796caf9b5913c695c221ba0d7267fea4cdb3ebcf809cf98f0d98a2a8/slipsomat-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "61671771cec989e90bd05450bc11c294", "sha256": "eb0a598b3a35ed1289781d8816aae9845e101f3f837f5aaf4c65729bdbd47ec6" }, "downloads": -1, "filename": "slipsomat-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "61671771cec989e90bd05450bc11c294", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17388, "upload_time": "2019-04-25T15:06:18", "url": "https://files.pythonhosted.org/packages/d5/4b/a52e10c1e502d498be2a6efa9fde252163b8571c61308cf1239102be6bc5/slipsomat-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df0f75919ed417d940cc03432a9a9d2f", "sha256": "698e262dcb10322b1b4242f9aa77f954b27b149a7136630327d7aa9d8cc226cc" }, "downloads": -1, "filename": "slipsomat-0.3.1.tar.gz", "has_sig": false, "md5_digest": "df0f75919ed417d940cc03432a9a9d2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16301, "upload_time": "2019-04-25T15:06:21", "url": "https://files.pythonhosted.org/packages/86/55/6bcf796caf9b5913c695c221ba0d7267fea4cdb3ebcf809cf98f0d98a2a8/slipsomat-0.3.1.tar.gz" } ] }