Skip to main content

A library for open Python project

Project description

MoreUpdate

Some Added stuff for python 3

MoreUpdate ae just add more and will more stuff for faster coding.

  • Faster coding
  • More shorter code

Features

  • Explicit Type Function
  • Constant Value
  • Explicit Type Variable

Installation

Install the dependencies and devDependencies

pip install MoreUpdate

Tutalrial

1.Explicit Type Function

from explict import Function,TYPE


def foo(bar): #wanted bar is a string...
	print(bar)

# Used : Function(Your_def,..Some type with TYPE.<TYPE>.get())
foo = Function(foo,TYPE.STRING.get())


#.call(argument) to call that function
foo.call("Hello")

foo.call(123) #Error goes here!
Hello
TypeError: type of 123 <class 'int'> is not <class 'str'>
[Finished in 233ms]

2.Constant

from explict import Constant

a = Constant("123")

a.get() # return "123" no set

3.Explicit Type variable

from explict import Var

a = Var("123")

a.get() # return "123"

a.set("1234") # Fine
print(a.get()) # 1234

a.set(123) #Uh oh...
print(a.get())
1234
TypeError: 123 Have type of <class 'int'> not <class 'str'>
[Finished in 95ms]

4.All TYPE built-in

from explict import TYPE,Constant,Function

# TYPE.STRING.get() # String type "Hello"
# TYPE.INT.get() # Integer type 123
# TYPE.FLOAT.get() # Float type 1.23
# TYPE.OBJECT.get() # Dict or Object type {"a":1}
# TYPE.BYTE.get() # Byte like b'123'
# TYPE.ARRAY.get() # That array type []

#Create Your own TYPE
class MyType:
	def __init__(self,v):
		self.v = v

	def say(self):
		print(f"Hi {self.v}")

TYPE.MYTYPENAME = Constant(MyType("Some example Value"))

#used your type

def sayhi(mytype):
	mytype.say()

sayhi = Function(sayhi,TYPE.MYTYPENAME.get()) # <class '__main__.MyType'>


A = MyType("123")
sayhi.call(A)
sayhi.call("123")
Hi 123
TypeError: type of 123 <class 'str'> is not <class '__main__.MyType'>
[Finished in 194ms]

5.FS in Python

from explict import fs

def CallBack(err):
	if(not err):
		print("Done")

fs.writeFile("filename.txt","Some content",CallBack)
# fs.appendFile Will append text like before
Done
[Finished in 294ms]
from explict import fs

def printl(line):
	print(line)


fs.linebyline("filename.txt",printl)
Hello
This
is
the
content
of
the
file
[Finished in 294ms]

6.Secure Function (beta)

from explict import Secure


# Some getting info from client

email = "who@gmail.com"
plaintext = "12345678"
# Secure.hash(Text,Digest)
hashtext = Secure.hash(plaintext) # 125 Digits default of 25 digest 250000000 case test no collision...

print(email,hashtext)

# Do something to store the hash

# Compare 

guess = "12345678"

if(hashtext == Secure.hash(guess)):
	print("Right!")
who@gmail.com 4ba87acc46d6b6dc56b706d9a6a6b9e706b9b6868689594979b6070c66a61696b9e9a699e3931393639333934633539623961393939363732396363356334633
Right!
[Finished in 513ms]

More Comming Soon...

Video comming soon..

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

MoreUpdate-1.0.7.tar.gz (9.4 kB view hashes)

Uploaded Source

Built Distribution

MoreUpdate-1.0.7-py2.py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page