The project is in a healthy, maintained state
Mapping tool from Notion Database/Page/Block to Ruby Objects.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

Runtime

 Project Readme

notion_ruby_mapping

Notion Ruby mapping is currently under development.

Development note is here. → Idea note of "notion_ruby_mapping"

Table of Contents

  • notion_ruby_mapping
    • Table of Contents
    • 1. Installation
    • 2. How to use
      • 2.1 Create a New Integration
      • 2.2 Create client
      • 2.3 Sample codes
      • 2.4. Another example code (Use case)
      • 2.5 API reference
    • 3. ChangeLog
    • 4. Contributing
    • 5. License
    • 6. Code of Conduct
    • 7. Acknowledgements

1. Installation

Add this line to your application's Gemfile:

gem 'notion_ruby_mapping'

And then execute:

bundle install

Or install it yourself as:

gem install notion_ruby_mapping

2. How to use

2.1 Create a New Integration

Please check Notion documentation.

2.2 Create client

Please create a client (notion-ruby-client) before you use the following class.

NotionCache.instance.create_client "secret_XXXXXXXXXXXXXXXXXXXX" # write directly
NotionCache.instance.create_client ENV["NOTION_API_TOKEN"] # from environment

2.3 Sample codes

  1. Database and page access sample
  2. Append block children sample

2.4. Another example code (Use case)

  1. Set icon to all icon unsettled pages
  2. Renumbering pages
  3. Change title

2.5 API reference

  1. Notion Ruby Mapping Public API reference

3. ChangeLog

  • added append_block_children
  • added retrieve_block spec
  • 2022/4/29 Change directory structure, TEST_IDs are moved from env.yml to TestConnection's constants
  • 2022/4/27 added Base#children
  • 2022/3/27 create_child_page can receive a block for initialization.
  • 2022/3/27 properties of a created child page are automatically assigned using the parent database.
  • 2022/3/25 added create_child_database, update_database, add_property, rename_property and remove_property
  • 2022/3/17 added template_mention objects, tools/an command
  • 2022/3/16 added database.create_child_page and base.save instead of base.update/create
  • 2022/3/15 Fixed not to reload from API when all contents are loaded
  • 2022/3/14 Exclude notion-ruby-client, update Property values, update for Notion-Version 2022-02-22
  • 2022/2/25 add_property_for_update -> assign_property, update README.md
  • 2022/2/20 add support for MultiSelectProperty
  • 2022/2/19 add support for SelectProperty
  • 2022/2/17 added Page#properties, Page#add_property_for_update, Page#update
  • 2022/2/17 added Page#properties, Page#add_property_for_update, Page#update
  • 2022/2/16 added PropertyCache and Payload class
  • 2022/2/14 added Database#set_icon
  • 2022/2/13 added Page#set_icon
  • 2022/2/13 First commit

4. Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hkob/notion_ruby_mapping. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

5. License

The gem is available as open source under the terms of the MIT License.

6. Code of Conduct

Everyone interacting in the NotionRubyMapping project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

7. Acknowledgements

The code depends on notion-ruby-client.