Skip to main content

FlaviusへAPI接続するためのパッケージ

Project description

Flavius API

FlaviusへAPI接続するためのパッケージ

インストール

pip install flavius-api

動作環境

  • Python3.6以上

パケージの基本動作

FlaviusのAPIに対してPOSTメソッドにて通信を行います。

実装方法

from flavius_api.api import FlaviusDto, FlaviusItem, FlaviusEnvironment, FlaviusPage


FlaviusDto.endpoint = endpoint
FlaviusDto.endpoint_dev = endpoint
flavius_dto = FlaviusDto()

query = {
    'target': 'page',
    'order[sort]': 'ASC',
    'filter_field[]': [],
    'filter_value[]': [],
}
query['filter_field[]'].append('parent')
query['filter_value[]'].append(env['value'])

items = flavius_dto.search(query)

endpointendpoint_devについて


DjangoDEBUGの値を参照し、どちらのURLを実行するか判断しています。

  • DEBUG = Trueendpoint_dev
  • DEBUG = Falseendpoint

Djangosettings.pyで接続先のURLを指定することもできます。

設定項目
FLAVIUS_ENDPOINT 本番環境URL
FLAVIUS_ENDPOINT_DEV 開発環境URL

設定するFlaviusのURLについて

URLを設定する場合、ipos/までを含んだ文字列を設定します。

ex: http://sample.flavius2008.com/ipos/

API一覧

現在利用可能なAPIは下記の通り

class名 対象データ create edit delete search 備考
FlaviusBackData backdata × × ×
FlaviusDto × × × パラメータにテーブル名を設定することで
Flaviusの任意のテーブルからデータを取得できます。
FlaviusDtoFetch × × × パラメータにテーブル名を設定することで
Flaviusの任意のテーブルからデータを1件取得できます。
FlaviusItem item ×
FlaviusEnvironment environment ×
FlaviusSort sort × × ×
FlaviusHeader header ×
FlaviusData data ×
FlaviusPage page × × ×
FlaviusOrderDecide - × × × オーダー送信用のAPI
FlaviusCreditAdd data × × × クレジット支払用の明細追加API
FlaviusPaymentComplete - × × × 売上伝票完了API
FlaviusPickupLocation pickup_location
FlaviusPickupTime pickup_time
FlaviusHeaderExtPickup header_ext_pickup
FlaviusPickupLocationFileUpload pickup_location × × × 画像ファイルアップロード用API
FlaviusPrintPackingLabel spool × × × ラベルプリンタ印刷用API
FlaviusHeaderSearch header × × ×

各クラスとFlaviusのPHPファイルとの対応表

APIへ設定するパラメータや戻り値の詳細についてはFlaviusのWiki を参照のこと。

class名 メソッド 対応URL
FlaviusBackData search api/backdata_search.php
FlaviusDto search api/dto_list.php
FlaviusDtoFetch search api/dto_fetch.php
FlaviusItem create api/item_create.php
FlaviusItem edit api/item_edit.php
FlaviusItem search api/item_search.php
FlaviusEnvironment create api/environment_set_value.php
FlaviusEnvironment edit api/environment_set_value.php
FlaviusEnvironment search api/environment_fetch.php
FlaviusSort search api/sort_fetch_list.php
FlaviusHeader create api/header_create.php
FlaviusHeader edit api/header_modify.php
FlaviusHeader search api/header_fetch.php
FlaviusData create api/data_add.php
FlaviusData edit api/data_modify.php
FlaviusData delete api/data_delete.php
FlaviusPage search api/pages.php
FlaviusOrderDecide edit api/order_decide.php
FlaviusCreditAdd create api/credit_add.php
FlaviusPaymentComplete edit api/payment_complete.php
FlaviusPickupLocation create api/pickup_location_regist.php
FlaviusPickupLocation edit api/pickup_location_regist.php
FlaviusPickupLocation delete api/pickup_location_delete.php
FlaviusPickupLocation search api/pickup_location_list.php
FlaviusPickupTime create api/pickup_time_regist.php
FlaviusPickupTime edit api/pickup_time_regist.php
FlaviusPickupTime delete api/pickup_time_delete.php
FlaviusPickupTime search api/pickup_time_list.php
FlaviusHeaderExtPickup create api/header_ext_pickup_regist.php
FlaviusHeaderExtPickup edit api/header_ext_pickup_regist.php
FlaviusHeaderExtPickup delete api/header_ext_pickup_delete.php
FlaviusHeaderExtPickup search api/header_ext_pickup_list.php
FlaviusPickupLocationFileUpload create api/pickup_location_upload_location_image.php
FlaviusPrintPackingLabel create api/print_packing_label.php
FlaviusHeaderSearch search api/header_search.php

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

flavius-api-1.16.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

flavius_api-1.16.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file flavius-api-1.16.0.tar.gz.

File metadata

  • Download URL: flavius-api-1.16.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for flavius-api-1.16.0.tar.gz
Algorithm Hash digest
SHA256 5054d836ec73654cea7cc9b2bec7f76719c4e5dbad44e6e09274710c726c61da
MD5 d796fb3c513acf6588e457c8146dd20e
BLAKE2b-256 999d7fc810cef0932c81b1917cd9f6483292862297e1942c83a3d992dd5a1825

See more details on using hashes here.

File details

Details for the file flavius_api-1.16.0-py3-none-any.whl.

File metadata

  • Download URL: flavius_api-1.16.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for flavius_api-1.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ea8ced359a5ae10af142b4aaa318ebad6a321f2bbd635250c9dc0b6e72cc20b
MD5 5672208253aa99a278ad8a5d69160254
BLAKE2b-256 bff2edd6da9a788265182125b8a0f9fce817bb61a98df033fc8a118a8212db68

See more details on using hashes here.

Supported by

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