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.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: flavius-api-1.16.1.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.1.tar.gz
Algorithm Hash digest
SHA256 cab5e1a0140d89448db0c8c697aa4edd49628e646fbbc24986bd73f4804f58b1
MD5 44e0b42902dd2044460cf9aade796609
BLAKE2b-256 5d8e064b918e82cef371ef64186b6eae249c9658b53127b66d1450924f8f3091

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flavius_api-1.16.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1739c5fca5d18578a199f2b6115d78dbe3fd678ba7cac8cb3a8742771bd5d873
MD5 81ca688b6cb3b5787f9d480967dfd924
BLAKE2b-256 9698804b1f4d455f11e31f3667c4d8f52a029c1a8c0fcfab5b9afe7c0d34ac6f

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