GithubHelp home page GithubHelp logo

ajankuv / qwiklabel Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 83 KB

python address parser/formatter for vipparcel.com labels

Python 32.10% HTML 67.90%
pyhton mercari parser microservice shipping usaddress docker labels

qwiklabel's Introduction

qwiklabel v1 for vipparcel


Uses datamade.us's usaddress lib to parse and format single line USA addresses into a printable label format for shipping.

My wife and I run a online store, and one of our good channels for sales is Mercari. She normally pastes me one line addresses from the app into skype. I have emailed them over and over to have some sort of web based backend for sellers/labels since one line addresses are horrid.

The only things that need to be set are following below.

vipkey="xxxxx"
sfname="xxxxx"
slname="xxxxx"
scompany="xxxxx"
saddress="xxxxx"
scity="xxxxx"
sstate="xxxxx"
spostcode="xxxxx"

These are your sending from details. You need to change these to match where you are sending from. sfname=firstname slname=lastname and so on.

By default the api url is set to dev, so you don't go spending money on shit postage while testing. Flip these once you feel its ready.

#dev
lurl="https://vipparcel.com/api-test/v1/shipping/label/print"
#prod lurl="https://vipparcel.com/api/v1/shipping/label/print"

required pip installs = flask, usaddress, requests

There are a few bugs with the usaddress lib, I have contacted them about it for longer addresses and back country roads.

Shout out to @rogerallen on github for providing the dictionary file for states abbreviations https://gist.github.com/rogerallen/1583593

Also to datamade for their badass lib for formatting https://parserator.datamade.us/usaddress

alt text

Will convert address from "joe shmoe 1231 turtle rd. Miami Florida 33492" to

Joe Shmoe
1231 turtle rd.
Miami Florida 33492

For shipping label printing.


Running the software

You can run this anyway you wish, I was running this just as "python server.py" off my mac for awhile just to ship fast. I ended up dockerizing it after finding the need to have it run 24/7.

By default it runs on port 5611

I prefer to run it via docker on my vm server. Here is how below..

docker build --no-cache -t qwiklabel . && docker run --name qwiklabel -p 5611:5611 qwiklabel

qwiklabel's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.