{"id":18309855,"url":"https://github.com/centralfloridaattorney/dataspoon","last_synced_at":"2025-04-05T17:33:09.197Z","repository":{"id":64972289,"uuid":"579881155","full_name":"CentralFloridaAttorney/dataspoon","owner":"CentralFloridaAttorney","description":"dataspoon is a database that helps to prepare data for analysis","archived":false,"fork":false,"pushed_at":"2024-08-08T17:49:20.000Z","size":57327,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T08:34:53.741Z","etag":null,"topics":["database","dataspoon","encoder-decoder","javaspoon","mysql","onehot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CentralFloridaAttorney.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-19T07:03:33.000Z","updated_at":"2024-08-08T17:49:27.000Z","dependencies_parsed_at":"2024-08-08T20:37:23.678Z","dependency_job_id":null,"html_url":"https://github.com/CentralFloridaAttorney/dataspoon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CentralFloridaAttorney%2Fdataspoon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CentralFloridaAttorney%2Fdataspoon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CentralFloridaAttorney%2Fdataspoon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CentralFloridaAttorney%2Fdataspoon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CentralFloridaAttorney","download_url":"https://codeload.github.com/CentralFloridaAttorney/dataspoon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247375713,"owners_count":20929086,"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":["database","dataspoon","encoder-decoder","javaspoon","mysql","onehot"],"created_at":"2024-11-05T16:12:35.569Z","updated_at":"2025-04-05T17:33:04.187Z","avatar_url":"https://github.com/CentralFloridaAttorney.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --\u003e\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\u003c!--\n*** Thanks for checking out the Best-README-Template. If you have a suggestion\n*** that would make this better, please fork the repo and create a pull request\n*** or simply open an issue with the tag \"enhancement\".\n*** Don't forget to give the project a star!\n*** Thanks again! Now go create something AMAZING! :D\n--\u003e\n\n\n\n\u003c!-- PROJECT SHIELDS --\u003e\n\u003c!--\n*** I'm using markdown \"reference style\" links for readability.\n*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).\n*** See the bottom of this document for the declaration of the reference variables\n*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.\n*** https://www.markdownguide.org/basic-syntax/#reference-style-links\n--\u003e\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n[![License: GPL v2](https://img.shields.io/badge/License-GPL_v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)\n\n\n# Why use dataspoon?\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/CentralFloridaAttorney/dbtool\"\u003e\n    \u003cimg src=\"images/onehotdb.png\" alt=\"Logo\" width=\"1280\" height=\"480\"\u003e\n  \u003c/a\u003e\n\u003ch3 align=\"center\"\u003edataspoon\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    easy to use tools for working with data\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/CentralFloridaAttorney/dataspoon/wiki\"\u003e\u003cstrong\u003eExplore the Wiki»\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/CentralFloridaAttorney/dbtool\"\u003eView Demo | \u003c/a\u003e\n    \u003ca href=\"https://github.com/CentralFloridaAttorney/dbtool/issues\"\u003eReport Bug | \u003c/a\u003e\n    \u003ca href=\"https://github.com/CentralFloridaAttorney/dbtool/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n          \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n          \u003cul\u003e\n            \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Built With\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started With dataspoon\n\n### dbtool helps you to eat more data\nDBTool provides a simple way to connect to a MySQL database\n\n# Explanation of what the code does\n 1) create a database\n 2) create a table\n 3) create a row\n 4) create a column\n 5) create a value\n 6) create a key\n 7) create a link_key\n\n\nDBTool() allows you to create and modify MySQL databases using Python with simple get and put commands.\n\nFor example, you can set and get a key/value pair to ('ala'/'kazam') in a row that is referenced by the link_key ('xyzzy'):\n\n````\nDBTool().put('xyzzy', 'ala', 'kazam')\nvalue = DBTool().get('xyzzy', 'ala')\n````\nTo perform the same operation in a different database ('magicdb'):\n````\nDBTool('magicdb').put('xyzzy', 'ala', 'kazam')\nvalue = DBTool('magicdb').get('xyzzy', 'ala')\n````\n\nAnd, to perform the same operation in a different database ('magic_carpet') and a different table ('magic_table')\n````\nDBTool('magic_carpet', 'magic_table').put('xyzzy', 'ala', 'kazam')\nvalue = DBTool('magic_carpet', 'magic_table').get('xyzzy', 'ala')\n````\nThe behavior of the put method differs depending on the number of parameters passed.\n\n````\n    def put(self, primary_key, element_key=None, value=None):\n        # 1 parameter: add _link_key (returns row_number of _link_key)\n        # 3 parameters: for primary_key set key/value (returns row_number of _link_key)\n````\n\n\nExamples of using DBTool\n\n````\n    xyzzydb = DBTool() creates a database named dBTool with table named default_table.\n    xyzzydb = DBTool('xyzzydb') creates a database named xyzzydb with a table named default_table.\n    xyzzydb = DBTool('xyzzydb', 'best_magic_table') creates a database named xyzzydb with a table named best_magic_table.\n    xyzzydb.put('link_key_xyzzy') creates a row with link_key ('link_key_xyzzy')\n    xyzzydb.put('other_link_key', 'ala', 'kazam') sets key ('ala') to value ('kazam') in row with link_key ('other_link_key')\n    \n    1. Create a database ('xyzzydb', 'magic_table'): xyzzydb = DBTool('xyzzydb', 'magic_table').  The MySQL.table_name is a default name, unless you specify a table_name during creation (ex. xyzzydb = DBTool('xyzzydb', 'magic_table')) or after creation (ex. xyzzydb.open_table('new_magic_table'))\n    2. Create a new row with a link_key ('link_key_xyzzy'): xyzzydb.put('link_key_xyzzy')\n    3. Create or insert into a row with link_key_destination from link_key_source: xyzzydb.put('link_key_source', 'link_key_destination')\n    4. Put key/value ('ala'/'kazam') into row with link_key ('link_key_destination'): xyzzydb.put('link_key_destination', 'ala', 'kazam')\n    5. Get this_value ('kazam') using key ('ala') from row with link_key_destination : this_value = xyzzydb.get('link_key_destination', 'ala')\n    6. Save xyzzydb.magic_table as a pandas.DataFrame .pkl file to location ('data/mysql.pkl'): xyzzydb.pickle_words('data/mysql.pkl')\n````\n### dbtool.OneHotWords()\n\n# Explanation of what the code does\n 1. Create a new instance of the OneHotWords class\n 2. Get the index of the word 'hello'\n 3. Get the word at index 1\n 4. Get all the words in the onehot index\n\n\n### onehotdb makes data taste better\n\n# Explanation of what the code does\n 1) create a new database\n 2) create a new table\n 3) add a column to the table\n 4) add a row to the table\n 5) get the row number for a link_key\n 6) get the value for a key in a row\n 7) get the entire row for a link_key\n 8) update a value in a row\n 9) delete a table\n 10) delete a row\n 11) delete a column\n 11) delete a database\n 12) get the number of rows in a table\n 13) get the column names for a table\n 14) get a dataframe for a table\n 15) get a dataframe for a link_key\n\n### Prerequisites\n\n1. Install MySQL:\n    ```\n    sudo rm -rf /var/lib/mysql/mysql\n    sudo apt-get remove --purge mysql-server mysql-client mysql-common\n    sudo apt-get autoremove\n    sudo apt-get autoclean\n    sudo apt-get install mysql-server\n    ```\n2. Install mysql-connector-python:\n    ```\n    pip install mysql-connector-python\n    ```\n3. Optionally, install mysql-workbench:\n    ```\n    sudo snap install mysql-workbench-community\n    ```\n\n4. You need to know the location (ex. 127.0.0.1 or 192.168.1.69) and port number (ex. 3306 or 50011)\n5. You must know the username (ex. 'bilbo') and password (ex. 'baggins') of an authorized user in mysql\n\n\n### Installation\n\n1. If you need help using dataspoon then [Talk to John](https://centralfloridaattorney.net/schedule-consultation/)\n2. Clone the repo\n   ```\n   git clone https://github.com/CentralFloridaAttorney/dataspoon.git\n   ```\n3. No NPM packages to install\n   ```\n   NO npm install\n   ```\n4. Install mysql packages\n   ```\n   pip install mysql-connector-python\n   ```\n5. Create a file named `.env` in the root directory of your project and populate it with the following values:\n\n    ```\n    # Used by DBTool\n    DBTOOL_USER=bilbo\n    DBTOOL_PASSWD=baggins\n    DBTOOL_HOST=127.0.0.1\n    DBTOOL_PORT=3306\n    DBTOOL_DATABASE_NAME=default_database\n    DBTOOL_TABLE_NAME=default_table\n    DBTOOL_ONEHOTDB_NAME=default_onehotdb\n    DBTOOL_ONEHOTDB_TABLE=default_onehotdb_table\n    ```\n7. Install dotenv:\n\n    ```\n    pip install dotenv\n    ```\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n   \n_For more examples, please refer to the [Documentation](https://example.com)_\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\n- [ ] Feature 1\n- [ ] Feature 2\n- [ ] Feature 3\n    - [ ] Nested Feature\n\nSee the [open issues](https://github.com/CentralFloridaAttorney/dbtool/issues) for a full list of proposed features (and known issues).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- TROUBLESHOOTING --\u003e\n## Troubleshooting\n\nIf you get a root password error when starting MySQL consider: https://askubuntu.com/questions/1406395/mysql-root-password-setup-error\n\nIf bilbo is not present then use mysql:\n````\ncreate user 'bilbo'@'127.0.0.1' identified by 'baggins';\nGRANT ALL PRIVILEGES ON *.* TO 'bilbo'@'127.0.0.1' WITH GRANT OPTION;\nshow grants for 'bilbo'@'127.0.0.1';\n````\nIf you update Ubuntu and cannot reboot then fix your grub: https://phoenixnap.com/kb/grub-rescue\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nProject Link: [https://github.com/CentralFloridaAttorney/dbtool](https://github.com/CentralFloridaAttorney/dbtool)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n## Acknowledgments\n\n* []()\n* []()\n* []()\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n[![Product Name Screen Shot][product-screenshot]](https://CentralFloridaAttorney.net)\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/CentralFloridaAttorney/dbtool.svg?style=for-the-badge\n[contributors-url]: https://github.com/CentralFloridaAttorney/dbtool/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/CentralFloridaAttorney/dbtool.svg?style=for-the-badge\n[forks-url]: https://github.com/CentralFloridaAttorney/dbtool/network/members\n[stars-shield]: https://img.shields.io/github/stars/CentralFloridaAttorney/dbtool.svg?style=for-the-badge\n[stars-url]: https://github.com/CentralFloridaAttorney/dbtool/stargazers\n[issues-shield]: https://img.shields.io/github/issues/CentralFloridaAttorney/dbtool.svg?style=for-the-badge\n[issues-url]: https://github.com/CentralFloridaAttorney/dbtool/issues\n[license-shield]: https://img.shields.io/github/license/CentralFloridaAttorney/dbtool.svg?style=for-the-badge\n[license-url]: https://github.com/CentralFloridaAttorney/dbtool/blob/master/LICENSE.txt\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]:https://www.linkedin.com/in/john-m-iriye-3136478\n[product-screenshot]: images/dataspoon_project.png\n[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge\u0026logo=nextdotjs\u0026logoColor=white\n[Next-url]: https://nextjs.org/\n[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=61DAFB\n[React-url]: https://reactjs.org/\n[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge\u0026logo=vuedotjs\u0026logoColor=4FC08D\n[Vue-url]: https://vuejs.org/\n[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge\u0026logo=angular\u0026logoColor=white\n[Angular-url]: https://angular.io/\n[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge\u0026logo=svelte\u0026logoColor=FF3E00\n[Svelte-url]: https://svelte.dev/\n[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge\u0026logo=laravel\u0026logoColor=white\n[Laravel-url]: https://laravel.com\n[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge\u0026logo=bootstrap\u0026logoColor=white\n[Bootstrap-url]: https://getbootstrap.com\n[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge\u0026logo=jquery\u0026logoColor=white\n[JQuery-url]: https://jquery.com \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentralfloridaattorney%2Fdataspoon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentralfloridaattorney%2Fdataspoon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentralfloridaattorney%2Fdataspoon/lists"}