{ "info": { "author": "Adam Hill", "author_email": "adamghill@yahoo.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Why?\nIt is available everywhere if you install via `pip`, has cute aliases defined in a JSON file (`.dj-config.json`) per project, will run as many commands as you want, and defaults to Django management commands if an alias cannot be found.\n\nCommands can be run sequentially by `dj` (e.g. `dj makemigrations migrate`). However, calling a long-running process (e.g. `dj runserver`) will prevent any other commands from being run. For example, `dj runserver migrate` will never run the `migrate` command because `runserver` will block the process.\n\n# Configuration file\n\n## Example .dj-config.toml\n```toml\ndisable_django_management_command = false\npython_interpreter = \"python\"\nenvironment_file_path = \".env\"\n\n[[commands]]\nname = \"m\"\nhelp = \"Does the migration dance\"\nexecute = \"./manage.py makemigrations && ./manage.py migrate\"\nrequires_virtualenv = true\n\n[[commands]]\nname = \"r\"\nhelp = \"Runs all the servers\"\nexecute = \"./manage.py runserver\"\nrequires_virtualenv = true\nlong_running = true\n\n[[commands]]\nname = \"ls\"\nhelp = \"Lists all the files, of course\"\nexecute = \"ls\"\n\n[[commands]]\nname = \"up\"\nhelp = \"Up all the things\"\nexecute = \"pip3 install -r requirements/development.txt && ./manage.py migrate && ./manage.py runserver\"\nrequires_virtualenv = true\nlong_running = true\n\n[[commands]]\nname = \"restore_database\"\nhelp = \"Restores a Postgres database from live to local\"\nexecute = \"PGPASSWORD=$PGPASSWORD pg_dump $DATABASE_NAME --host=$DATABASE_HOST --port=$DATABASE_PORT --username=$DATABASE_USERNAME --format=tar | pg_restore --clean --dbname=$DATABASE_NAME --no-owner --host=localhost --port=5432\"\n```\n\n## Config file location\nIf the `--config` argument is used to specify a particular file location, that is the only place `dj` looks for a configuration file.\n\nOtherwise, `dj` will search for appropriate config files and \"merge\" them together. This allows you to have a base config file in `~/.dj-config.toml`, but override it on a per-folder basis. `dj` prioritizes `.toml` config files over `.json`. So, it will look for `~/.dj-config.toml` first and, if it's missing, then look for `~/.dj-config.json`. Then, it will follow the same pattern for the current directory. The current directory's config file will take precedence if there is an overlap in configuration settings.\n\n## Using environment variables in commands\n`dj` will look for a `.env` file to load environment variables using the wonderful [python-dotenv](https://github.com/theskumar/python-dotenv) library. You can specify environment variables in an execute command just like you would from the shell (i.e. `$VARIABLE_NAME`).\n\n# Basic arguments and options\n- `dj --help` to see all of the options\n- `dj --list` to see all of the available custom commands\n- `dj {command_name}` to run a custom command or Django management command (e.g. `dj migrate`)\n- `dj {command_name} {command_name} {command_name}` to run multiple commands (e.g. `dj makemigrations migrate`)\n- `dj {command_name} --dry_run` to show what commands would run without actually executing them\n\n# How to work on the source\n1. Clone the repo\n1. Run the source locally: `poetry run python dj`\n1. Test the source: `poetry run pytest`\n1. Build and install locally: `poetry build && pip3 install --user --force-reinstall .`\n1. Test with `~/.local/bin/dj migrate`\n1. Publish the source to pypi: `poetry publish --build --username USERNAME --password PASSWORD`\n\n# Acknowledgements\n- [poetry](https://poetry.eustace.io/): please, please, please continue to help wrangle the complexity of 1) creating Python projects, and 2) installing dependencies; seriously, it's baffling out there without you\n- [click](https://click.palletsprojects.com/): ridiculously full-featured library to help implement CLI programs in Python; it has all the bells and most of the whistles\n- [attrs](https://www.attrs.org/): would you like easy classes in Python? yes, please\n- [delegator.py](https://github.com/amitt001/delegator.py): `subprocess` is a pain, but `delegator` hides all the ugly cruft behind a nice API\n- [python-dotenv](https://github.com/theskumar/python-dotenv): 12-factor all the things with .env files\n- [toml](https://github.com/uiri/toml): the fewer braces in my life the better\n\n# Prior art\nThis isn't a new idea and there are a few other implementations out there that do similar things. But, uh, I like mine. \ud83d\ude00\n- [dj-cmd](https://pypi.org/project/dj-cmd/)\n- [Django-dj](https://github.com/h4l/Django-dj)\n- [dj-cli](https://pypi.org/project/dj-cli/)\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/adamghill/dj", "keywords": "", "license": "", "maintainer": "Adam Hill", "maintainer_email": "adamghill@yahoo.com", "name": "dj-command", "package_url": "https://pypi.org/project/dj-command/", "platform": "", "project_url": "https://pypi.org/project/dj-command/", "project_urls": { "Homepage": "https://github.com/adamghill/dj", "Repository": "https://github.com/adamghill/dj" }, "release_url": "https://pypi.org/project/dj-command/0.5.2/", "requires_dist": [ "click (>=7.0,<8.0)", "delegator.py (>=0.1.1,<0.2.0)", "attrs (>=19.1,<20.0)", "colorama (>=0.4.1,<0.5.0)", "python-dotenv (>=0.10.3,<0.11.0)", "toml (>=0.10.0,<0.11.0)" ], "requires_python": ">=3.6,<4.0", "summary": "Run commands with `dj {command_name}`. Uses aliases defined in a simple config file or defaults to Django management commands.", "version": "0.5.2" }, "last_serial": 5725742, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8653396069b028bc1a0c5f20cbcad003", "sha256": "ddfef44737a4adfcc246a114bef6bb46f496f7672600cc9ba4c807366149575f" }, "downloads": -1, "filename": "dj_command-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8653396069b028bc1a0c5f20cbcad003", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 3931, "upload_time": "2019-08-18T00:16:14", "url": "https://files.pythonhosted.org/packages/96/35/d9c9a5c2ecc9cd28b70d09cb2a78cd2061b1e40ad7bf11075430f41cd7b0/dj_command-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "865a3180de207f0f6f695ac83b3cbd24", "sha256": "b685ff3e954be6b689b869325574cbd57e397c80182b059f00dc2f5695c1f61d" }, "downloads": -1, "filename": "dj-command-0.1.0.tar.gz", "has_sig": false, "md5_digest": "865a3180de207f0f6f695ac83b3cbd24", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 3196, "upload_time": "2019-08-18T00:16:12", "url": "https://files.pythonhosted.org/packages/37/72/716951f7920d576e5dec4cae5385bb33b5e7b01c169e604bd6e398308177/dj-command-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "46b70ece18aefe6c96a9ba126dfe2f3b", "sha256": "bdcb923040c4d0cf47711fc8dbd2af5f082a6f1659287dc5b9474bed23de97f6" }, "downloads": -1, "filename": "dj_command-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "46b70ece18aefe6c96a9ba126dfe2f3b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 5749, "upload_time": "2019-08-18T04:29:10", "url": "https://files.pythonhosted.org/packages/00/51/c4cfe12dbd3367fa24d1d6e330358a97de8e281dc775237d8887a70d15c0/dj_command-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b9b6b220460dc9d7a030bd84cfbd24c", "sha256": "7abf863d11a6c906fd1be2754a7ac6ed3849539b2e82539f8afb58cd8172bbf5" }, "downloads": -1, "filename": "dj-command-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6b9b6b220460dc9d7a030bd84cfbd24c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 5167, "upload_time": "2019-08-18T04:29:09", "url": "https://files.pythonhosted.org/packages/67/8e/f504cacbaee70f0bb2b76d1a7f3430354ee97beebaa9221bcedb5660e5f3/dj-command-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "1763dfb04dc0a3b205b49084af5ca6b2", "sha256": "52a24d4fd198d8ea73852b98d28a62d9f2aa92e59db2b7c4446c63d511b976f0" }, "downloads": -1, "filename": "dj_command-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1763dfb04dc0a3b205b49084af5ca6b2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 6733, "upload_time": "2019-08-18T21:09:47", "url": "https://files.pythonhosted.org/packages/96/87/d612004939ace49e7b61fcf861e82c5261198a4c84e0fe6bf9064565cc79/dj_command-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "273e0f53a8aefea87671309db247b4e0", "sha256": "aafc7fba3128cf24748306218f90a83733d4deb5d72933e14b902d851c18b740" }, "downloads": -1, "filename": "dj-command-0.3.0.tar.gz", "has_sig": false, "md5_digest": "273e0f53a8aefea87671309db247b4e0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 5899, "upload_time": "2019-08-18T21:09:46", "url": "https://files.pythonhosted.org/packages/69/15/294c2d9ebbadfbccbe6984c08e997d04c2c13191e4d55a173887b04fea16/dj-command-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "3c37f786afbf9c4e9f1ce6282bd27b1e", "sha256": "ec94c2eb85cbfff623b920477de4762a82d2ed99fda4f80c7dcda45ce2d6f178" }, "downloads": -1, "filename": "dj_command-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3c37f786afbf9c4e9f1ce6282bd27b1e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 7510, "upload_time": "2019-08-21T01:48:07", "url": "https://files.pythonhosted.org/packages/24/e4/b5ac59f03254d8abd3f1cd893ba7eecce58670e4330c0f72112fa31a17c5/dj_command-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3e259f5f19b2e672f6d3a76c758682c", "sha256": "34a2dbedd01c89f4fa8b5353341a44ca5d7aa1885425c0c8e51d1ae22c7b94dd" }, "downloads": -1, "filename": "dj-command-0.4.0.tar.gz", "has_sig": false, "md5_digest": "a3e259f5f19b2e672f6d3a76c758682c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 6453, "upload_time": "2019-08-21T01:48:05", "url": "https://files.pythonhosted.org/packages/f2/43/4e0071907eb94d2b1f168fcf378c369bde2c17e9c3030149f73e83a61559/dj-command-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "c81717d9872574b2d15842a56fca8f4b", "sha256": "744aa505a3ad39a00ef219d9990e95bd98da5e1b1caf77aab854f0279f2c9b19" }, "downloads": -1, "filename": "dj_command-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c81717d9872574b2d15842a56fca8f4b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 9571, "upload_time": "2019-08-24T12:13:12", "url": "https://files.pythonhosted.org/packages/4a/27/b56e1834733df9a921a56eb9d9a3cac70704a5090feceb322933fa8d9ee9/dj_command-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c6dffc351566a8bf0c64499110d57eb2", "sha256": "0f4bb8f0bd6977cef883fc0399def2059967db34ff6c0aab7d6eb4d0b620fcef" }, "downloads": -1, "filename": "dj-command-0.5.0.tar.gz", "has_sig": false, "md5_digest": "c6dffc351566a8bf0c64499110d57eb2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8271, "upload_time": "2019-08-24T12:13:10", "url": "https://files.pythonhosted.org/packages/5a/48/6ed474d675aa4ccde8e76876242cf3e88ca12ea54cc611d715904d487fb9/dj-command-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "801e7da1b3d335b7dd6a06e5258271a0", "sha256": "f6c3258b89070d6b76956cedeaed2ef03dab813a307fd90a1e52208fc0af9a48" }, "downloads": -1, "filename": "dj_command-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "801e7da1b3d335b7dd6a06e5258271a0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 9529, "upload_time": "2019-08-24T12:28:21", "url": "https://files.pythonhosted.org/packages/c1/0d/6837835f2ffa0385c23844bdf2ea3ce7942b6a2c7383609c9653935fef23/dj_command-0.5.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "88b79e6f2d185b6cfecccf3e039c4f16", "sha256": "70bab07719f7f819c32cd03f009c0f2101536e1dcf842c7c69e002aa068bfceb" }, "downloads": -1, "filename": "dj-command-0.5.1.tar.gz", "has_sig": false, "md5_digest": "88b79e6f2d185b6cfecccf3e039c4f16", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8280, "upload_time": "2019-08-24T12:28:19", "url": "https://files.pythonhosted.org/packages/2e/2f/984c8edbf2aad70e8b1a88d2488a6f9e5f7c14eb1c6448a17d2de41103e7/dj-command-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "23a305282ba26e54212ba7769fccd51d", "sha256": "057422877ba79269e815c0fdc79d1050c682d7562a6a41461546e01886300a8c" }, "downloads": -1, "filename": "dj_command-0.5.2-py3-none-any.whl", "has_sig": false, "md5_digest": "23a305282ba26e54212ba7769fccd51d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 9531, "upload_time": "2019-08-25T01:22:50", "url": "https://files.pythonhosted.org/packages/79/5d/20ce851269eeeaf7ec9e43c3d4a3838f414c7b23e2a89695d6d5abe6bcde/dj_command-0.5.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d46bf93c7efdca35a5438ba2bbe61223", "sha256": "a0decfef0eda1e33225ea741d9e393eb25d6a91bf15f4e163fc4b78083b6101f" }, "downloads": -1, "filename": "dj-command-0.5.2.tar.gz", "has_sig": false, "md5_digest": "d46bf93c7efdca35a5438ba2bbe61223", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8286, "upload_time": "2019-08-25T01:22:48", "url": "https://files.pythonhosted.org/packages/67/70/e1075c99372bbbcd4c7b5caba89738b18e600009a749bd34798f6070803d/dj-command-0.5.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "23a305282ba26e54212ba7769fccd51d", "sha256": "057422877ba79269e815c0fdc79d1050c682d7562a6a41461546e01886300a8c" }, "downloads": -1, "filename": "dj_command-0.5.2-py3-none-any.whl", "has_sig": false, "md5_digest": "23a305282ba26e54212ba7769fccd51d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 9531, "upload_time": "2019-08-25T01:22:50", "url": "https://files.pythonhosted.org/packages/79/5d/20ce851269eeeaf7ec9e43c3d4a3838f414c7b23e2a89695d6d5abe6bcde/dj_command-0.5.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d46bf93c7efdca35a5438ba2bbe61223", "sha256": "a0decfef0eda1e33225ea741d9e393eb25d6a91bf15f4e163fc4b78083b6101f" }, "downloads": -1, "filename": "dj-command-0.5.2.tar.gz", "has_sig": false, "md5_digest": "d46bf93c7efdca35a5438ba2bbe61223", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 8286, "upload_time": "2019-08-25T01:22:48", "url": "https://files.pythonhosted.org/packages/67/70/e1075c99372bbbcd4c7b5caba89738b18e600009a749bd34798f6070803d/dj-command-0.5.2.tar.gz" } ] }