Skip to content
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.

Latest commit

 

History

History
137 lines (101 loc) · 3.96 KB

README.md

File metadata and controls

137 lines (101 loc) · 3.96 KB

q-lako

On push CodeQL codecov

logo

q-lako is a service to quickly register equipments and books. q-lako is a web app that helps you to manage books and supplies purchased on Amazon.

Retrievable information

Get the following information on purchased books and supplies to help you register supplies.

  • Product Title
  • ASIN Code
  • Image (url)
  • URL
  • Manufacturer
  • Contributors
  • Publication Date
  • Product Group
  • Registrants Name
  • Default Positions
  • Current Positions
  • Note
  • Features

Requirements

How to

Enter Python Virtual Environment

python3 -m venv venv
source venv/bin/activate
export ARCHFLAGS="-arch x86_64"
pip install --upgrade pip
pip install --upgrade --use-feature=2020-resolver -r requirements.txt

The reason why ARCHFLAGS needs to be specified is due to Apple's bugs in Xcode12. It is recommended to explicitly specify the resolver options until pip version 20.3.

Prepare .env and .env.gpg

Write the API Key to .env and encrypt it. Keep your passphrase in a secure location like YubiKey.

  1. Prepare .env

    airtable_base_id="airtable_base_id"
    airtable_api_key="airtable_api_key"
    amazon_partner_tag="amazon_partner_tag"
    amazon_access_key="amazon_access_key"
    amazon_secret_key="amazon_secret_key"
  2. Encrypt .env to create .env.gpg

    gpg --symmetric --cipher-algo AES256 .env

  3. Use your passphrase to decrypt .env.gpg .

    gpg --quiet --batch --decrypt --output=.env .env.gpg

Prepare settings.ini

[THEME-COLOR]
theme_color_blue=#4caaba
theme_color_gray=#393e46

[AIRTABLE]
airtable_table_name=q-lako

[ASSET-PROPERTY]
positions=sforzando Kawasaki,shin house,tomoya house,yusuke house
registrants=shin-sforzando,tomoya-sforzando,yusuke-sforzando

Run

python main.py

If you start it locally, it will start in Debug mode.

  1. Access to http://0.0.0.0:8888/
  2. Enter keywords or ISBN/ASIN code in the search window and press the search button
  3. Displays a list of items related to the keywords you have entered
  4. Select any item from the list of items and press the Select button
  5. The item's details are displayed
  6. Edit the contents of the item's details form
  7. Press the Register button and you will be registered with Airtable

Lint

flake8 *.py

Test

pytest . -vv --ignore-glob="venv/**/*" --durations=0

Misc

Contributor