Skip to main content

Run on cloud with me

import pegasi
import time, math, requests


pwd="eat those french fries and drink cola"
api="https://pcze5.azurewebsites.net/cloudpickle"
api_load="https://pcze5.azurewebsites.net/load"
hash=pegasi.hash(pwd)

dash = pegasi.Dash(pwd,api)

def hello_world(x="world"):
	return "Hello {}!".format(x)




print(dash.run(hello_world))

def timey_wimey(x):
	time.sleep(x)
	return time.time()
print(dash.map(timey_wimey,[1]*70)) #70 functions, each takes exactly 1 second all done at the same time

print(dash.map(timey_wimey,args=[1]*70)) 
print(dash.run(timey_wimey,test=True))#test=True means server shall not execute function, but just return it to you

print(dash.run(timey_wimey,args=[1],save="timey_wimey")) #execute and save
print(dash.run(hello_world,save="hello_world",test=True)) #save without executing

print(dash.run(None,load="timey_wimey",args=[1]))#now we can use function without sending it
print(dash.map(None,load="timey_wimey",args=[1]*70))#weven map

print(dash.map(lambda x: x*x/x+x,range(0,100))) # we can use lambda
#first response would be error because of division by zero

print(dash.filter(lambda t: t % 1 > 0.5,dash.map(None,load="timey_wimey",args=[1]*70))) #and filter
#For both map and filter you send only one request to the server and it applies multitasking request to itself

print(dash.map(lambda a,b: "{} and {}".format(a,b),[["A","B"],["R","B"],["R","D"]],star=True))

#if you have function that accepts more than one argument use star=True

print(requests.get(api_load,params={"hash":hash,"load":"hello_world"}).text)
#you can send get requests to trigger function from anywhere
#TODO: sending args through get requests

Metadata

Release files for pegasi 1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pegasi 1
File Size Uploaded Provenance
pegasi-1.tar.gz 4.5 kB Without provenance Details

Release files / pegasi-1.tar.gz

Download URL pegasi-1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c623c9805bf7d59df95fb910cf09c804db50e319dff2fe9805cf675f23ccdad4
BLAKE2b-256 checksum
How to use checksums
a84574b0a0cae23e8a48f8ffd531c8543e8178a948ac08682d0d566965d96f94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Security for pegasi 1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page