Package: python-wekan
python-wekanThis is a python client for interacting with theWeKan®REST-API.
Each WeKan object is represented by a corresponding python object.For further details about theWeKan® APIconsider the official documentation.Installationpipinstallpython-wekanhow to useSet the credentialsexportWEKAN_USERNAME="USERNAME"exportWEKAN_PASSWORD="PASSWORD"Use the moduleimportosfromwekanimportWekanClientif__name__=='__main__':wekan=WekanClient(base_url='https://your_wekan_instance.com',username=os.getenv('WEKAN_USERNAME'),password=os.getenv('WEKAN_PASSWORD'))boards=wekan.list_boards()forboardinboards:print(board.title)Dependencies between the wekan python objectsThere are dependencies between objects.This visualisation shows the dependencies between different objects.graph TD;
      WekanClient-->Board;
      WekanClient-->User;
      Board-->List;
      Board-->Swimlane;
      Swimlane-->Card;
      Board-->Integration;
      Board-->CustomField;
      Board-->Label;
      List-->Card;
      Card-->CardComment;
      Card-->CardChecklist;
      CardChecklist-->CardChecklistItem;Example:
If you want to fetch the cards within a list, you need to get the board and the list object first.ExamplesAdd a new boardimportosfromwekanimportWekanClientwekan=WekanClient(base_url='https://your_wekan_instance.com',username=os.getenv('WEKAN_USERNAME'),password=os.getenv('WEKAN_PASSWORD'))new_board=wekan.add_board(title="My new Board",color="midnight",is_admin=True,is_no_comments=False,is_comment_only=False)print(new_board.created_at)Create a new listimportosfromwekanimportWekanClientwekan=WekanClient(base_url='https://your_wekan_instance.com',username=os.getenv('WEKAN_USERNAME'),password=os.getenv('WEKAN_PASSWORD'))board=wekan.list_boards(regex_filter='My new Board')[0]board.add_list(title="My first list")board.add_list(title="My second list")Create a new cardimportosfromwekanimportWekanClientwekan=WekanClient(base_url='https://your_wekan_instance.com',username=os.getenv('WEKAN_USERNAME'),password=os.getenv('WEKAN_PASSWORD'))board=wekan.list_boards(regex_filter='My new Board')[0]wekan_list=board.list_lists(regex_filter="My first list")[0]swimlane=board.list_swimlanes()[0]wekan_list.add_card(title="My first card",swimlane=swimlane,description="My first description")Move card between listsimportosfromwekanimportWekanClientwekan=WekanClient(base_url='https://your_wekan_instance.com',username=os.getenv('WEKAN_USERNAME'),password=os.getenv('WEKAN_PASSWORD'))board=wekan.list_boards(regex_filter='My new Board')[0]src_list=board.list_lists(regex_filter="My first list")[0]dst_list=board.list_lists(regex_filter="My second list")[0]card=src_list.list_cards(regex_filter="My first card")[0]card.edit(new_list=dst_list)Create a new swimlaneimportosfromwekanimportWekanClientwekan=WekanClient(base_url='https://your_wekan_instance.com',username=os.getenv('WEKAN_USERNAME'),password=os.getenv('WEKAN_PASSWORD'))board=wekan.list_boards(regex_filter='My new Board')[0]board.add_swimlane(title="My first swimlane")DevelopmentGenerate requirementspipenvrequirements>requirements.txt
pipenvrequirements--dev-only>requirements_dev.txtcreditsThis project is based onpy-trello.
Some methods and design structures have been adopted 1:1.