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

Uploaded Source

Built Distribution

flavius_api-1.12.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flavius-api-1.12.0.tar.gz
  • Upload date:
  • Size: 7.8 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.12.0.tar.gz
Algorithm Hash digest
SHA256 8438e5964e6305c42b1e46a6898eb810244162ed1c61d6c036509a6fa1cf2080
MD5 85166e80888e95b2136c2c70be2d657f
BLAKE2b-256 975a7199be924b05fe090a319161f5b76d46fc8cf947b5caca782bbdf5b84aba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flavius_api-1.12.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 575e587588a9257f239814b781154878195f209619b5cd205fb7c663842f6322
MD5 988d2ca0cbc3a170195ec4cb6dccc6c2
BLAKE2b-256 26dee0597dfa53a48a49180297dafc2f00b28d7f91e7b2d94c9f915797b84ac4

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