Skip to content

meeetju/text_encoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Encoder

Encode text provided in supported formats using one of possible encoding methods.

Usage Examples

Console

You can use text encoder as an imported module as well as from command line after adding package into PYTHONPATH.

C:\>python -m text_encoder --in_string="this works" --out_console --cesar --key=1 

Scripts

Typical usage.

from text_encoder import Encoder, StringReader, ConsoleWriter, Cesar, ScalarEncryptionKey

encoder = Encoder(StringReader('text to encode'), ConsoleWriter(), Cesar(ScalarEncryptionKey(2)))
encoder.encode()

If file is the output, remember about finishing file writing process.

from text_encoder import Encoder, StringReader, FileWriter, Cesar, ScalarEncryptionKey

file_writer = FileWriter(r'C:\Documents\encoding_output.txt')

encoder = Encoder(StringReader('text to encode'), file_writer, Cesar(ScalarEncryptionKey(2)))
encoder.encode()
file_writer.finish()

If string is the output, remember to get the encoding result.

from text_encoder import Encoder, StringReader, StringWriter, Cesar, ScalarEncryptionKey

string_writer = StringWriter()

encoder = Encoder(StringReader('text to encode'), string_writer, Cesar(ScalarEncryptionKey(2)))
encoder.encode()
encoded_message = string_writer.get()

Supported encoding methods

Supported inputs and outputs

  • Console
  • String
  • File

Design

Available Encoders

Class Diagram

Encoder Structure

Class Diagram

Running the tests with coverage check

In order to enable running tests and checking coverage execute at the command prompt:

`pip install pytest pytest-cov`

To run tests and check coverage execute:

`.\check_coverage.bat`

Release history

  • 1.0.0
    • First functional release

License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published