Coder Social home page Coder Social logo

wrapi's Introduction

Requirements:

  • Python 3.7+

Examples of usage:

Sync client:

from typing import List

from wrapi.api import query
from wrapi.auth import WrikePermanentTokenAuth
from wrapi.client import client
from wrapi.endpoints import folders
from wrapi.entities.folders import Folder
from wrapi.types_.inputs import CustomField, Project


def main() -> None:
    with client(WrikePermanentTokenAuth("your-auth-token")) as cl:
        create_folder = query(
            cl,
            folders.CreateFolder(
                folder_id="12523623",
                title="New Field",
                custom_fields=(CustomField(id="123456", value="1avagas"),),
                project=Project(custom_status_id="12312415"),
            ),
        )
        folder = create_folder.as_model(List[Folder])[0]
        
        update_folder = query(cl, folders.ModifyFolder(folder_id=folder.id, add_parents=("123456", )))
        update_folder.ignored()


if __name__ == "__main__":
    main()

Async client:

from typing import List
from asyncio import run

from wrapi.api import query
from wrapi.auth import WrikePermanentTokenAuth
from wrapi.client import async_client
from wrapi.endpoints import folders
from wrapi.entities.folders import Folder
from wrapi.types_.inputs import CustomField, Project


async def main() -> None:
    async with async_client(WrikePermanentTokenAuth("your-auth-token")) as cl:
        create_folder = query(
            cl,
            folders.CreateFolder(
                folder_id="12523623",
                title="New Field",
                custom_fields=(CustomField(id="123456", value="1avagas"),),
                project=Project(custom_status_id="12312415"),
            ),
        )
        folder = (await create_folder.as_model(List[Folder]))[0]
        
        update_folder = query(cl, folders.ModifyFolder(folder_id=folder.id, add_parents=("123456", )))
        await update_folder.ignored()


if __name__ == "__main__":
    run(main())

Issues: see the list in the github repo.

This library has nothing to do with Wrike LLC and made at my free time as experiment to try httpx and pydantic in action.

wrapi's People

Contributors

user-name-name avatar junqed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.