Git Product home page Git Product logo

dicetables_db's Introduction

a project to make a big database of dicetables later to be used with a server

If you don't know what a dicetable is, see the README at dice-tables.

frontend.py currently broken. Highest level is insertandretrieve.py. here's the API.

python
import dicetables as dt
from dicetables_db.connections.sql_connection import SQLConnection
from dicetables_db.insertandretrieve import DiceTableInsertionAndRetrieval

connection = SQLConnection(':memory:', 'a_table_name')

in_out = DiceTableInsertionAndRetrieval(connection)

table = dt.DiceTable.new().add_die(dt.Die(6), 1000)

in_out.add_table(table)

in_out.find_nearest_table([(dt.Die(6), 999)]) # returns None

doc_id = in_out.find_nearest_table([(dt.Die(6), 1000)]) # returns id of table

in_out.get_table(doc_id) # returns copy of 'table' from serialized data

current plan

since all Die reprs are unique, make a repr parser. search db using strings. When a table is requested:

  • Parse the string to a list of [(Die, number), ...]
  • Retrieve the nearest table from db
  • Figure out difference to achieve target table
  • Do adds of set size size until target table is reached
  • Inserting each intermediate table into db for future use as you go
  • Return requested table
  • Lather, rinse, repeat

dicetables_db's People

Contributors

eric-s-s avatar

Watchers

James Cloos 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.