GithubHelp home page GithubHelp logo

leankit's Introduction

leankit

NPM info Codacy Badge Codacy Badge

Python 3.x wrapper for Leankit's API v1.0

Installation

$ pip install leankit

Usage

First you need to authenticate the client by providing your leankit domain, username and password.

>>> import leankit
>>> leankit.api.authenticate('domain', '[email protected]', 'passw0rd')

You can skip this step by setting the environment variables LEANKIT_DOMAIN, LEANKIT_USERNAME and LEANKIT_PASSWORD respectively. Alternatively, credentials can be stored in plain text within your ~/.config folder with the following command:

$ python -m leankit.config

The configuration file has preference over the environment variables.

To download a board, simply instantiate the leankit.Board class with the board id as only parameter.

>>> board = leankit.Board(123456789)

The different board elements will be arranged in dictionaries and made available as attributes of the board object. Kanban elements can be treated both as dictionaries and as objects with snake case attributes. Dates are converted to native objects automatically for convenience.

>>> card = board.cards[987654321]
>>> card['DateArchived']
datetime.date(2017, 5, 23)
>>> card.date_archived
datetime.date(2017, 5, 23)
>>> card.assigned_user.email_address
user@example.org

The history of each card is downloaded and cached when the history attribute is accessed for the first time.

To access the data as received from the API, use the raw_data attribute.

>>> board.card_types[123123123].raw_data
{'ColorHex': '#d3e0e4',
 'IconColor': None,
 'IconName': None,
 'IconPath': None,
 'Id': 123123123,
 'IsCardType': True,
 'IsDefault': False,
 'IsDefaultTaskType': False,
 'IsTaskType': True,
 'Name': 'Improvement'}

Testing

Additionally to unit tests, there are some integration tests to ensure that the data received from Leankit's API is correct and have the expected format. Integration tests may take a while to complete, depending on the size of the board tested, so they are deactivated by default.

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

leankit's People

Contributors

funk66 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

alexdelifer

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.