Coder Social home page Coder Social logo

notion-java-sdk's Introduction

Notion Java SDK

https://img.shields.io/badge/license-MIT-blue https://img.shields.io/github/commit-activity/m/YiHeCN/notion-java-sdk https://img.shields.io/badge/Maven-0.0.1--SNAPSHOT-lightgrey https://img.shields.io/github/forks/YiHeCN/notion-java-sdk?style=social https://img.shields.io/github/stars/YiHeCN/notion-java-sdk?style=social

Notion-java-sdk is a java version of Notion API.

It provides:

  1. Basic packaging of Notion objects (com._2lazy2name.notion.entity)
  2. Basic API request (com._2lazy2name.notion.Notion)

Things to Aware

Basic entities and API requests are checked, but not guaranteed safe to use.

The API is based on the API Version of 2022-06-28, which is the latest version on Feb 19, 2023. Future updates are NOT guaranteed, which also means Notion Version in headers is not configurable before a new release.

Compatibility

The project is written on the source level of Java 17. Since enhanced switch blocks are used somewhere, the minimum version accepted is Java 14. All you need to change to make it compatible with Java 8 is two switch blocks in FilterSerializer.

How to use it?

  1. Add dependency in pom.xml
<dependency>
  <groupId>com.2lazy2name</groupId>
  <artifactId>notion-java-sdk</artifactId>
  <version>v0.1.0-SNAPSHOT</version>
</dependency>
  1. Instantiated Notion.class

    1. If you are using Spring-Framework:

      @Bean
      Notion notion() {
          Notion notion = new Notion(NOTION_TOKEN);
          return notion;
      }
    2. If you are using vanilla Java, Simply use the constructor:

      Notion notion = new Notion(NOTION_TOKEN);
  2. All the official endpoints are provided in Notion.class as methods. There are properly annotated and linked to official notion documents.

  3. If you believe there is an error with this project:

    1. For IOException: use notion.setDebugEnabled(true) , and attach Http request details in the issue.
    2. For JsonParsingException : provide the fields value of the object type that you are dealing with in the issue.

Lib used

Jackson and Apache Http Client5.

Future Plan

  1. Make it compatible to Java 8.
  2. Add more tests. (Well, maybe when I encounter some bugs.)
  3. Update to the latest version of Notion API.

Issue and Contact

I don’t check GitHub very often. For any issues or commit, there are some ways to quicker notices and solutions:

  1. E-mail [email protected]
  2. Notion Page - Check the test cases for usage.
  3. Telegram Group

Suggestions in code styles and implementation with optimization advice are highly welcomed.

Disclaimer

This Repository is NOT provided by Notion and NOT endorsed by Notion. There are also some potential bugs and performance issues. THINK whether you are OK for the risk before you really use it.

notion-java-sdk's People

Contributors

yihecn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notion-java-sdk's Issues

[Cookie Policy] Wrong cookie policy in HttpClient, but not affect using.

2023-03-13T17:58:06.513+08:00  WARN 22149 --- [main] o.a.h.c.h.p.ResponseProcessCookies       : ex-0000000001 Cookie rejected [notion_check_cookie_consent="false", domain:www.notion.so, path:/, expiry:Tue Mar 14 17:58:05 CST 2023] Illegal 'domain' attribute "www.notion.so". Domain of origin: "api.notion.com"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.