Skip to content

Zappa refactor#10

Open
kiat-huang wants to merge 7 commits into
masterfrom
zappa-refactor
Open

Zappa refactor#10
kiat-huang wants to merge 7 commits into
masterfrom
zappa-refactor

Conversation

@kiat-huang

@kiat-huang kiat-huang commented Sep 29, 2020

Copy link
Copy Markdown
Contributor

Rewrote the converter to handle UUID deal conversion to PBN, RBN, LIN, and Human (readable) formats. Refactored the two files (local py and api py) into one file, with Flask integration and deployment by Zappa.
Simplified the number of files but my code does not handle the upload of a PBN file, just parsing UUID, so it's not a direct replacement of the original deployment. I'd like to add the reverse conversion from these formats to UUID, so that with at most two API calls, conversion can occur between any pair of formats via UUID.

  • dealConverter.py (app)
  • zappa_settings.json (config)
  • requirements.txt (pip3 install -r )
  • README.md

@tameware

tameware commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

This pull confuses me. With files coming and going, I can't figure out what's going on. Part of it may be my unfamiliarity with GitHub. I'm also unfamiliar with this codebase! Can you tell me more?

If you're confident this is an improvement, I have no objections to merging.

@kiat-huang

kiat-huang commented Oct 7, 2020 via email

Copy link
Copy Markdown
Contributor Author

@kiat-huang

Copy link
Copy Markdown
Contributor Author

This pull confuses me. With files coming and going, I can't figure out what's going on. Part of it may be my unfamiliarity with GitHub. I'm also unfamiliar with this codebase! Can you tell me more?

Sure, this folder and code are new and does not replace the original files in the main dir which stand unchanged.

  • dealConverter.py (app) - rewrite, just converts deals encoded in UUID to any of PBN, RBN, LIN, human, formats.
    I used the algorithm described by Richard Pavlicek and converted it to code.

  • zappa_settings.json (config) - a config for Zappa which is an orchestration tool that works with AWS

  • requirements.txt (pip3 install -r )

  • README.md

This code is intended to run as a Cloud function and indeed works. It can be tested with the following command or similar.

Input from the shell
curl --header "Content-Type: application/json" --request POST --data '{"output":"human","uuid":"0x63b40b7f2842298cb3bea48"}' https://converter.aws.globalbridge.app/api

Output

{"body":
{"E":"Q982.KQ96.87.984","N":"AKT65.AT3.KT6.62","S":"3.85.AQJ432.AT53","W":"J74.J742.95.KQJ7"},"statusCode":200}

@tameware

tameware commented Oct 13, 2020 via email

Copy link
Copy Markdown
Contributor

@kiat-huang

kiat-huang commented Oct 14, 2020 via email

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants