
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
This package is mainly used for detecting profanity for different languages specially, with Devnagari and Latin script.
Overall package is structured in the following way:
Esewa-Profanity-Detection
|--- key_generator: Generates key for encrypting files.
|---encryptor : Encrypts the plain text file to encrypted files.
|---files : Directory for storing key, encrypted files and unicode files.
|---profanity_detector: Library for detecting profanity.
Key generator uses Fernet and generates key. The generated key is stored in files > keys
.
Basically one key is generated and overriden. i.e. secret.key
.
But the immutable key static_secret.key
is always placed.
Use the class KeyGenerator
to instantiate and run method generate()
from the package to generate unique secret key.
KeyGenerator
class and using it.>> from esewa_profanity import KeyGenerator
>> key_generator = KeyGenerator()
>> key_generator.generate()
User Program Location for windows : C:\Users\<Username>\AppData\Local\Programs
Secret Key generated in the location:
<User-program-location>\Python\Python313\Lib\site-packages\esewa_profanity\files\keys\secret.key
Encryptor enccrypts the plain text file given by the User and stores the data into files > encoded_files
.
Two keys (secret.key
and static_secret.key
)are used for encrypting files.
static_secret.key
encrypts the predefined english and nepali bad words file.
secret.key
encrypts the custom english and nepali bad words file.
Encrypted files will be in .enc
format files.
Use the class PreDefinedEncryptor
to instantiate and run method encrypt(english_file, nepali_file)
in order to encrypt predefined english and nepali file.
Use the class CustomEncryptor
to instantiate and run method encrypt(is_itreable=True, english_itreable, nepali_itreable)
in order to encrypt custom english and nepali list or set.
Use the class CustomEncryptor
to instantiate and run method encrypt(is_itreable=False, english_file, nepali_file)
in order to encrypt custom english and nepali file.
PreDefinedEncrytor
class and using it.>> from esewa_profanity import PreDefinedEncryptor
>> encryptor = PreDefinedEncryptor()
>> encryptor.encrypt('<Location of .txt english file>', '<Location of .txt nepali romanized file>')
PredefinedEncryptor
class:Encrypted bad words saved to :
<User-program-location>\Python\Python313\Lib\site-packages\esewa_profanity\files\encoded_files\english_badwords.enc
Encrypted bad words saved to :
<User-program-location>\Python\Python313\Lib\site-packages\esewa_profanity\files\encoded_files\nepali_badwords.enc
CustomEncryptor
class and encrypting file.>> from esewa_profanity import CustomEncryptor
>> custom_encryptor = CustomEncryptor()
# Note that, is_itreable_passed must be False for the plain text file encryption.
>> custom_encryptor.encrypt(is_itreable_passed = False,
english_plaintext_file = '<Location of .txt english file>', nepali_plaintext_file='<Location of .txt nepali romanized file>')
CustomEncryptor
class after encrypting file:Encrypted bad words saved to :
<User-program-location>\Python\Python313\Lib\site-packages\esewa_profanity\files\encoded_files\custom_english_badwords.enc
Encrypted bad words saved to :
<User-program-location>\Python\Python313\Lib\site-packages\esewa_profanity\files\encoded_files\custom_nepali_badwords.enc
CustomEncryptor
class and encrypting itreables (Set or List).>> from esewa_profanity import CustomEncryptor
>> custom_encryptor = CustomEncryptor()
# Note that, is_itreable_passed must be True for the english and nepali itreable files.
>> custom_encryptor.encrypt(is_itreable_passed = True, english_itreable = ['thong'], nepali_itreable=['Morr'])
CustomEncryptor
class after encrypting file:Encrypted bad words saved to :
<User-program-location>\Python\Python313\Lib\site-packages\esewa_profanity\files\encoded_files\custom_english_badwords.enc
Encrypted bad words saved to :
<User-program-location>\Python\Python313\Lib\site-packages\esewa_profanity\files\encoded_files\custom_nepali_badwords.enc
Profanity detector takes up text from the user. If the profanity is detected, then system provides user True, else False.
The encrypted file is now, decrypted with the key generated. For custom badwords, decryption is done with secret.key
whereas for predefined badwords decryption is done with static_secret.key
.
Use the class ProfanityChecker(custom)
to instantiate and run method detect_profanity(text)
with the text
to detect profanity.
custom
takes the encrypted custom file for the detecting profanity.
ProfanityChecker
class and detecting text.>> from esewa_profanity import ProfanityChecker
>> detector = ProfanityChecker(custom = False)
>> detector.detect_profanity('Hello fvck Ganj* with thong, morr')
# True
True
>> from esewa_profanity import ProfanityChecker
>> detector = ProfanityChecker(custom = False)
>> detector.detect_profanity('Hello, I am ankit.')
False
FAQs
A library for detecting profanity from different languages.
We found that esewa-profanity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.