{"id":15722179,"url":"https://github.com/rcaught/datasette-updated","last_synced_at":"2025-08-07T04:37:32.051Z","repository":{"id":212488319,"uuid":"729836633","full_name":"rcaught/datasette-updated","owner":"rcaught","description":"Datasette Plugin - Display the date your data was updated","archived":false,"fork":false,"pushed_at":"2024-04-09T14:36:03.000Z","size":204,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T04:25:28.827Z","etag":null,"topics":["datasette-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcaught.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-12-10T14:08:19.000Z","updated_at":"2024-04-09T14:09:04.000Z","dependencies_parsed_at":"2024-04-09T15:48:04.276Z","dependency_job_id":"b29fe445-f756-46c1-afed-d439a3b3316a","html_url":"https://github.com/rcaught/datasette-updated","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.08695652173913049,"last_synced_commit":"1150cc5a6c7160a64e84d16cc7ad2c12debd92e0"},"previous_names":["rcaught/datasette-updated"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rcaught/datasette-updated","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcaught%2Fdatasette-updated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcaught%2Fdatasette-updated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcaught%2Fdatasette-updated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcaught%2Fdatasette-updated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcaught","download_url":"https://codeload.github.com/rcaught/datasette-updated/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcaught%2Fdatasette-updated/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269201040,"owners_count":24377442,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["datasette-plugin"],"created_at":"2024-10-03T22:04:55.720Z","updated_at":"2025-08-07T04:37:31.974Z","avatar_url":"https://github.com/rcaught.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datasette-updated\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-updated.svg)](https://pypi.org/project/datasette-updated/)\n[![Changelog](https://img.shields.io/github/v/release/rcaught/datasette-updated?include_prereleases\u0026label=changelog)](https://github.com/rcaught/datasette-updated/releases)\n[![Tests](https://github.com/rcaught/datasette-updated/workflows/Test/badge.svg)](https://github.com/rcaught/datasette-updated/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/rcaught/datasette-updated/blob/main/LICENSE)\n\nDisplay the date your data was updated\n\n## Installation\n\nInstall this plugin in the same environment as Datasette.\n```bash\ndatasette install datasette-updated\n```\n## Usage\nYou can have a different `updated` value per table, database or Datasette instance. If undefined at any level, `updated` will fall back in that order. If no value is set, `updated` will be `unknown`.\n\n### Base metadata configuration\nIf you have known `updated` values, you can define them in your base `metadata.(json|yml)`:\n```json\n{\n  \"plugins\": {\n    \"datasette-updated\": {\n      \"updated\": \"2023-12-14T23:04:42+00:00\"\n    }\n  },\n  \"databases\": {\n    \"my-database-name\": {\n      \"plugins\": {\n        \"datasette-updated\": {\n          \"updated\": \"2023-01-01T00:00:00+00:00\"\n        }\n      },\n      \"tables\": {\n        \"my-table-name\": {\n          \"plugins\": {\n            \"datasette-updated\": {\n              \"updated\": \"2020-01-01T00:00:00+00:00\"\n            }\n          }\n          ...\n```\n\n### Plugin metadata configuration\nIf you want to define more dynamic `updated` value(s) on `datasette package` or `datasette publish`, put metadata for this plugin in `YOUR_PLUGINS_DIR/datasette-updated/metadata.(json|yml)`. The following is an example that sets `updated` to the current date/time.\n```sh\nmkdir -p plugins/datasette-updated/ \u0026\u0026 \\\necho '{\n  \"plugins\": {\n    \"datasette-updated\": {\n      \"updated\": \"'\"$(date -Iseconds)\"'\"\n    }\n  }\n}' \u003e plugins/datasette-updated/metadata.json \u0026\u0026 \\\ndatasette publish --plugins-dir=plugins --install=datasette-updated ...\n```\n\n### Combined metadata configuration\nYou can combine base metadata and plugin metadata configuration, but be aware that the base `metadata.(json|yml)` will always win if there is a duplicate configuration value.\n\n### Extra configuration\nThe base / instance level metadata can accept the following extra configuration (that will apply to all levels):\n- `time_type` (default: `time-ago`)\n\n  - `time`: [2023-12-01T00:00:00+00:00](https://github.com/basecamp/local_time/tree/main#time-and-date-helpers)\n  - `date`: [\"Apr 11\" or \"Apr 11, 2013\"](https://github.com/basecamp/local_time/tree/main#relative-time-helpers)\n  - `time-ago`: [\"a second ago\", \"32 seconds ago\", \"an hour ago\", \"14 hours ago\"](https://github.com/basecamp/local_time/tree/main#time-ago-helpers)\n  - `time-or-date`: [\"3:26pm\" or \"Apr 11\"](https://github.com/basecamp/local_time/tree/main#relative-time-helpers)\n  - `weekday`: [\"Today\", \"Yesterday\", or the weekday](https://github.com/basecamp/local_time/tree/main#relative-time-helpers)\n  - `weekday-or-date`: [\"Yesterday\" or \"Apr 11\"](https://github.com/basecamp/local_time/tree/main#relative-time-helpers)\n\n\n  ```json\n  {\n    \"plugins\": {\n      \"datasette-updated\": {\n        \"time_type\": \"time\"\n      }\n    }\n  }\n  ```\n\n### Display\nThe plugin will try to load a footer template that is copied from the default Datasette footer template, but with the following addition:\n\n```html\n{% if datasette_updated %}\u0026middot;\n    Updated:\n    \u003ctime\n      data-local=\"{{ datasette_updated.time_type }}\"\n      datetime=\"{{ datasette_updated.updated }}\"\u003e\n        {{ datasette_updated.updated }}\n    \u003c/time\u003e\n{% endif %}\n```\n\n- **If you have your own custom footer template, you will need to add the above code**, as your base template will take precedence.\n- Look at [local_time](https://github.com/basecamp/local_time/tree/main#example) for extra configuration options (just ignore the Ruby parts).\n\n## Screenshot and Demo\n![screenshot](https://github.com/rcaught/datasette-updated/raw/master/screenshot.png)\n- Example site: https://querydata.io/\n- The Javascript component converts time elements from UTC to the browser's local time.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd datasette-updated\npython3 -m venv venv\nsource venv/bin/activate\n```\nNow install the dependencies and test dependencies:\n```bash\npip install -e '.[test]'\n```\nTo run the tests:\n```bash\npytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcaught%2Fdatasette-updated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcaught%2Fdatasette-updated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcaught%2Fdatasette-updated/lists"}