{"id":20163029,"url":"https://github.com/purplelemons-dev/pool","last_synced_at":"2025-03-03T03:11:23.915Z","repository":{"id":188649009,"uuid":"616307854","full_name":"purplelemons-dev/pool","owner":"purplelemons-dev","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-22T14:35:23.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T02:37:43.638Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/purplelemons-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-20T06:00:29.000Z","updated_at":"2023-03-22T14:35:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb80f1d7-1cc3-4689-ac64-0cd4e2f5b3b5","html_url":"https://github.com/purplelemons-dev/pool","commit_stats":null,"previous_names":["purplelemons-dev/pool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purplelemons-dev%2Fpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purplelemons-dev%2Fpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purplelemons-dev%2Fpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purplelemons-dev%2Fpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purplelemons-dev","download_url":"https://codeload.github.com/purplelemons-dev/pool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241600512,"owners_count":19988715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T00:27:54.240Z","updated_at":"2025-03-03T03:11:23.886Z","avatar_url":"https://github.com/purplelemons-dev.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pool\npool is a database manager that hosts a database for scripts to either temporarily store or cache data. It is a simple database manager that is easy to use and is very fast. It is also very lightweight and is easy to install.\n\n## Installation\nthis is in beta currently, so you can only run it from source.\n\n## Usage\npool should run in the background and scripts can connect to it using the Pool module.\n### Running pool\nexecute inside the pool directory, the one with the `__main__.py` file in it.\n```bash\npython -m pool\n```\n### Using Pool\nRead/write to the database using the Pool module:\n```py\nfrom Pool import Pool\n# Pool objects can be created with a name. The pool manager will check if the name exists and if it does, it will connect to it. If it doesn't, it will create a new pool with that name.\npool = Pool(name=\"example\")\n# We can create an empty list. Empty dicts and tuples can also be created.\npool[\"table1\"] = []\n# Empty sets cannot be created as seen above, so the .set(\"path\",\"to\",\"table\") method can be used to create an empty set. This method can also be used to create lists, dicts, and tuples.\npool.set(\"table2\")\nwhile True:\n    user_in = input(\"\u003e\u003e\u003e \")\n    if user_in == \"exit\":\n        break\n    elif len(user_in) \u003e 1:\n        pool[\"table1\"].append(user_in[0])\n        pool[\"table2\"].add(user_in[1:])\n    else:\n        pool[\"table1\"].append(user_in)\n        pool[\"table2\"].add(user_in)\n```\nListen to pool:\n```py\nfrom Pool import Pool\n# If you plan on listening to pool, make a subclass with a modified on_change method.\nclass Pool(Pool):\n    def on_change(self, path, before, after):\n        print(f\"Path: {path}\\nBefore: {before}\\nAfter: {after}\\n\")\nMyPool(name=\"example\").listen()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurplelemons-dev%2Fpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurplelemons-dev%2Fpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurplelemons-dev%2Fpool/lists"}