Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Roman Numerals Converter

This is a python based Roman Numerals converter. Given a Roman Numeral string (XIV) as a parameter, the converter will return the integer value. It can be run from a command line or deployed to AWS as a Lambda backed REST API.

Here are some of the main features:

  • Roman Numeral format validation with tips on why it is wrong

Getting Started

git clone https://github.com/thehammeranderson/python-numerals-lambda.git

See deployment for notes on how to deploy the project on a live system.

Prerequisites to build and run

Running the tests

If your environment is properly setup with Python, you can open up a shell/console/terminal window. Change directory to the python-numerals-lambda folder. If you are in the right folder, you will see a test.py file. Now you can type the following from the command line and press to run the Unit Tests:

python3 test_main.py

Optionally you may use pytest for better test output, run:

pip3 install -U pytest
pytest

Running the app from the command line

python3 lambda-handler.py <roman numeral>

Break down of tests

Unit tests are in test.py. Listed below are more details on the tests performed.

  • TestValidation.test_invalid_numeral
    • test that invalid numeral characters are caught in the validation function
  • TestValidation.test_invalid_sequence
    • test that invalid sequences of valid numeral characters are caught in the validation function
  • TestValidation.test_single_numeral
    • test that the single character numerals return the proper value
  • TestValidation.test_subtraction
    • test numeral subtraction scenarios
  • TestValidation.test_addition
    • test numeral addition scenario

Deployment

Prerequisites for deploying as a Lambda backed REST API to AWS:

Built With

  • NPM - Dependency Management
  • AWS CDK - Used if deploying as a Lambda REST service

Future improvements

About

roman numerals converter written in Python using AWS lambda and CDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages