Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Project for creating shipment drafts in Pack LInk Pro using the data stores in google sheets, from the project Kofi API

License

Notifications You must be signed in to change notification settings

darideveloper/pack-link-bot

Repository files navigation



Pack Link Bot

Pack Link Bot

Project for creating shipment drafts in Pack LInk Pro using the data stored in Google Sheets, from the project Kofi API

Project type: client


Table of Contents
  1. Build With
  2. Related Projects
  3. Media
  4. Details
  5. Install
  6. Settings
  7. Run

Build with

Related projects

Media

address data content type

address data recipient

choose a service

custom items

custom sender details

shipment details

Details

For use this project, you should have a Kofi API service working, and saving data in a google sheets. You also need a Kofi account (the same as the Kofi API) already logged in your google chrome, and a Pack Link Pro account already logged too.

Workflow

The project will:

  1. Get main data from the google sheet.
  2. Extract the shipping data from kofi details page
  3. Go to Pack Link Pro Create page
  4. In the Shipment details page, it will fill the:
    • Country
    • Zip code
    • Weight (if required)
    • Length (if required)
    • Width (if required)
    • Height (if required)
  5. In the Choose a service page, it will select the first option
  6. In the Address data page, it will:
    • fill the address data with the client user info
    • Select the content type
    • Set a value (calculated as: product value from google sheet, minus shipment price)
    • Select the "Shipment protection" or "I am willing to risk my shipments", based in your settings (more about settings details in the following sections)
  7. In the Customs page (if is active), it will fill the following data from settings:
    • Invoice number
    • Category
    • Description
    • Items made in
    • Quantity
    • Value (the same as above)
    • Weight
  8. Save the draft

Install

Programs

To run the project, the following software must be installed::

Third party modules

Install all the python modules from pip:

$ pip install -r requirements.txt

Settings

Enviroment variables

In this file (.env), are the main options and settings of the project.

  1. Create a .env file, and place the following content
CHROME_FOLDER = C:Users{your-user}AppDataLocalGoogleChromeUser Data
GOOGLE_SHEETS=https://docs.google.com/spreadsheets/d/{some random chars}/edit?pli=1#gid=0
PARCEL_WEIGTH = 1
PARCEL_LENGTH = 10
PARCEL_WIDTH = 10
PARCEL_HEIGHT = 10
CONTENT_SHIPPED = Electronics
RISK_SHIPMENT = True
CUSTOM_CATEGORY = videogames
CUSTOM_DETAILS = Sample text here
CUSTOM_MADE_IN = México
CUSTOM_QUANTITY = 1
CUSTOM_WEIGHT = 1

Note: you can see as reference the sample.env file

CHROME_FOLDER

Path of your google chrome data By default, in windows C:Users{your-user}AppDataLocalGoogleChromeUser Data

GOOGLE_SHEETS

The link of the google sheet where data will be saved, with edit permissions Details about structure and content, in the project Kofi API

PARCEL_*

PARCEL_WEIGTH, PARCEL_LENGTH, PARCEL_WIDTH and PARCEL_HEIGHT

These are the values to set in the section Parcels from the Shipment details page

shipment parcels

CONTENT_SHIPPED

The content in the section Content shipped from the page Address data

address data content type-content

RISK_SHIPMENT

True for select the I am willing to risk my shipments option, else (for add a protection) save as False

CUSTOM_*

CUSTOM_CATEGORY, CUSTOM_MADE_IN, CUSTOM_QUANTITY, CUSTOM_WEIGHT

Data to write in the items section from the page Customs

*Note: if there are categories with similar names, CUSTOM_CATEGORY can be only a word of the category name (if you write this word manually, the first displayed option should be the correct one).

custom

Counters

In the file counters.json, there is the options invoice_number. This is a counter of the orders created and it will be saved in the Customs page. You can edit it.

{
    "invoice_number": 333
}

Note: you can see as reference the sample.counters.json file

Google Sheets credentials

You should create a credentials file from your Google Console, with the same account owner of the Google Sheets file, to allow connect to it.

  1. Generate if following this tutorial.
  2. Download the json file.
  3. Place in the project folder as credentials.json

Run

For run the bot, just run with your python interpreter the __main__.py file or the project folder

$ python .
$ python __main__.py

About

Project for creating shipment drafts in Pack LInk Pro using the data stores in google sheets, from the project Kofi API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages