Skip to main content

A Python interface for Plankanban

Project description

plankapy

A Python API for Planka

PyPI - License

PyPI - Version PyPI - Downloads GitHub last commit

Release Docs

Installation

pip install plankapy

Documentation

The full documentation can be found here.

All Interfaces are documented in the API section.

Features

No Keys Required

Planka models have all been implemented as Python objects. This means that you can access all the properties of a resource as if it were a Python object:

>>> project.name
'Project 1'

>>> project.managers
[User(id=1, username='username', ...), User(id=2, username='username2', ...), ...]

Disambiguation of resource attributes and methods

All models have type hints for every property and attribute, meaning you don't have to guess what a method or property will return. When using a modern IDE, this allows for extensive code completion and prevents you from having to remember what every property and method returns.

Synced by Default

All included resources are accessible through object properties that send out a request to the server when accessed. This means that you can access up to date information about a resource without having to manually refresh it.

>>> list1 = board.lists[0]
>>> list2 = board.lists[1]

>>> list1.cards
[Card(id=1, name='Card 1', ...), Card(id=2, name='Card 2', ...)]

>>> list2.cards
[]

>>> list1.cards[0].move(list2)

>>> list1.cards
[Card(id=2, name='Card 2', ...)]

>>> list2.cards
[Card(id=1, name='Card 1', ...)]

Edit with Context

Because all stored objects maintain the attributes assigned to them on their creation, direct attribute editing is not synced with the server resource. To mitigate this a .editor() context manager is provided that refreshes the resource on entry and updates the resource on exit.

Direct editing of attributes fails to update the resource

>>> c1 = list1.cards[0]
>>> c1.name = "New Name"
>>> c1.name
'New Name'

# Get the resource again to see that the name has not changed
>>> c2 = list1.cards[0]
>>> c2.name
'Card 1'

Context editing updates the resource after exiting the context

>>> c1 = list1.cards[0]
>>> with c1.editor():
...     c1.name = "New Name"

>>> c1.name
'New Name'

# Get the resource again to see that the name has changed
>>> c2 = list1.cards[0]

>>> c2.name
'New Name'

Usage

Getting started with plankapy is as simple as creating a Planka object and passing it your authentication method. From there, you can access all the resources available to your logged in user account.

>>> from plankapy import Planka, PasswordAuth

>>> planka = Planka("https://planka.example.com", PasswordAuth("username", "password"))

>>> planka.me
User(id=1, username='username', ...)

>>> planka.projects
[Project(id=1, name='Project 1', ...), Project(id=2, name='Project 2', ...), ...]

License

This project is licensed under the GPLv3 License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plankapy-2.2.0.tar.gz (45.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plankapy-2.2.0-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file plankapy-2.2.0.tar.gz.

File metadata

  • Download URL: plankapy-2.2.0.tar.gz
  • Upload date:
  • Size: 45.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for plankapy-2.2.0.tar.gz
Algorithm Hash digest
SHA256 dd29e15fe4f332ebe7ca43ad2f3b6077a2498d5a6d4956fe531a82c30a33fd77
MD5 221b4b25e4f33ee2e5431d04a22f4094
BLAKE2b-256 78494634e7d927a6ebbd5bcc20c5c5b1a536734e46e7ff488f1856d0d75c165a

See more details on using hashes here.

File details

Details for the file plankapy-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: plankapy-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for plankapy-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d0780703362274244f00f8e54095c84bec0341937972c53bdaa0f2e7b821932
MD5 c661ef99f2ce0953fc27499aa3485f2c
BLAKE2b-256 c9b3cbb4b7c95820b5378b40152c6d459e967293dde89d4e489ef35947b73c90

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page