Giter Site home page Giter Site logo

essex-m1a1p2's Introduction

Sup 🀘 πŸ¦†

Nice to meet you!Β πŸ‘‹ Β  My name's Trevor. I am a systems administrator in my day job, and I enjoy coding in my free time.

Some of that includes:

Projects

Interesting Stuff

You should check out:


PC

Case: Fractal Meshify 2 Lite RGB

PSU: Asus ROG Thor 850

GPU: MSI Gaming X Trio RTX 3080

CPU: AMD Ryzen 9 5900X

Board: MSI MAG X570S Tomahawk

RAM: G.SKILL TridentZ 32GB

Cooler: Noctua NH-D15S

Storage: Various (WD_BLACK M.2s, Barracuda 2TB, WD 8TB)

essex-m1a1p2's People

Contributors

turbits avatar

Watchers

 avatar

essex-m1a1p2's Issues

Rewrite main

should handle user input and calling operations;
helper functions for different operations menus

Rewrite sort

  • arg: property (uid, datetime, description, credit, debit, balance), order (inc, dec, none)
  • return list
  • if none, read_tx("*") (print all tx as-is)
  • check prop and order are valid (if prop not in [], order (same)
  • set private var _order to True (descending) or False (ascending)
  • sort io.database by prop/order:
  # sort data by prop/order
  _sorted_data = sorted(_original_data, key=lambda p: p[str(_prop)], reverse=_reverse)
  • return list of sorted tx

Rewrite delete

  • arg: uid, force=False
  • returns: Bool
  • find existing tx by uid; none found -> print err -> return False
  • force=True? bypass confirmation and goto yes
  • confirm delete yes/no

Yes:

  • remove tx from db list (auto reindexes with list.remove())
  • recalculate balances on db list (utility function)
  • overwrite db.json with db list (io. func); fail -> print err -> return False
  • successful delete: return True

No:

  • return False

Rewrite create

  • arg: tx_obj

  • returns: Bool

  • generate and set uid; unix timestamp (truncated to remove milliseconds that python adds for some reason????) + 6 random hex chars

  • generate and set datetime; unix timestamp (similarly truncated)

  • generate description if none given (sets to "credit" or "debit")

  • calculate balance; gets db length, if none set to debit/credit value. if zero and debit, negative balance :^(

  • validate tx; fail -> print err -> return False

  • append tx to db list

  • overwrite db.json; fail -> remove tx from db list -> print err -> return False

  • create success -> return True

Rewrite read

  • arg: prop, value (should satisfy keyword/string assignment requirement??)
  • returns: dictionary list or None
  • for loop, find existing txs by prop & value; none found -> print err -> return None
    • append each tx found to list
  • found -> return list

Rewrite update

  • arg: uid, tx_obj
  • returns: Bool
  • find existing tx by uid (verify it exists); none found -> print err -> return False
  • validate new tx_obj; invalid -> print err -> return False
  • copy db list to temp list
  • overwrite existing tx_obj in temp list
  • recalculate balances on temp list
  • overwrite db.json with temp db list (list -> json)
  • successful update: return True

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.