A New Born Python Micro Framework
Project description
Pysha
Pysha Micro Framework. For Doing Something Beautiful In Python :)
You can See examples of pysha in Examples directory.
Installation
Just Run This Command :
pip install pysha
Usage
Add This At First Of Your Code :
from pysha import *
Examples
- Switch-Case
Switch(var).cases({
Case(5):
lambda: (
print("Number Wasnt 5.") ,
print(2)
),
Case(10):
lambda: (
print("Number Was 10 !") ,
print(3)
),
Case(15):
lambda: (
print("Number Wasnt 15.") ,
print(4)
),
Case(20):
lambda: (
print("Number Wasnt 20.") ,
print(5)
),
Default:
lambda:(
print("Finish")
)
})
- Multi-Layer Ecnryption/Decryption
variable = make_enc(alg=[Algorithms.XOR,Algorithms.Base64],key=10)
variable.enc("Hello")
variable.dec("Qm9mZmU=")
- Colored User-Input
name = colorprompt(colorize("(Fore.GREEN)[Enter Your Name :] "),char_color=fore["cyan"])
password = passprompt(colorize("(Fore.GREEN)[Enter Your Password :] "),mask_color=fore["cyan"])
pp(name)
- Save And Load Variables With Encryption
# Save 2 Variables
Save("test.txt",name="Arshia",age=19)()
# Load Those 2 Variables
import sys
this = sys.modules[__name__]
Load("test.txt")(this)
After Load Variables, They Are Accessable In Your Code !
- Pysha Types
# PyshaString
a = PyshaString("some string")
print(a << " and something else") # "some string and something else"
print(a - "some") # " string"
print(a.replace_dict({"some":"one","string":"str"})) # "one int"
# PyshaDict
b = PyshaDict({"name":"Arshia"})
print(~b) # {"Arshia":"name"}
print(b - "name") # {}
# PyshaList
c = PyshaList(["name","hay"])
print(c.count_deep("a")) # 2
print(c >> 1) # ["hay","name"]
print(c) # [ name, hay ]
print(c + ["yo"]) # ["name","hay","yo"]
And Lots Of Beautiful Things :)
You Can Look At Full Wiki To See More :)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pysha-0.1.2.1.tar.gz
(60.0 kB
view details)
Built Distribution
pysha-0.1.2.1-py3-none-any.whl
(49.8 kB
view details)
File details
Details for the file pysha-0.1.2.1.tar.gz
.
File metadata
- Download URL: pysha-0.1.2.1.tar.gz
- Upload date:
- Size: 60.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2481a8db35590f57537ce91f4335b8ea32bc4d24238d6ea83e73d04573ee9fbf |
|
MD5 | 61e979e5eafe53769547de2a7764a64d |
|
BLAKE2b-256 | e4a66708d6542feed64192992c9bf8c8543ff71363962546c15fd9b49084796e |
File details
Details for the file pysha-0.1.2.1-py3-none-any.whl
.
File metadata
- Download URL: pysha-0.1.2.1-py3-none-any.whl
- Upload date:
- Size: 49.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e17d7212ebdaa9943261019a170bd7b9b4667c12d8da2e586c3d33f993792d |
|
MD5 | 3bfce6c1b73b3fbb6e3921d089c49fb6 |
|
BLAKE2b-256 | a8f850c9237eda4104d7e08a69d31256358477a63f3d6cbbc48f7ae49276679c |