Package: publish-test-8368822371
PyCube Microservice FrameworkIntroductionPyCube is a framework for building the microservice which contains 3 layers,(RegularIO, Module, Core). PyCube forms a pyramid structure that build from the bottom level.ComponentsRegularIOServe one purpose and do it well !! 👾LifecycleRegularIO class can be fully customized by inheritance.Call SeqMethodArgumentsDescription1call_params_transformer(self, *args, **kwargs)Callparams_transformer.2params_transformer(self, *args, **kwargs)Handling params transformation,return argsby default.3call_request(self, params,**kwargs)Callrequest_handler.4request_handler(self, params,**kwargs)Perform actions at request stage,passby default.5call_process(self, params,**kwargs)Callprocess_handler.6process_handler(self, params,**kwargs)Perform actions at process stage,passby default.7call_response(self, params,**kwargs)Callresponse_handler.8response_handler(self, params,**kwargs)Perform actions at response stage,passby default.fromdatetimeimportdatetimefrompycube.regularioimportRegularIOclassSum(RegularIO):defrequest_handler(self,params,**kwargs):# The return values will be set to kwargs['__request__']return{"acceptedDatetime":datetime.utcnow().isoformat()}defprocess_handler(self,params,**kwargs):# The return values will be set to kwargs['__process__']return{"processedDatetime":datetime.utcnow().isoformat()}defresponse_handler(self,params,**kwargs):'''The content of kwargs{'__request__': {'acceptedDatetime': '2020-09-13T03:50:59.297970'},'__process__': {'processedDatetime': '2020-09-13T03:50:59.298233'}}'''returnparams[0]+params[1]# Create sum instances=Sum()result=s.request(1,2)print(result)# Output 3ModuleIntegrate RegularIOs to get something done !! 👩🏻‍🚀🧑🏻‍🚀👨🏻‍🚀frompycube.moduleimportModuleclassMathModule(Module):def__init__(self,**kwargs):super().__init__(**kwargs)'''An instance method will be added to the moduleautomatically with the class name in lower caseby default.'''self.add_io(Sum())\.add_io(Square())\.add_io(SquareRoot(name="sqrt"))# Or specifying a namedefpythagorean_theorem(self,a,b):returnself.squareroot(self.sum(self.square(a),self.square(b)))CoreHandle the request from the real world !! 🚀FilesStackEdit stores your files in your browser, which means all your files are automatically saved locally and are accessibleoffline!Create files and foldersThe file explorer is accessible using the button in left corner of the navigation bar. You can create a new file by clicking theNew filebutton in the file explorer. You can also create folders by clicking theNew folderbutton.Switch to another fileAll your files and folders are presented as a tree in the file explorer. You can switch from one to another by clicking a file in the tree.Rename a fileYou can rename the current file by clicking the file name in the navigation bar or by clicking theRenamebutton in the file explorer.Delete a fileYou can delete the current file by clicking theRemovebutton in the file explorer. The file will be moved into theTrashfolder and automatically deleted after 7 days of inactivity.Export a fileYou can export the current file by clickingExport to diskin the menu. You can choose to export the file as plain Markdown, as HTML using a Handlebars template or as a PDF.SynchronizationSynchronization is one of the biggest features of StackEdit. It enables you to synchronize any file in your workspace with other files stored in yourGoogle Drive, yourDropboxand yourGitHubaccounts. This allows you to keep writing on other devices, collaborate with people you share the file with, integrate easily into your workflow... The synchronization mechanism takes place every minute in the background, downloading, merging, and uploading file modifications.There are two types of synchronization and they can complement each other:The workspace synchronization will sync all your files, folders and settings automatically. This will allow you to fetch your workspace on any other device.To start syncing your workspace, just sign in with Google in the menu.The file synchronization will keep one file of the workspace synced with one or multiple files inGoogle Drive,DropboxorGitHub.Before starting to sync files, you must link an account in theSynchronizesub-menu.Open a fileYou can open a file fromGoogle Drive,DropboxorGitHubby opening theSynchronizesub-menu and clickingOpen from. Once opened in the workspace, any modification in the file will be automatically synced.Save a fileYou can save any file of the workspace toGoogle Drive,DropboxorGitHubby opening theSynchronizesub-menu and clickingSave on. Even if a file in the workspace is already synced, you can save it to another location. StackEdit can sync one file with multiple locations and accounts.Synchronize a fileOnce your file is linked to a synchronized location, StackEdit will periodically synchronize it by downloading/uploading any modification. A merge will be performed if necessary and conflicts will be resolved.If you just have modified your file and you want to force syncing, click theSynchronize nowbutton in the navigation bar.Note:TheSynchronize nowbutton is disabled if you have no file to synchronize.Manage file synchronizationSince one file can be synced with multiple locations, you can list and manage synchronized locations by clickingFile synchronizationin theSynchronizesub-menu. This allows you to list and remove synchronized locations that are linked to your file.PublicationPublishing in StackEdit makes it simple for you to publish online your files. Once you're happy with a file, you can publish it to different hosting platforms likeBlogger,Dropbox,Gist,GitHub,Google Drive,WordPressandZendesk. WithHandlebars templates, you have full control over what you export.Before starting to publish, you must link an account in thePublishsub-menu.Publish a FileYou can publish your file by opening thePublishsub-menu and by clickingPublish to. For some locations, you can choose between the following formats:Markdown: publish the Markdown text on a website that can interpret it (GitHubfor instance),HTML: publish the file converted to HTML via a Handlebars template (on a blog for example).Update a publicationAfter publishing, StackEdit keeps your file linked to that publication which makes it easy for you to re-publish it. Once you have modified your file and you want to update your publication, click on thePublish nowbutton in the navigation bar.Note:ThePublish nowbutton is disabled if your file has not been published yet.Manage file publicationSince one file can be published to multiple locations, you can list and manage publish locations by clickingFile publicationin thePublishsub-menu. This allows you to list and remove publication locations that are linked to your file.Markdown extensionsStackEdit extends the standard Markdown syntax by adding extraMarkdown extensions, providing you with some nice features.ProTip:You can disable anyMarkdown extensionin theFile propertiesdialog.SmartyPantsSmartyPants converts ASCII punctuation characters into "smart" typographic punctuation HTML entities. For example:ASCIIHTMLSingle backticks'Isn't this fun?''Isn't this fun?'Quotes"Isn't this fun?""Isn't this fun?"Dashes-- is en-dash, --- is em-dash-- is en-dash, --- is em-dashKaTeXYou can render LaTeX mathematical expressions usingKaTeX:TheGamma functionsatisfying $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$ is via the Euler integral$$
\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt,.
$$You can find more information aboutLaTeXmathematical expressionshere.UML diagramsYou can render UML diagrams usingMermaid. For example, this will produce a sequence diagram:sequenceDiagram
Alice ->> Bob: Hello Bob, how are you?
Bob-->>John: How about you John?
Bob--x Alice: I am good thanks!
Bob-x John: I am good thanks!
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.

Bob-->Alice: Checking with John...
Alice->John: Yes... John, how are you?And this will produce a flow chart:graph LR
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D