pantry
Client library for https://getpantry.cloud/
Wraps a native library — check OS Compatibility below for platform-specific linking notes.
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:25 |
Tags
Installation
nimble install pantry
choosenim install pantry
git clone https://github.com/ire4ever1190/pantry-nim
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| pantry | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/ire4ever1190/pantry-nim |
|---|---|
| Homepage | https://github.com/ire4ever1190/pantry-nim |
| Registry Source | nimble_official |
README
pantry-nim
Easy SDK for interacting with Pantry.
This is not an official project of pantry and is just fan made
Installation
nimble install pantry
Examples
(While this examples are synchronous you can use newAsyncPantryClient to use async version)
Connecting to your pantry
let pc = newPantryClient(your-pantry-token)
Getting information about pantry
let pantry = pc.getDetails()
assert pantry.percentFull < 100 # Make sure we are under the limit
# List all your baskets (They are stored has a table)
for basket in pantry.values:
echo basket.name
Information is stored via baskets which is a single JSON object. Each pantry can have up to 100 baskets (max size is 1.44mb each). Baskets can be interacted with the following operations
create: Sets the data of the basket, overwrites existing informationupdate: Updates the information currently in a basketget: Gets the information stored inside a basketdelete: Deletes the basket
pc.create("test", %* {
"foo": "bar"
})
assert pc.get("test")["foo"] == %"bar"
let newData = pc.update("test", %* {
"foo": "notBar"
})
assert newData["foo"] == %"notBar"
pc.delete("foo")
Objects can be used instead of JsonNode for create, get, and update
type
User = object
id: int
email: string
pc.create("admin", User(id: 9, email: "user@example.com"))
assert pc.get("admin", User).email == "user@example.com"
assert pc.update("admin", User(id: 9, email: "admin@example.com")).email == "admin@example.com"
# Can also use option types when getting to avoid errors
import std/options
assert pc.get("doesntExst", Option[User]).isNone()
assert pc.get("admin", Option[User]).isSome()