{"id":21832574,"url":"https://github.com/ivynya/notion_flatten","last_synced_at":"2026-04-09T09:48:29.489Z","repository":{"id":62422484,"uuid":"440763699","full_name":"ivynya/notion_flatten","owner":"ivynya","description":"Flattens Notion API responses to be easier to work with.","archived":false,"fork":false,"pushed_at":"2022-01-17T06:56:41.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T19:45:26.747Z","etag":null,"topics":["deno","notion","notion-api"],"latest_commit_sha":null,"homepage":"https://deno.land/x/notion_flatten","language":"TypeScript","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/ivynya.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}},"created_at":"2021-12-22T06:57:10.000Z","updated_at":"2023-10-16T20:05:58.000Z","dependencies_parsed_at":"2022-11-01T17:33:22.095Z","dependency_job_id":null,"html_url":"https://github.com/ivynya/notion_flatten","commit_stats":null,"previous_names":["sdbagel/notion_flatten"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivynya%2Fnotion_flatten","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivynya%2Fnotion_flatten/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivynya%2Fnotion_flatten/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivynya%2Fnotion_flatten/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivynya","download_url":"https://codeload.github.com/ivynya/notion_flatten/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244110086,"owners_count":20399561,"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":["deno","notion","notion-api"],"created_at":"2024-11-27T19:21:17.997Z","updated_at":"2025-12-30T23:57:46.097Z","avatar_url":"https://github.com/ivynya.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# notion-flatten\n\n\u003e ⚠️ WIP, flattened object schema subject to change in future versions.\n\u003e\n\u003e ⚠️ Probably not a good idea use this in a production scenario (for now). You have been warned.\n\nFlattens Notion API responses to be easier to work. This is accomplished by removing type and other information (and therefore the assosciated nested objects created by the Notion API).\n\nThis module is best used if type information is known beforehand, but if type information is needed, a flattened database schema can be generated using `flattenDatabase` containing all DB properties and type information.\n\n## Usage Examples\n\n### Pre \u0026 Post Transformation Data\nExamples of non-flattened and flattened data are available in the [test folder](./test) of this repository. Each file contains raw API data as well as the flattened version of that data, according to the appropriate transform function.\n\n### Flattening a Database Query\n```ts\nimport { flattenQuery } from \"https://deno.land/x/notion-flatten@v0.3.2/mod.ts\";\n\nconst res = await fetch(`https://api.notion.com/v1/databases/:id/query`, ...);\nconst data = await res.json();\n\nconst flatData = flattenQuery(data);\n```\n\n### Flattening Database Meta Info\n```ts\nimport { flattenDatabase } from \"https://deno.land/x/notion-flatten@v0.3.2/mod.ts\";\n\nconst res = await fetch(`https://api.notion.com/v1/databases/:id`, ...);\nconst data = await res.json();\n\nconst flatMetadata = flattenDatabase(data);\n```\n\n### Flattening a Page\n```ts\nimport { flattenPage } from \"https://deno.land/x/notion-flatten@v0.3.2/mod.ts\";\n\nconst res = await fetch(`https://api.notion.com/v1/pages/:id`, ...);\nconst data = await res.json();\n\nconst flatPage = flattenPage(data);\n```\n\n### Flattening a Property\n```ts\nimport { flattenProperty } from \"https://deno.land/x/notion-flatten@v0.3.2/mod.ts\";\n\nconst res = await fetch(`https://api.notion.com/v1/pages/:id`, ...);\nconst data = await res.json();\n\nconst flatPage = flattenProperty(data);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivynya%2Fnotion_flatten","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivynya%2Fnotion_flatten","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivynya%2Fnotion_flatten/lists"}