{ "info": { "author": "Jean-Philippe Gravel", "author_email": "jpgravel@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# smugcli\nCommand line tool for SmugMug, useful for automatically synchronizing a local folder hierarchy with a SmugMug account.\n\nImplemented using the Smugmug V2 API.\n\nTested with Python 2.7, 3.4, 3.5, 3.6, 3.7 and 3.8.\n\n# Installation\n\n```\npip install smugcli\n```\n\n# Sample usage\n\nTo use this command line tool, you will need to request your own API key by visiting https://api.smugmug.com/api/developer/apply. Using your key and secret, loging to smugcli using the following command:\n```\n$ ./smugcli.py login --key= --secret=\n```\n\nThis is a one time operation. From this point on, smugcli will be able to access your SmugMug account. To logout, run the command: `$ ./smugcli.py logout`\n\nYou can list the content of your SmugMug account by doing:\n```\n$ ./smugcli.py ls\n Photography\n Portfolio\n Other\n\n$ ./smugcli.py ls Photography\n 2014\n 2015\n 2016\n\n\n$ ./smugcli.py ls Photography/2015\n Photoshoot with Dave\n```\nNote that smugcli can also be used to access other public SmugMug account by using the `--user` argument:\n```\n$ ./smugcli.py ls -u \n```\n\nFolders can be created by using the `mkdir` command:\n```\n$ ./smugcli.py mkdir Photography/2017\n```\n\nSimilarily, albums can be created by doing:\n```\n$ ./smugcli.py mkalbum 'Photography/2017/My new album'\n```\n\nTo upload photos to an album, run:\n```\n$ ./smugcli.py upload local/folder/*.jpg 'Photography/2017/My new album'\n```\n\nFinally, the nicest feature of all, you can synchronize a whole local folder hierarchy to your SmugMug account using the `sync` command:\n```\n$ ./smugcli.py sync local/folder remote/folder\nCreating Folder \"remote/folder/2015\".\nCreating Album \"remote/folder/2015/2015-08-03, Mary's Wedding\".\nUploading \"local/folder/2015/2015-08-03, Mary's Wedding/DSC_0001.JPG\"\nUploading \"local/folder/2015/2015-08-03, Mary's Wedding/DSC_0002.JPG\"\nUploading \"local/folder/2015/2015-08-03, Mary's Wedding/DSC_0003.JPG\"\n...\nCreating Album \"remote/folder/2015/2015-09-10, Andy's Photoshoot\"\nUploading \"local/folder/2015/2015-09-10, Andy's Photoshoot/DSC_0043.JPG\"\nUploading \"local/folder/2015/2015-09-10, Andy's Photoshoot/DSC_0052.JPG\"\n...\n```\n\nThe sync command can be re-executed to update the remote Albums in the event that the local files might have been updated. Only the files that changed will be re-uploaded.\n\nMultiple sources can be synced in the same operation, the last argument being the destination folder and the others being the sources:\n```\n$ ./smugcli.py sync 2016 2017 2018 remote/folder\nSyncing:\n 2016\n 2017\n 2018\nto SmugMug folder \"remote/folder\"',\n...\n\n$ ./smugcli.py sync 201* remote/folder\n...\n```\n\nSource files are synced to the destination SmugMug album and source folders are recursively synced to the destination SmugMug folder. For source folders with a trailing path delimitor ('/' or '\\\\' depending on OS), only the content of the folder is synced, skipping the folder itself (equivalent of doing `folder/*`). This means that `smugcli.py sync src/album dst` is equivalent to `smugcli.py sync src/album/ dst/album`. If no sources or destinations are specified, smugcli defaults to syncing the current folder to the SmugMug user's root.\n\nThe sync command uses multiple threads to speed-up the file scanning and upload.\nYou may want to tune the number of threads used by SmugCLI depending on your\nmachine's performance. For instance:\n```\n$ ./smugcli.py sync local/folder remote/folder --folder_threads=4 --file_threads=8 --upload_threads=2\n```\n\n`folder_threads` control the number of album folders that are processed in\nparallel. `file_threads` specifies the number fo files that are read from disk\nand compared with the server side version in parallel. `upload_threads` controls\nthe number of parallel upload operations allowed when sending content to\nSmugMug. Keep in mind that too many or too few threads can be harmful to\nperformance. Also keep in mind that increasing file_threads or upload_threads\nmeans that more files will be loaded in memory at the same time. If you have\nmany large video files, loading too many in parallel could hog your system's\nresources.\n\nWhen you are happy with the performance using certain thread counts, you may\nsave these preferences so that they'd be used as defaults next time:\n```\n$ ./smugcli.py sync --set_defaults --folder_threads=4 --file_threads=8 --upload_threads=2\n```\n\nTo exclude paths from the sync operation, run the command:\n```\n$ ./smugcli.py ignore local/folder/export-tmp\n```\n\nTo undo this operation, you can run:\n```\n$ ./smugcli.py include local/folder/export-tmp\n```\n\n# Running the tests\nPLEASE READ, RUN UNIT TESTS AT YOUR OWN RISKS: smugcli's unit-tests use the logged-in user account to do run actual commands on SmugMug. All operations *should* be performed in a `__smugcli_unit_tests__` subfolder in the SmugMug account's root. This folder *should* be deleted automatically when/if the test completes. If in doubt, do `smugcli.py logout && smugcli.py login` and use a test account.\n\nSmugCLI uses `tox` to run tests using all supported Python interpreter versions. Run all tests with all Python versions by running:\n```\n$ tox\n```\n\nTo run with only one specific Python version, for instance Python 3.7, do:\n```\n$ tox -e py37\n```\n\nIndividual tests can be ran by doing:\n```\n$ tox -- tests/module[.class_name[.test_name]]\n```\nfor instance:\n```\n$ tox -e p37 -- tests/end_to_end_test.py # Runs all tests in tests/end_to_end_test.py.\n$ tox -e p37 -- tests/end_to_end_test.py::EndToEndTest # Runs all tests in class EndToEndTest.\n$ tox -e p37 -- tests/end_to_end_test.py::EndToEndTest::test_sync # Runs a single test.\n```\n\nSince the unit tests do actual operations on SmugMug, they are fairly slow. To speed things up, all HTTP requests are cached on disk and replayed on subsequent runs. The first test run will take a while, but the next ones should run much faster. When changing the code however, the cached HTTP request may no longer match the new implementation. Reset the cache for the next test to run by setting the RESET_CACHE environment variable to True. To reset the cache for the next run only, do:\n```\n$ RESET_CACHE=True tox -e py37\n```\nWindows users can do the equivalent by doing:\n```\nC:\\smugcli> cmd /C \"set RESET_CACHE=True && tox -e py37\"\n```\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/graveljp/smugcli", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "smugcli", "package_url": "https://pypi.org/project/smugcli/", "platform": "", "project_url": "https://pypi.org/project/smugcli/", "project_urls": { "Homepage": "https://github.com/graveljp/smugcli" }, "release_url": "https://pypi.org/project/smugcli/1.0.1/", "requires_dist": [ "bottle (>=0.12.13)", "rauth (>=0.7.3)", "requests (>=2.13.0)", "requests-oauthlib (>=0.7.0)", "colorama (>=0.3.9) ; platform_system == \"Windows\"", "hachoir-core (>=1.3.3) ; python_version < \"3.0\"", "hachoir-metadata (>=1.3.3) ; python_version < \"3.0\"", "hachoir-parser (>=1.3.4) ; python_version < \"3.0\"", "hachoir (>=3.0a4) ; python_version >= \"3.0\"" ], "requires_python": "", "summary": "Command line tool for SmugMug", "version": "1.0.1" }, "last_serial": 5260619, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "bfe4286d0e1b6a87d366316cdc2cfb72", "sha256": "eb3e1e0ad212bdcadbe0dc68777a4386588e53a80c99f2f22762a23daafbf6f7" }, "downloads": -1, "filename": "smugcli-0.9.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bfe4286d0e1b6a87d366316cdc2cfb72", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24415, "upload_time": "2019-05-13T03:51:39", "url": "https://files.pythonhosted.org/packages/fa/28/7c4f299fa7b96eb6764ced500ad5d82a1d24f55ae4cbc6931a3094b87b54/smugcli-0.9.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6fbeeea89b2647c77d4d86ff5161bb2f", "sha256": "2ac189003485ff4b82a75409f1277bf51a39d3d8688cfaecfc5fce603f85b616" }, "downloads": -1, "filename": "smugcli-0.9.0.tar.gz", "has_sig": false, "md5_digest": "6fbeeea89b2647c77d4d86ff5161bb2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37750, "upload_time": "2019-05-13T03:51:43", "url": "https://files.pythonhosted.org/packages/d3/76/55d9a4460cf9e3a29e21e8b33c03fab4c2555168cca5eb220fcca0f53ff7/smugcli-0.9.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "9453af58d6917bb2e06924b902073a6f", "sha256": "c93fe24da3c1d37aaa8cbb1dfa8adbe257fdb31eb3cb80d952479a6f64f0026e" }, "downloads": -1, "filename": "smugcli-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9453af58d6917bb2e06924b902073a6f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24268, "upload_time": "2019-05-13T03:51:41", "url": "https://files.pythonhosted.org/packages/e1/9d/02fed2dd4fba706afeb4411bd3c154dca9efe54da42e6e88a96620b96025/smugcli-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2500551dfbc423817e4617d34a31b621", "sha256": "9194cd9a52df640b090b14ba18fc02cc8c5690d30aa66616712fa5e8c02492ab" }, "downloads": -1, "filename": "smugcli-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2500551dfbc423817e4617d34a31b621", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37451, "upload_time": "2019-05-13T03:51:44", "url": "https://files.pythonhosted.org/packages/68/ef/2248903c4ba9ddacd19f65e9cd5803543fb85f7fad2fd85e8b844a4ff121/smugcli-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "43d86596a7acb5d49d99abdf82fb59cd", "sha256": "a84f02afb8568f0415c215c36c31a37ce9b3a99c3115f41a4d39bc22f549c18c" }, "downloads": -1, "filename": "smugcli-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "43d86596a7acb5d49d99abdf82fb59cd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24412, "upload_time": "2019-05-13T04:21:47", "url": "https://files.pythonhosted.org/packages/37/97/99964fda7957146e4b1c21a6376472b5955e4bf158f898879fd4d0253247/smugcli-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7723b0827130a15159762f657bfd9a22", "sha256": "ac6c5dc3f9fdbdf96050ace9afe5882904a152363f18df8f817a0abb4c8effae" }, "downloads": -1, "filename": "smugcli-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7723b0827130a15159762f657bfd9a22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37599, "upload_time": "2019-05-13T04:21:48", "url": "https://files.pythonhosted.org/packages/2c/76/f2a04ba4a1c428514d366595f6239dc0694d501ed835bc6acee0011d1e2d/smugcli-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "43d86596a7acb5d49d99abdf82fb59cd", "sha256": "a84f02afb8568f0415c215c36c31a37ce9b3a99c3115f41a4d39bc22f549c18c" }, "downloads": -1, "filename": "smugcli-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "43d86596a7acb5d49d99abdf82fb59cd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24412, "upload_time": "2019-05-13T04:21:47", "url": "https://files.pythonhosted.org/packages/37/97/99964fda7957146e4b1c21a6376472b5955e4bf158f898879fd4d0253247/smugcli-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7723b0827130a15159762f657bfd9a22", "sha256": "ac6c5dc3f9fdbdf96050ace9afe5882904a152363f18df8f817a0abb4c8effae" }, "downloads": -1, "filename": "smugcli-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7723b0827130a15159762f657bfd9a22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37599, "upload_time": "2019-05-13T04:21:48", "url": "https://files.pythonhosted.org/packages/2c/76/f2a04ba4a1c428514d366595f6239dc0694d501ed835bc6acee0011d1e2d/smugcli-1.0.1.tar.gz" } ] }