{ "info": { "author": "Nicolas Forstner", "author_email": "nicolasforstner@yahoo.de", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# SpongeBot\n*Monitor a directory for new files*\n\n When instantiating a new SpongeBot, you need to provide it with a path to a directory and a callback function. The callback function is called each time a new file is added to the directory, passsing the name of the new file as the first parameter.\n SpongeBot will run as a thread, making it possible to run multiple SpongeBots simultaneously.\n\n A typical usecase for SpongeBot would look like this:\n\n\tfrom spongebot import SpongeBot\n\n\tdef my_callback_function(file_name):\n\t\tprint('A new file was added to the directory!')\n\n\t sb = SpongeBot('./my_directory', my_callback_function)\n\t sb.start()\n\nThe following parameters can be passed to SpongeBot:\n\n- **path**: The path to the directory that needs to be monitored\n- **callback**: A callable that takes a filepath as the first parameter\n- **interval**: The interval length in seconds that determines how frequently SpongeBot checks for new files. Defaults to 2 seconds.\n- **static_args**: A list that will be unpacked and passed to the callback function\n- **static_kwargs**: A dictionary that will be unpacked and passed to the callback function\n- **snapshot_file**: A file that can be used by SpongeBot to keep track of the files tht are already in the directory. This is used to make SpongeBot more robust in the case of system crashes. Defaults to \"./.spongeBot_snapshot.txt\".\n\nAnother example that uses more features of SpongeBot:\n\n\tfrom spongebot import SpongeBot\n\timport pandas as pd\n\n\n\tdef my_callback_function(file_name, data_pool, verbose=False):\n\t\tif verbose:\n\t\t\tprint('Processing file ' + file_name)\n\t\tdf = pd.from_csv(file_name)\n\t\twith open(data_pool, 'a') as f:\n\t\t\tdf.to_csv(f, index=False, header=False)\n\n\tdata_pool = pd.from_csv('')\n\n\tsb = SpongeBot(\n\t\t'./file_pool/',\n\t\tmy_callback_function,\n\t\tinterval=30.0,\n\t\tstatic_args=['./big_data_pool.csv'],\n\t\tstatic_kwargs={'verbose': True},\n\t\tsnapshot_file='./snapshot_spongeBot.txt')\n\tsb.start()\n\tprint('SpongeBot is now running!')\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/SirSolim/spongebot", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "spongebot", "package_url": "https://pypi.org/project/spongebot/", "platform": "", "project_url": "https://pypi.org/project/spongebot/", "project_urls": { "Homepage": "https://github.com/SirSolim/spongebot" }, "release_url": "https://pypi.org/project/spongebot/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Monitor a directory for new files", "version": "0.1.0" }, "last_serial": 5856611, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "56c4b43db91b52c443d919464680dc2b", "sha256": "44970f2817dae84472deadb75538ae919f42cc1ac4993e6a8c0d8ec2bddbf3fa" }, "downloads": -1, "filename": "spongebot-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "56c4b43db91b52c443d919464680dc2b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4900, "upload_time": "2019-09-19T14:03:08", "url": "https://files.pythonhosted.org/packages/67/56/38bd9c7c9f90bdbb5124777b231d5ea7308e4270e0d5b330aa653e274e15/spongebot-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43a444a716f1dbcc0f424357628c5980", "sha256": "a04d1a5d7e5c901393fa817d1683bfeb43fb401866bc5f33925dbda4fbeb013c" }, "downloads": -1, "filename": "spongebot-0.1.0.tar.gz", "has_sig": false, "md5_digest": "43a444a716f1dbcc0f424357628c5980", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3758, "upload_time": "2019-09-19T14:03:11", "url": "https://files.pythonhosted.org/packages/97/6a/d73d5a5e02b872b9099b06b9f7f4a2e63227aafe387590f994a56c9e9c70/spongebot-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56c4b43db91b52c443d919464680dc2b", "sha256": "44970f2817dae84472deadb75538ae919f42cc1ac4993e6a8c0d8ec2bddbf3fa" }, "downloads": -1, "filename": "spongebot-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "56c4b43db91b52c443d919464680dc2b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4900, "upload_time": "2019-09-19T14:03:08", "url": "https://files.pythonhosted.org/packages/67/56/38bd9c7c9f90bdbb5124777b231d5ea7308e4270e0d5b330aa653e274e15/spongebot-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43a444a716f1dbcc0f424357628c5980", "sha256": "a04d1a5d7e5c901393fa817d1683bfeb43fb401866bc5f33925dbda4fbeb013c" }, "downloads": -1, "filename": "spongebot-0.1.0.tar.gz", "has_sig": false, "md5_digest": "43a444a716f1dbcc0f424357628c5980", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3758, "upload_time": "2019-09-19T14:03:11", "url": "https://files.pythonhosted.org/packages/97/6a/d73d5a5e02b872b9099b06b9f7f4a2e63227aafe387590f994a56c9e9c70/spongebot-0.1.0.tar.gz" } ] }