Skip to main content

A package to generate arithmetic expression

Project description

pyarithmeticlib

A package to generate arithmetic expression

Installation

$ pip install pyarithmeticlib

Usage

pyarithmeticlib can be used to generate arithmetic expressions as follows:

from pyarithmeticlib.expression import Addition, Multiplication
from pyarithmeticlib.generator import ExpressionGenerator

generator = ExpressionGenerator(
    max_depth=2, min_length=2, max_length=4, min_value=1,
    max_value=10, min_n_operands=1, max_n_operands=3,
    allowed_operations={Addition, Multiplication}, seed=42
)

for expr in generator.yield_expressions(5):
    print(expr)

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

pyarithmeticlib was created by amaurylekens. It is licensed under the terms of the MIT license.

Credits

pyarithmeticlib was created with cookiecutter and the py-pkgs-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyarithmeticlib-0.1.0.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

pyarithmeticlib-0.1.0-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page