mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
added makePdf function, documentation, new version
This commit is contained in:
@@ -25,6 +25,13 @@ problem, solution = mathgen.addition()
|
||||
#another way to generate an addition problem using genById()
|
||||
problem, solution = mathgen.genById(0)
|
||||
```
|
||||
## Documentation
|
||||
`getGenList()` returns a list of all generators in the repository in the format `[id, title, self, funcname]`
|
||||
|
||||
`genById(id)` generates a problem, solution set with generator id `id` in the form of a list in the format `[problem, solution]`
|
||||
|
||||
`makePdf(id, count)` creates a printable pdf worksheet with `count` problems generated by the generator with id `id`.
|
||||
|
||||
|
||||
## List of Generators
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from .funcs import *
|
||||
from .__init__ import getGenList
|
||||
from worksheetgen.wg import Worksheet
|
||||
|
||||
genList = getGenList()
|
||||
|
||||
@@ -8,3 +9,11 @@ genList = getGenList()
|
||||
def genById(id):
|
||||
generator = genList[id][2]
|
||||
return (generator())
|
||||
|
||||
def makePdf(id, count):
|
||||
generator = genList[id][2]
|
||||
title = genList[id][1]
|
||||
ws = Worksheet(title=title)
|
||||
for i in range(count):
|
||||
ws.add_problem(generator()[0])
|
||||
ws.write_pdf()
|
||||
|
||||
4
setup.py
4
setup.py
@@ -1,12 +1,12 @@
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
setup(name='mathgenerator',
|
||||
version='1.1.5',
|
||||
version='1.1.6',
|
||||
description='An open source solution for generating math problems',
|
||||
url='https://github.com/lukew3/mathgenerator',
|
||||
author='Luke Weiler',
|
||||
author_email='lukew25073@gmail.com',
|
||||
license='MIT',
|
||||
packages=find_packages(),
|
||||
install_requires=['sympy', 'numpy', 'scipy'],
|
||||
install_requires=['sympy', 'numpy', 'scipy', 'worksheetgen'],
|
||||
entry_points={})
|
||||
|
||||
Reference in New Issue
Block a user