Skip to content

Latest commit

 

History

83 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pecans

Pretty Easy Two Cans & String API wrapper for version 1.68.

API spec written in TypeSpec with custom codegen emitters for different languages.

TypeScript

import { Client } from "pecans";

const client = new Client("AUTH COOKIE HERE");
const res = await client.messages.folderView();
for (const msg of res.messages) {
    console.log(msg.preview);
}

You can also use TwoCans's call batching to batch several calls together in one request:

const [inbox, search] = await client.batch(
    client.messages.folderView(),
    client.forum.search("hello"),
);

Python

Requires Python 3.11+ and httpx.

import asyncio
from pecans import Client

async def main():
    client = Client("AUTH COOKIE HERE")
    res = await client.messages.folderView()
    for msg in res["messages"]:
        print(msg["preview"])

asyncio.run(main())

Batching, supporting Typed responses of up to 8 requests, untyped beyond that:

inbox, search = await client.batch(
    client.messages.folderView(),
    client.forum.search("hello"),
)

About

pretty easy cross-lang API for twocans

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages