{"id":13936532,"url":"https://github.com/prahladyeri/tiddly","last_synced_at":"2026-03-04T23:01:53.448Z","repository":{"id":57475433,"uuid":"93505112","full_name":"prahladyeri/tiddly","owner":"prahladyeri","description":"Minimal, prototype RESTful server for basic CRUD transactions","archived":false,"fork":false,"pushed_at":"2017-06-20T12:59:16.000Z","size":26,"stargazers_count":38,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-28T06:17:44.891Z","etag":null,"topics":["crud","python3","rest-api","sqlalchemy"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prahladyeri.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-06T10:15:52.000Z","updated_at":"2025-01-10T21:26:23.000Z","dependencies_parsed_at":"2022-09-07T13:51:06.830Z","dependency_job_id":null,"html_url":"https://github.com/prahladyeri/tiddly","commit_stats":null,"previous_names":["prahladyeri/flask-tiddly"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prahladyeri/tiddly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prahladyeri%2Ftiddly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prahladyeri%2Ftiddly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prahladyeri%2Ftiddly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prahladyeri%2Ftiddly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prahladyeri","download_url":"https://codeload.github.com/prahladyeri/tiddly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prahladyeri%2Ftiddly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30098086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T22:49:54.894Z","status":"ssl_error","status_checked_at":"2026-03-04T22:49:48.883Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["crud","python3","rest-api","sqlalchemy"],"created_at":"2024-08-07T23:02:45.580Z","updated_at":"2026-03-04T23:01:53.431Z","avatar_url":"https://github.com/prahladyeri.png","language":"Python","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=JM8FUXNFUK6EU"],"categories":["Python"],"sub_categories":[],"readme":"![License](https://img.shields.io/badge/license-MIT-blue.svg)\r\n![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)\r\n[![](https://www.paypalobjects.com/en_US/i/btn/x-click-but04.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=JM8FUXNFUK6EU)\r\n\r\n# tiddly\r\n\r\n1. [What is tiddly](#user-content-what-is-tiddly)\r\n2. [Project Details](#project-details)\r\n7. [Installation](#installation)\r\n3. [Feature Roadmap](#feature-roadmap)\r\n11. [License](#license)\r\n13. [Stack](#stack)\r\n\r\n## What is tiddly\r\n\r\n`tiddly` is a minimal, prototype RESTful server app for basic CRUD transactions. It is database agnostic and uses `sqlalchemy` on the backend to talk to RDBMS. The database is `sqlite` by default, but you can switch to anything you want by making this small change in the `models.py` file:\r\n\r\n\t#TODO: Change as needed:\r\n\tengine = create_engine(\"sqlite:///tiddly.db\", echo=True)\r\n\tBase = declarative_base()\r\n\r\n## Project Details\r\n\r\nYou can host this app and use it as your own replacement for any cloud based backend such as `firebase` or `CouchDB` as long as you follow the CRUD based I/O approach. The RESTful methods are versatile and compatible with the data needs of typical Single Page Apps developed in frameworks like `angular`, `backbone` or `ember`. For example:\r\n\r\n| Request | url | body | Action |\r\n| ----- | ----- | ----- | ----- |\r\n| GET  \t| /books | \t\t| Get all rows from the books table.| \r\n| GET  \t| /books/1 | \t\t| Fetch the book record where the `id` field equals `1`.| \r\n| POST \t| /books | {\"name\":\"Harry Potter and the order of the Phoenix.\"}\t\t| Insert record into books table from posted JSON data.| \r\n| PUT  \t| /books/1 | {\"name\":\"Some new title.\"}\t\t| Update the record where `id` equals `1` with posted JSON data.| \r\n| DELETE | /books/1 |\t| Delete the record where `id` equals `1`.| \r\n\t\r\nAdditional tables like `books` in this example need to be defined in `models.py`. By default, `tiddly` comes with only two tables called `dual` and `user` to play around. Of course, you can customize and change this logic in `app.py` if you really want. There is also the case when the `GET` method that gets all or one row by `id` isn't sufficient and we need advanced fetching using the `where` or `orderby` clauses. For this, I've introduced the `FETCH` http method which does the job:\r\n\r\n| Request | url | body                | Action |\r\n| ----- | ----- | -------------------- | -------------------------------- |\r\n| FETCH | /dual | {\"where\": {\"text\":\"foobar\"}} | Fetch all rows from the books table where the text field matches the string \"foobar\".| \r\n| FETCH | /user | {\"where\": {\"name\":\"admin\"}, \"orderby\": \"email\"} | Fetch all rows from the user table where the name matches \"admin\" and sort results by email column.| \r\n| FETCH | /user | {\"where\": {\"name\":\"admin\"}, \"orderby\": \"email desc\"} | Fetch all rows from the user table where the name matches \"admin\" and sort results by email column in descending order.| \r\n| FETCH | /user | {\"where\": {\"name\":\"admin\"}, \"orderby\": \"email desc\", \"limit\":10, \"offset\": 2} | Fetch at most 10 rows, starting at offset 2 from the user table where the name matches \"admin\". Sort results by email column in descending order.| \r\n\r\n\r\n## Installation\r\n\r\nTo install and run this project, just clone or [download](https://github.com/prahladyeri/tiddly/archive/master.zip) this github repository and just start the `tiddly` app:\r\n\r\n\tpython app.py\r\n\t\r\nI've tested this on Python 3.6, but it should ideally run on other versions too. Once you run it, you can open your browser and browse the following `url` to make sure its running:\r\n\r\n\thttp://127.0.0.1:5000\r\n\t\r\nAfter that, you can make the following POST request to insert some data into the dual table.\r\n\r\n\trequests.post('http://localhost:5000/dual', json={\"text\":\"chai and biscuit.\"})\r\n\r\nYou can use the accompanying `test.py` or any other tool like `curl` to make these requests. Now, open up the browser again and visit below `url` to list all the records in the `dual` table:\r\n\r\n\thttp://127.0.0.1:5000/dual\r\n\t\r\nAfter running the above command, you should be able to see something like this:\r\n\r\n\t{\r\n\t  \"data\": [\r\n\t\t{\r\n\t\t  \"id\": 1, \r\n\t\t  \"text\": \"chai and biscuit.\"\r\n\t\t}\r\n\t  ], \r\n\t  \"status\": \"success\", \r\n\t  \"verb\": \"GET\"\r\n\t}\r\n\t\r\nNote that the app only works with `json` data, so the usual POST requests won't work. Similarly, you can try out other verbs - `PUT` and `DELETE` to update and delete records respectively. To define your own new table, open the `models.py` in a text-editor and define your own class based on the sqlalchemy declarative `Base` class. Write the new class code around the other defined Model classes, for example the `Dual` class:\r\n\r\n\tclass Dual(Base):\r\n\t\t__tablename__ = \"dual\"\r\n\t\tid = Column(Integer, primary_key=True)\r\n\t\ttext = Column(String)\r\n\t\t\r\n\t\tdef repr(self):\r\n\t\t\treturn \"\u003cDual(id=%s, text=%s, )\u003e\" % (id, text)\r\n\t\t\t\r\nFinally, you can also install `tiddly` using `pip` just to play around with:\r\n\r\n\tpip install tiddly\r\n\t\t\t\r\n## Feature Roadmap\r\n\r\nI intend to add the following features to this template project soon:\r\n\r\n- Sorting using `order by` clause (done).\r\n- Pagination.\r\n- Fetching summaries using `group by` clause.\r\n- User sign-in and authentication using session or tokens.\r\n\r\n## License\r\n\r\ntiddly is free and open source, and available under `MIT` license.\r\n\r\n## Stack\r\n\r\n`tiddly` is built using the robust `flask` framework and `sqlalchemy` library.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprahladyeri%2Ftiddly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprahladyeri%2Ftiddly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprahladyeri%2Ftiddly/lists"}