Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/46ki75/notionrs
🦀 Community-driven Notion API client for Rust , offering complete deserialization support and providing a secure way to access properties! 🔒
https://github.com/46ki75/notionrs
notion notion-api rust rust-lang
Last synced: 4 months ago
JSON representation
🦀 Community-driven Notion API client for Rust , offering complete deserialization support and providing a secure way to access properties! 🔒
- Host: GitHub
- URL: https://github.com/46ki75/notionrs
- Owner: 46ki75
- License: apache-2.0
- Created: 2024-03-28T07:16:47.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T20:37:36.000Z (4 months ago)
- Last Synced: 2024-10-21T21:30:46.236Z (4 months ago)
- Topics: notion, notion-api, rust, rust-lang
- Language: Rust
- Homepage:
- Size: 405 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Notion API Client for Rust
[](https://github.com/46ki75/notionrs/actions/workflows/unit-tests.yml)
[](https://github.com/46ki75/notionrs/actions/workflows/build-documentation.yml)
[](https://crates.io/crates/notionrs/)**Status: Alpha Release! (Under Construction**) 🚧
This project is currently under active development and is not yet ready for production use. Features and API stability may change without notice. Contributions and feedback are welcome!
## Features currently released
As part of the alpha release, the following features are available. Please note that API changes may occur before the official release.
- Append block children
- Retrieve a block
- Retrieve block children
- Update a block
- Delete a block## Basic Usage
Below is a basic example. (More detailed documentation is coming soon, so please stay tuned!)
```rs
use notionrs::{
block::{Block, ParagraphBlock},
error::Error,
Client, RichText,
};#[tokio::main]
async fn main() -> Result<(), Error> {
dotenvy::dotenv().ok();let client = Client::new();
// Here, we're retrieving the ID from an environment variable,
// but you can change the method of retrieval to suit your needs.
let block_id = std::env::var("NOTION_PAGE_ID").unwrap();let block = Block::Paragraph {
paragraph: ParagraphBlock::new()
.rich_text(vec![RichText::from("Time to start with Notion in Rust")]),
};let request = client
.append_block_children()
.block_id(block_id.clone())
.children(vec![block]);let response = request.send().await?;
println!("{:?}", response);
Ok(())
}
```