{ "info": { "author": "Nathan Conroy, Gene Callahan", "author_email": "nathanconroydev@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# PropArgs\nA module for systematically organizing user preferences acquired from a data store, env vars, a parameter file, the command line and/or user choices.\n\n## How it Works\n\n### Overview\nPropArgs is initialized by sequentially loading the following five stages of input:\n\n1. Data Store\n2. Property Dictionary\n3. Environment\n4. Command Line\n5. User\n\nThe above is the default ordering. The user may change that order.\n\nProperties may be added in any stage except User. A property defined in one stage may be overwritten in later stages. \n\nEach property has a key and a value and is accessed like a dictionary:\n\n >>> pa = PropArgs.create_props()\n >>> pa[\"prop_nm\"] = 1 # assigns the value 1 to the property \"prop_nm\"\n >>> pa[\"prop_name\"]\n 1\n\nIn addition to this, each property may have associated metadata. These are at present: a question for the\nuser-input prompt, a datatype, an upper bound, and a lower bound. If at any point in the loading process the\nmetadata rules are broken (e.g. the val exceeds the upper bound) an error will be raised.\n\nThe system has some similarities to the traitlets configuration module developed for iPython and Jupyter, but is more flexible, seeks configuration info from more sources, and is not tied to Python classes. (The property structure itself keeps the config info, but those values may be loaded into clases or not as per the needs of the application.)\n\n### Details\n\n#### Data Store\nThe Data Store will be either a JSON file or a database.\n\nThe Data Store file will be specified on initialization\n\n PropArgs.create_props(ds_file=file_name)\n\nThe JSON formatting is as follows:\n\n {\n \"prop_name_1\": {\n \"val\": 1,\n \"question\": \"What value should this property have?\",\n \"atype\": \"INT\",\n \"hival\": 10,\n \"lowval\": 0\n },\n \"prop_name_2\": {\n \"val\": \"Hello World.\"\n },\n \"prop_name_3\": {\n }\n }\n\nNote that a property need not have all (or any) fields defined. If no \"val\" is specified, it defaults to `None`.\n\nDetails on database data stores to come ...\n\n\n#### Property Dictionary\nProperties may be loaded by passing a dictionary at initialization:\n\n >>> pa = PropArgs.create_props(prop_dict=prop_dict)\n\nthe dictionary formatted as follows:\n\n {\n \"prop_name_1\": {\n \"val\": 1,\n \"question\": \"What value should this property have?\",\n \"atype\": \"INT\",\n \"hival\": 10,\n \"lowval\": 0\n },\n \"prop_name_2\": {\n \"val\": \"Hello World.\"\n }\n }\n\n\n#### Environment\nPropArgs will read and add all the environment variables of the program in which PropArgs is initialized.\n(i.e. everything in python's os.environ)\n\n\n#### Command Line\nProperties will be read from the command line as follows\n\n $ python program_reading_props.py --props prop_1=val_1,prop_2=val_2,prop_3=val_3 #etc...\n\n#### User\nThe final stage is to ask the user for input. The user will only be prompted about properties that have a question.\n\nThe default behavior is to prompt questions on the client's command line:\n\n >>> pa = PropArgs.create_props()\n What is the value of prop_1? (\"I'm the default prop value\") \n What is the value of prop_2? [0.0-100.0] (20) \n\nHowever, the client program may take over and ask questions in its own way. In this case we will provide a flag\nthat skips the user stage, and instead the client will call `pa.get_questions()` for a JSON of the properties with\nquestions.\n\n >>> pa = PropArgs(skip_user_questions=True)\n >>> pa.get_questions()\n {\n \"prop_name_1\": {\n \"val\": 2.0,\n \"question\": \"\",\n \"atype\": \"DBL\",\n \"hival\": 10.0,\n \"lowval\": -0.5\n },\n \"prop_name_2\": {\n \"val\": \"default\",\n \"question\": \"What should prop_name_2 be?\"\n }\n }\n\n#### Other Ways Props May Be Added Or Modified\n\nOutside of accessing a PropArgs object like a dictionary, values may be gotten through the \n`get(key, default=None)` method. Or if the key has not already been associated with a property,\na new property will be bound to `default` (or `None` if a `default` isn't specified).\n\n >>> pa = PropArgs.create_props()\n >>> pa.get('new_prop', default=2)\n 2\n >>> pa.get('newer_prop')\n None\n\n## Credits\nIdea - Robert Dodson\n\nDevelopment - Gene Callahan and Nathan Conroy\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/gcallah/PropArgs", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "propargs", "package_url": "https://pypi.org/project/propargs/", "platform": "", "project_url": "https://pypi.org/project/propargs/", "project_urls": { "Homepage": "https://github.com/gcallah/PropArgs" }, "release_url": "https://pypi.org/project/propargs/0.0.10/", "requires_dist": null, "requires_python": "", "summary": "A module for systematically organizing user preferences acquired from a database, env vars, a parameter file, or user choices.", "version": "0.0.10" }, "last_serial": 5609668, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b551fcaa315d34da5ffd5e6054ed5b90", "sha256": "b2e8af59a83cd39b6d1f6ff3f039091731e48d05f42b2ebfe68637fa7a7506e5" }, "downloads": -1, "filename": "propargs-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b551fcaa315d34da5ffd5e6054ed5b90", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26957, "upload_time": "2019-05-23T04:40:23", "url": "https://files.pythonhosted.org/packages/2d/28/92db2df6783b708be916330c51048831d989027825b337b05e1aa0fc2d48/propargs-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8cde1f844bf789a2314ca8cfecd1482", "sha256": "0086af57bb59ac389d8c261b543b87e32f90bd086debc9804e3f0c714d67db28" }, "downloads": -1, "filename": "propargs-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c8cde1f844bf789a2314ca8cfecd1482", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7154, "upload_time": "2019-05-23T04:40:25", "url": "https://files.pythonhosted.org/packages/7d/2a/774625b716dfa7499b7c0c51b80d1067132fa26a09c93c4f42716c20e3ea/propargs-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "f1a5d462c119be0551c60b952397b499", "sha256": "4529eca1498c37e4cb3e7372e850197e720ad8e34592b19b8870b2ca1d004c54" }, "downloads": -1, "filename": "propargs-0.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "f1a5d462c119be0551c60b952397b499", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28045, "upload_time": "2019-07-30T19:45:52", "url": "https://files.pythonhosted.org/packages/11/02/e74e17c32dc220fe0d3e3f48c82eb422ceeba28d849efa6916326e18ac22/propargs-0.0.10-py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "3a627ae0865f68b75cf3a26f7b5393c9", "sha256": "0e5378a642a86775711cb01bb3da90297e1576ce5a52e6c30bc8d99a2d8ba526" }, "downloads": -1, "filename": "propargs-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3a627ae0865f68b75cf3a26f7b5393c9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26896, "upload_time": "2019-05-27T01:00:46", "url": "https://files.pythonhosted.org/packages/32/85/6bb7513c026c3b1f4b691a766204e427846f4cd5a05b8ac22b112772a9a2/propargs-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "696e68a281722874a9cd27ff10443ff9", "sha256": "79086a2466436665b901206da5071d9a1cffacea778a328d0d5b4369276b7a2d" }, "downloads": -1, "filename": "propargs-0.0.2.tar.gz", "has_sig": false, "md5_digest": "696e68a281722874a9cd27ff10443ff9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7045, "upload_time": "2019-05-27T01:00:48", "url": "https://files.pythonhosted.org/packages/57/f1/5fe483f82195ea5cd9e7f9efe128c9bb81b136083ccf0b13d3a8fce64c84/propargs-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "c695eed08698248957a06035e9dcda3b", "sha256": "7118b49c3618efd7eb4d5a3ece39819cb79875e82092f1d51ba18db26dc7f74d" }, "downloads": -1, "filename": "propargs-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "c695eed08698248957a06035e9dcda3b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26896, "upload_time": "2019-05-27T03:59:02", "url": "https://files.pythonhosted.org/packages/2f/f6/9e5101b0a4680353aa6f2409eb1f58c0c9ebf7332916d2a01adb318bb17e/propargs-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "84333afe43820d1cd44cdfcdd375e6ca", "sha256": "f22eca0fc362174d1bd99bc8e97aaffc3e7b70018118c4c1b15e7a7c4fa6def9" }, "downloads": -1, "filename": "propargs-0.0.3.tar.gz", "has_sig": false, "md5_digest": "84333afe43820d1cd44cdfcdd375e6ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7043, "upload_time": "2019-05-27T03:59:04", "url": "https://files.pythonhosted.org/packages/72/d9/e2d9a4ff51572d0ee649b597df6cbbb4be91919cc8579b757d2badb298bf/propargs-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "ca0cb6487a1fefd766fbb8192da6f3b4", "sha256": "c9712e5b1f0be6cc42ac1b360b4914fe67ed3d93922441853ec12fcee74ab127" }, "downloads": -1, "filename": "propargs-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "ca0cb6487a1fefd766fbb8192da6f3b4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27086, "upload_time": "2019-05-30T05:15:10", "url": "https://files.pythonhosted.org/packages/86/8c/970617a2e0369d60ebe9385a148299c856ca1a041f6b810a2b0698ab4412/propargs-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6af1b6a325055272f70321c0a567f955", "sha256": "8253b2273cfcf0c41d3dee8f87a309db42e05fb79e23a7e3d556d5688813a77a" }, "downloads": -1, "filename": "propargs-0.0.4.tar.gz", "has_sig": false, "md5_digest": "6af1b6a325055272f70321c0a567f955", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7259, "upload_time": "2019-05-30T05:15:12", "url": "https://files.pythonhosted.org/packages/8f/c2/a940559e1b34c7d8e74a5a288456a271e72a02c63441e3e6e60e6e705b7e/propargs-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "0f95605d0500bd419283c03886a288b4", "sha256": "fa0db6bb9cc1b55d1bb8e491c1e157374142bb2bf4d725ac32501904be3da2b6" }, "downloads": -1, "filename": "propargs-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "0f95605d0500bd419283c03886a288b4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27103, "upload_time": "2019-06-06T04:56:08", "url": "https://files.pythonhosted.org/packages/7c/16/8beba2a9a09e43a473952503a9bc18ca7f4d2122f1e003652d65851da7b1/propargs-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4fdb26c7d51c018723a1f700df06d581", "sha256": "23c7a2a7d066afe3e7967e9ef3f6487678f94934311784861bd178eccbe63254" }, "downloads": -1, "filename": "propargs-0.0.5.tar.gz", "has_sig": false, "md5_digest": "4fdb26c7d51c018723a1f700df06d581", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7271, "upload_time": "2019-06-06T04:56:11", "url": "https://files.pythonhosted.org/packages/14/6d/f2c588bdd258e60f9edd6faec08e755a20ab418e252a0da1ccbe60297490/propargs-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "d90c50b398ccaa72d2756a73ea1b03e8", "sha256": "0e0a6bc6357c843c225a113d494c9a50dc2069db358a37492239d75f4f05d101" }, "downloads": -1, "filename": "propargs-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "d90c50b398ccaa72d2756a73ea1b03e8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27836, "upload_time": "2019-07-06T18:49:34", "url": "https://files.pythonhosted.org/packages/a2/6e/b461eeaa23949affe3da9da9b420977b3629c994d4e0e087461d6d78c3dd/propargs-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1dedeea91636629f43509a53a9c45289", "sha256": "3baf6c0ca90aca95f9e21e77c6187343a2abe06666b60e09c3a1b89a7cf75588" }, "downloads": -1, "filename": "propargs-0.0.6.tar.gz", "has_sig": false, "md5_digest": "1dedeea91636629f43509a53a9c45289", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7549, "upload_time": "2019-07-06T18:49:37", "url": "https://files.pythonhosted.org/packages/95/79/3769d2906097892d8f700c123bc76fc2f4c54dd125fab08201117790bede/propargs-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "2d0e14810238936296367bbf222ef47f", "sha256": "ff7d7776af14f4dad21b4409dbacdb6902fd2ad1237d89a5fb428d22e648f018" }, "downloads": -1, "filename": "propargs-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "2d0e14810238936296367bbf222ef47f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27838, "upload_time": "2019-07-06T19:19:03", "url": "https://files.pythonhosted.org/packages/a6/1c/d43408c73a9b76d70be37abd8178a2450a7c7dc1dffe959f70f19fc0cf42/propargs-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6d77aee40a668b5207497d940afb3586", "sha256": "82b010005537cca0ed3ed73919734bbaa308af685db5a2f2637ea34a1a137454" }, "downloads": -1, "filename": "propargs-0.0.7.tar.gz", "has_sig": false, "md5_digest": "6d77aee40a668b5207497d940afb3586", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7549, "upload_time": "2019-07-06T19:19:04", "url": "https://files.pythonhosted.org/packages/76/66/d0edce37468d18076e26c9f6536d106c1240a602e7e8759c874af3f359c5/propargs-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "af48f3869e854b548696856251e0b958", "sha256": "6464427b23bd599f2611b15b9dcf1baba44648b3a3550dab7caad1c6d2ab9c8b" }, "downloads": -1, "filename": "propargs-0.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "af48f3869e854b548696856251e0b958", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27847, "upload_time": "2019-07-07T03:00:10", "url": "https://files.pythonhosted.org/packages/c1/1b/67229cd5b6bb69934aefc6039dc08277b31964038d5c6eb4a698fe84fb01/propargs-0.0.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "55130e1b19bba030961948a5863dd82d", "sha256": "a717ffe9c7ea49955b333797cd6c5756058dcb04a04a8992506cb645b8f6dce0" }, "downloads": -1, "filename": "propargs-0.0.8.tar.gz", "has_sig": false, "md5_digest": "55130e1b19bba030961948a5863dd82d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7539, "upload_time": "2019-07-07T03:00:11", "url": "https://files.pythonhosted.org/packages/41/34/0315b904acfa0283649a87785688657d42cd837378d00c3e2e6cc477d8e0/propargs-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "47579ba95cecd2fc8efb39ea20d5b77c", "sha256": "9c469f8b80b3d24d0a745270a8d3fbd2e77cf35d8055236548ca5954cec62006" }, "downloads": -1, "filename": "propargs-0.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "47579ba95cecd2fc8efb39ea20d5b77c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28033, "upload_time": "2019-07-14T21:31:21", "url": "https://files.pythonhosted.org/packages/6f/e7/4250e7837a2362831e422ac9c49b5a31da4735e55fe4ee7287df5b6e410e/propargs-0.0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2e0dead8151cdfc25f5af5ff5724ff94", "sha256": "a98bd8ad89b1044045d5a07937a886f49ac9a00df61bb0cf55f673e3dc9d70d4" }, "downloads": -1, "filename": "propargs-0.0.9.tar.gz", "has_sig": false, "md5_digest": "2e0dead8151cdfc25f5af5ff5724ff94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7730, "upload_time": "2019-07-14T21:31:23", "url": "https://files.pythonhosted.org/packages/46/de/21b7b694e0d64ae8d9682c9627512818368435330799907fccbb53cb72f2/propargs-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f1a5d462c119be0551c60b952397b499", "sha256": "4529eca1498c37e4cb3e7372e850197e720ad8e34592b19b8870b2ca1d004c54" }, "downloads": -1, "filename": "propargs-0.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "f1a5d462c119be0551c60b952397b499", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 28045, "upload_time": "2019-07-30T19:45:52", "url": "https://files.pythonhosted.org/packages/11/02/e74e17c32dc220fe0d3e3f48c82eb422ceeba28d849efa6916326e18ac22/propargs-0.0.10-py3-none-any.whl" } ] }