6 stable releases
1.1.3 | Jul 18, 2024 |
---|---|
1.1.2 | Jul 10, 2024 |
1.1.0 | Jun 14, 2024 |
1.0.1 | Jun 12, 2024 |
1.0.0 | Jun 9, 2024 |
#119 in HTTP client
47 downloads per month
51KB
1K
SLoC
nuclino-rs
This is a Rust client for the Nuclino API. Simplicity and rapid development were my goals for this project and the project that I need it for, so it uses ureq as its base http client. This means all api requests are blocking. If this client would be more useful to you with an async http client, let me know.
Usage
cargo add nuclino-rs
in your project to add the library. There are no optional features. Create an API key for Nuclino. Provide it in the env var NUCLINO_API_KEY
and call nuclino_rs::Client::create_from_env()
to create a default client. Or you can provide it to your program in some other way and pass it to the client create()
function.and then start making requests using the client's functions.
cargo doc --open
has more information, as do the online docs.
Example
let client = nuclino_rs::Client::create_from_env()?;
let workspaces = client.workspace_list(None, None)?.to_vec();
let first = workspaces.first().unwrap();
let newpage = nuclino_rs::NewPageBuilder::item()
.title("I'm just a test")
.content(
"Yes I'm only a *test* and I'm sitting here on a Capitol Hill. Wait. That didn't rhyme.",
)
.workspace(first.id())
.build();
let newpage = client.page_create(newpage)?;
See examples/iterate_workspace_pages.rs
for a more complex example of accessing Nuclino data, creating wiki pages, and deleting them. cargo run --example iterate_workspace_pages
to run this example.
TODO
The API should be completely covered and theoretically working. The parts I've needed to use for my project are definitely working. Known work that I'd like to do:
- handle rate limiting
LICENSE
This code is licensed via the Parity Public License. This license requires people who build on top of this source code to share their work with the community, too. See the license text for details.
Dependencies
~3–4.5MB
~99K SLoC