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

各クラスと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

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

Uploaded Source

Built Distribution

flavius_api-1.11.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flavius-api-1.11.0.tar.gz
  • Upload date:
  • Size: 7.6 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.11.0.tar.gz
Algorithm Hash digest
SHA256 b78ed56553f73913320bfb1b7cc5ddf057891a9f5d44e3a54b03ab4a34e4a91e
MD5 2f43c0a540243dcd2f5659d066620d6d
BLAKE2b-256 8fb16ebfee20bff3c81762a646bfcfb6f822a421171db0021955784f1539c613

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flavius_api-1.11.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae3b40d3311d5951dc4d6f7d54a180305818bf7f8bf8d38a694488c9ad98ec18
MD5 a648c5cf5a4928273588a5741c388f1b
BLAKE2b-256 e3064129d49d6118eaa1169b48936b69dfc98c35caec3f28ac74641a86c7c2b4

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