Skip to main content

It is a package that allows you to manipulate LIFF(Line Frontend Framework) by Python.

Project description

liffpy

It is a package that allows you to manipulate LIFF(Line Frontend Framework) by Python.

Caution

■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■ This branch is for Alpha Version.
This package has little or no testing □■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□

How to use

Example

# -*- coding:utf-8 -*-
from liffpy import (
    LineFrontendFramework as LIFF,
    ErrorResponse
)


def main():
    liff_api = LIFF("YOUR_CHANNEL_ACCESS_TOKEN")

    try:
        # If you want to add LIFF app
        liff_id = liff_api.add(
            view_type="compact",
            view_url="https://{YOUR LIFF-SITE}")
            # 400 Error or 401 Error
        try:
            # If you want to update LIFF app
            liff_api.update(liff_id, 
            view_type="full",
            view_url="https://{YOUR LIFF-SITE}")
        except ErrorResponse as err:
            # 401 Error or 404 Error
            print(err.message)
            return 
    except ErrorResponse as err:
        # 401 Error or 404 Error
        print(err.message)
        return 

    try:
        # If you want to get all LIFF apps
        apps_info = liff_api.get()
        for app_info in apps_info:
            try:
                # If you want to delete LIFF app
                liff_api.delete(app_info["liffId"])
            except ErrorResponse as err:
                # 401 Error or 404 Error
                print(err.message)
                return 
    except ErrorResponse as err:
        # 401 Error or 404 Error
        print(err.message)
        return 

if __name__ == '__main__':
    main()

API

LineFrontendFramework

__init__(self, channel_access_token)

Create a new LineFrontendFramework instance.

liff_api = add(
            view_type="compact",
            view_url="https://{YOUR LIFF-SITE}")

add(self, view_type, view_url)

Adds an app to LIFF. You can add up to 30 LIFF apps on one channel.

liff_id = LineFrontendFramework('YOUR_CHANNEL_ACCESS_TOKEN')
view_type
name mean
"compact" 50% of the screen height of the device
"tall" 80% of the screen height of the device.
"full" 100% of the screen height of the device.

"Add LIFF app" in https://developers.line.me/ja/reference/liff/

update(self, liff_id, view_type, view_url)

Updates LIFF app settings.

liff_api.update(liff_id,
    view_type="full",
    view_url="https://{YOUR LIFF-SITE}")
view_type
name mean
"compact" 50% of the screen height of the device
"tall" 80% of the screen height of the device.
"full" 100% of the screen height of the device.

"Update LIFF app" in https://developers.line.me/ja/reference/liff/

get(self)

Gets information on all the LIFF apps registered in the channel.

liff_api.get()

"Get all LIFF apps" in https://developers.line.me/ja/reference/liff/

delete(self, liff_id)

Deletes a LIFF app.

liff_api.delete(liff_id)

"Delete LIFF app" in https://developers.line.me/ja/reference/liff/

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

liffpy-0.0.1a3.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

liffpy-0.0.1a3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file liffpy-0.0.1a3.tar.gz.

File metadata

  • Download URL: liffpy-0.0.1a3.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.12.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for liffpy-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 204ad8be39d297c8937fd7fe0bdad2feeee03cbb0528fa4136b78d1fab6bc6dc
MD5 0cc91b8855a209a1aa313482217f8fd7
BLAKE2b-256 4e0b84addeb87bf241d368d9c7c646e75e80de5ea0eaab56dffc954ce73431c1

See more details on using hashes here.

File details

Details for the file liffpy-0.0.1a3-py3-none-any.whl.

File metadata

  • Download URL: liffpy-0.0.1a3-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.12.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for liffpy-0.0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 ba2053eb9a3a6cea615f074abf925b1f9993755640fc406f2142c3abbcbc0db0
MD5 2cf48a3fe210c8289f10d1ef27080282
BLAKE2b-256 2fafaea4948f0c32edcd72561dd0cc9266299c134d783c819b7f5b172bc53b8d

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