Coder Social home page Coder Social logo

scala-steward / zio-notion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from univalence/zio-notion

0.0 1.0 0.0 1.41 MB

A strongly typed interface to interact with Notion using ZIO

License: Apache License 2.0

Shell 0.27% JavaScript 1.07% Scala 98.34% CSS 0.28% Makefile 0.04%

zio-notion's Introduction

ZIO Notion

A strongly typed interface to interact with Notion using ZIO

Documentation

You can find the documentation of zio-notion here.

Example

import zio._
import zio.notion._
import zio.notion.dsl._

import java.time.LocalDate

object UpdatePage extends ZIOAppDefault {
  def example: ZIO[Notion, NotionError, Unit] = {
    val date = LocalDate.of(2022, 2, 2)
    
    // Apply the following operations to the page:
    //   - Apply the ceil function to the value contained in "col1"
    //   - Set the date between 2022-02-02 and 2022-02-16 in "col2"
    //   - Archive the page
    val operations = $"col1".asNumber.patch.ceil ++ $"col2".asDate.patch.between(date, date.plusDays(14)) ++ archive

    for {
      page <- Notion.retrievePage("6A074793-D735-4BF6-9159-24351D239BBC") // Insert your own page ID
      _    <- Notion.updatePage(page, operations)
    } yield ()
  }

  override def run =
    example.provide(Notion.layerWith("6A074793-D735-4BF6-9159-24351D239BBC")) // Insert your own bearer
}

We provide other examples in this repository.

Features

Page

  • You can update a page
  • You can retrieve a page
  • You can archive a page
  • You can create a page

Database

  • You can update a database
  • You can retrieve a database
  • You can query a database
  • You can create a database (without blocks for the moment)

Block

  • You can retrieve a block
  • You can retrieve blocks of a page
  • You can update a block ๐Ÿ•ฆ COMING SOON
  • You can delete a block ๐Ÿ•ฆ COMING SOON
  • You can append a block

User

  • You can retrieve a user
  • You can list users
  • You can retrieve your token's bot user ๐Ÿ•ฆ COMING SOON

Search

๐Ÿ•ฆ COMING SOON

Latest version

If you want to get the very last version of this library you can still download it using:

libraryDependencies += "io.univalence" %% "zio-notion" % "0.9.3"

Snapshots

If you want to get the latest snapshots (the version associated with the last commit on master), you can still download it using:

resolvers += Resolver.sonatypeRepo("snapshots"),
libraryDependencies += "io.univalence" %% "zio-notion" % "<SNAPSHOT-VERSION>"

You can find the latest version on nexus repository manager.

Contributions

Pull requests are welcomed. We are open to organize pair-programming session to tackle improvements. If you want to add new things in zio-notion, don't hesitate to open an issue!

zio-notion's People

Contributors

ahoy-jon avatar dependabot[bot] avatar dylandoamaral avatar guihardbastien avatar scala-steward avatar univalence-scala-steward[bot] avatar

Watchers

 avatar

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.