GithubHelp home page GithubHelp logo

pawlovskiii / parser-formatted-string-binding-for-cpe-2.3 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 39 KB

The task is about writing your parser Formatted String Binding for CPE 2.3. The key thing about the project is the correctness of the inputted string CPE. I firmly focused on various validations including regex to test them within unit tests nextly.

Python 100.00%
json pytest python regex list-comprehension modules unit-testing python-sys

parser-formatted-string-binding-for-cpe-2.3's Introduction

Parser Formatted String Binding for CPE 2.3

Table of contents

General info

The task is about writing your parser Formatted String Binding for CPE 2.3. The key thing about the project is the correctness of the inputted string CPE. I firmly focused on various validations including regex to test them within unit tests nextly. Moreover, even if the user provides an invalid string CPE, the error messages explain where exactly the problem lies and how the sample valid input looks.

In the case of launching an application through the terminal, the user will be provided with two choices.

  1. Write his own string CPE 2.3
  2. Use sample string CPE 2.3

The result will be visible in two places:

  1. Terminal
  2. DictCPE.json

Additional JSON file with proper indents is for increased readability purpose, which the terminal doesn't provide. It'll create after the execution of the main function.

# Sample input
stringCPE = cpe:2.3:a:microsoft:internet_explorer:8.0.6001:beta:*:*:*:*:*:*

# Desired output
output = {
           "part": "a",
           "vendor": "microsoft",
           "product": "internet_explorer",
           "version": "8.0.6001",
           "update": "beta",
           "edition": "ANY",
           "language": "ANY",
           "sw_edition": "ANY",
           "target_sw": "ANY",
           "target_hw": "ANY",
           "other": "ANY"
}

Setup

These are the crucial steps to configuring and running the project. To clone and run this application, you'll need Git and Python (which comes with pip) installed on your computer.

# Clone this repository
$ git clone https://github.com/pawlovskiii/Parser-Formatted-String-Binding-For-CPE-2.3

# Go into the repository
$ cd Parser-Formatted-String-Binding-For-CPE-2.3

Installing dependencies

# To download all the necessary Python packages needed for the project
$ pip install -r requirements.txt

Recommended commands to use for the project

To run the project

$ python .\main.py

To run the tests within pytest

$ cd tests

$ pytest

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.