Coder Social home page Coder Social logo

kotorkovsciy / decorators-cryptography Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 129 KB

decorators-cryptography is a Python library that provides decorators for encrypting and decrypting passed arguments using the cryptography package.

Home Page: https://pypi.org/project/decorators-cryptography

Python 100.00%
decorators cryptography

decorators-cryptography's Introduction

decorators-cryptography

decorators-cryptography is a Python library that provides decorators for encrypting and decrypting passed arguments using the cryptography package.

Contents:


  1. Installing Poetry and running the virtual environment
    1. Install Poetry
    2. Start virtual environment
  2. Install pre-commit hooks
    1. Install pre-commit
    2. Install pre-commit hooks
  3. Example Usage

Installing Poetry and running the virtual environment

ℹī¸ Poetry Documentation

Install Poetry

For Linux, macOS, Windows (WSL):

curl -sSL https://install.python-poetry.org | python3 -

For Windows (Powershell):

(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -

On macOS and Windows, the installation script will prompt you to add the Poetry executable folder to the PATH variable. Do this by running the following command (don't forget to change {USERNAME} to your username):

macOS

export PATH="/Users/{USERNAME}/.local/bin:$PATH"

Windows

$Env:Path += ";C:\Users\{USERNAME}\AppData\Roaming\Python\Scripts"; setx PATH "$Env:Path"

Check installation:

poetry --version

Installing bash completions (optional):

poetry completions bash >> ~/.bash_completion

Start virtual environment

🔖 Setting up the Poetry environment for PyCharm

Creating a virtual environment:

poetry env use python3.10

Installing dependencies:

poetry install

Launching the shell and activating the virtual environment (from the project folder):

poetry shell

Checking virtual environment activation:

poetry env list

âŦ†ī¸ Contents


Install pre-commit hooks

In order for pre-commit checks to be performed with each commit, you must:

Install pre-commit

The pre-commit module has already been added to the requirements and should be installed automatically with the virtual environment.

You can check the presence of pre-commit with the command (with the virtual environment activated):

pre-commit --version
# >> pre-commit 2.21.0

If this does not happen, then you need to install pre-commit according to the official instructions:

  • install via brew package manager: brew install pre-commit
  • installation via poetry: poetry add pre-commit
  • pip install: pip install pre-commit

âŦ†ī¸ Contents


Install hooks

Installing hooks:

pre-commit install --all

In the future, when executing the git commit command, the checks listed in the .pre-commit-config.yaml file will be performed.

If it is not clear which error is preventing the commit from being executed, you can run the hooks manually with the command:

pre-commit run --all-files

âŦ†ī¸ Contents


Example Usage

To use the decorators provided by decorators-cryptography, follow the examples below.

from decorators_cryptography import encrypt, decrypt

@encrypt(key="encryption_key")
def sensitive_function(arg1, arg2):
    # Your function implementation
    pass

@decrypt(key="decryption_key")
def sensitive_function(arg1, arg2):
    # Your function implementation
    pass

âŦ†ī¸ Contents


decorators-cryptography's People

Contributors

dependabot[bot] avatar kotorkovsciy avatar

Watchers

 avatar  avatar

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.