{"id":20702935,"url":"https://github.com/HelloEvenZhang/notion-model","last_synced_at":"2025-05-10T20:30:38.400Z","repository":{"id":156102724,"uuid":"607981645","full_name":"HelloEvenZhang/notion-model","owner":"HelloEvenZhang","description":"A ruby gem that allows you to read, write, and update Notion databases and pages like ActiveModel.","archived":false,"fork":false,"pushed_at":"2023-04-26T09:46:46.000Z","size":57,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"release","last_synced_at":"2025-04-24T12:04:10.525Z","etag":null,"topics":["notion","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/HelloEvenZhang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-01T04:07:44.000Z","updated_at":"2023-10-16T18:34:14.000Z","dependencies_parsed_at":"2023-08-16T17:00:00.067Z","dependency_job_id":null,"html_url":"https://github.com/HelloEvenZhang/notion-model","commit_stats":null,"previous_names":["ven0802/notion-model"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloEvenZhang%2Fnotion-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloEvenZhang%2Fnotion-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloEvenZhang%2Fnotion-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloEvenZhang%2Fnotion-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HelloEvenZhang","download_url":"https://codeload.github.com/HelloEvenZhang/notion-model/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253480197,"owners_count":21915245,"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":["notion","ruby","ruby-on-rails"],"created_at":"2024-11-17T01:05:35.326Z","updated_at":"2025-05-10T20:30:38.091Z","avatar_url":"https://github.com/HelloEvenZhang.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notion::Rb\n\n一个能让你像ActiveModel一样增删改查Notion中的Databases和Pages的RubyGem\n\n## 安装\n\n依赖：\n- Ruby \u003e= 2.6\n\n安装命令：\n```bash\ngem install notion-rb\n```\n\n或在Gemfile中增加\n```ruby\ngem 'notion-rb'\n```\n\n然后执行\n```bash\nbundle install\n```\n\n## 使用\n```ruby\n# 先做好必要配置\nNotion.config.token = 'YOUR_NOTION_TOKEN'\n\n# 或者\nNotion.configure do |config|\n  config.token = \"YOUR_NOTION_TOKEN\"\nend\n\n# 参考ActiveRecord处理数据的方法，以面向对象的方式操作数据\ndatabase = Notion::Database.find(your_database_id)\n\n# 由于不同Database下的Page都可能有不同的属性\n# 因此每个Page实例中的属性在获得pages时动态生成\npages = database.pages\n\n# 把提供的选项转换为等价的JSON Query结构体\n# 触发Http请求并从Response中检索对应的结果\n# 为每个查询结果实例化对应的模型对象\nsome_pages = pages.where(options)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHelloEvenZhang%2Fnotion-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHelloEvenZhang%2Fnotion-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHelloEvenZhang%2Fnotion-model/lists"}