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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pyarithmeticlib-0.1.0.tar.gz.

File metadata

  • Download URL: pyarithmeticlib-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Darwin/21.3.0

File hashes

Hashes for pyarithmeticlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 78930a3a910b88a5dc1a7cab7ff8cc7b053728cdad38fd5c452df2a49717dce6
MD5 5cfc5aa8cd4df1fd3e513588a465cc76
BLAKE2b-256 1b72a7708cd4c3cc1a7a8e54fdb5d1dec9b95c3032ecdc6fdc0fb3b4927a0767

See more details on using hashes here.

File details

Details for the file pyarithmeticlib-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyarithmeticlib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Darwin/21.3.0

File hashes

Hashes for pyarithmeticlib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 125fde6433f98850b5d43dd16fa2245128d0ee1cc47b96463c60add3ee72bca6
MD5 3807ed37c0aff9aab956b3fbb866eb14
BLAKE2b-256 dfa7e59f4305dc832eb7ea06c3f38fb56462dd8349dbee8d96d18a7d3dc71657

See more details on using hashes here.

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