Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/univalence/zio-notion
A strongly typed interface to interact with Notion using ZIO
https://github.com/univalence/zio-notion
fp notion scala zio
Last synced: 24 days ago
JSON representation
A strongly typed interface to interact with Notion using ZIO
- Host: GitHub
- URL: https://github.com/univalence/zio-notion
- Owner: univalence
- License: apache-2.0
- Created: 2022-04-22T14:00:35.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-17T03:53:50.000Z (about 2 months ago)
- Last Synced: 2024-09-30T00:06:51.896Z (about 1 month ago)
- Topics: fp, notion, scala, zio
- Language: Scala
- Homepage:
- Size: 2.58 MB
- Stars: 7
- Watchers: 5
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ZIO Notion
A strongly typed interface to interact with Notion using ZIO## Documentation
You can find the documentation of zio-notion [here](https://univalence.github.io/zio-notion/).
## Example
```scala
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)) ++ archivefor {
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](https://github.com/univalence/zio-notion/tree/master/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:
```scala
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:```scala
resolvers += Resolver.sonatypeRepo("snapshots"),
libraryDependencies += "io.univalence" %% "zio-notion" % ""
```You can find the latest version on
[nexus repository manager](https://oss.sonatype.org/#nexus-search;gav~io.univalence~zio-notion_2.13~~~~kw,versionexpand).## 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!