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

Uploaded Source

Built Distribution

flavius_api-1.15.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flavius-api-1.15.1.tar.gz
  • Upload date:
  • Size: 8.0 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.15.1.tar.gz
Algorithm Hash digest
SHA256 5d7972c59dcca2921eb69b0850035508d5c0cd319237f361edb3fb09ee9dd8e5
MD5 6b71ee7bcc06599e17137af7883f1759
BLAKE2b-256 29504a34a965c7d6607abd4d9978fea785a0e7da522b514384024dde6418b62c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flavius_api-1.15.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 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.15.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68f62e970542d0acde33abf59506f23952559f8a4db5e43960d254072285eabc
MD5 69d0f11a75d965202b446648ad1214b6
BLAKE2b-256 88898c92d1e02991badd7e3a026b9357fb59e1e44ff91bdd50f2bf5ba1e99b05

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