Giter Club home page Giter Club logo

tiqets_josven's Introduction

tiqets assignment

I opted for not using any frameworks, and solving the assignment by only using Python standard libs, since using something like Django would add a lot of overhead and it was not required in the assignment. But if this be an application I would use a framework and would probably do the following:

Django, have all batteries included. I could easily use the Django model framework to define the 3 models. Also, make use of the Django field and model validation to avoid bad data being ingested. Django's ORM makes it easy to create aggregations and annotations to retrieve top consumers and find unused bar codes.

To load in the data I would probably use something like a django-app like django-csvimport.

If I were to go the FastAPI route I would probably use the sqlmodel package that both leverages Pydantic and SQLAlchemy. Pydantic also has methods to validate fields and models.

Usage

Run with docker, in Dockerfile directory:

$ docker build -t tiq .

$ docker run -t tiq:latest

Or run with python 3.12 interpreter

$ python .tiqetsassignment.py

To run the tests and all checks with docker, in Dockerfile directory

$ docker run -t tiq:latest tox

To run the tests and all the checks with python 3.12 interpreter, in tox.ini directory

$ tox

Requirements

  • docker

or

  • python 3.12
  • tox

Schema

Simple schema on how this can be stored in a rel DB.

// Docs: https://dbml.dbdiagram.io/docs

Table Customers {
  id integer [primary key]
}

Table Orders {
  id integer [primary key]
  customer_id integer [ref: > Customers.id]
}

Table Tickets {
  id integer [primary key]
  ean varchar [unique, not null]
  order_id integer [ref: > Orders.id]
}

./schema.png

Licence

MIT

Authors

tiqets was written by Jonas Svensson.

tiqets_josven's People

Contributors

josven avatar

Watchers

 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.