Giter Site home page Giter Site logo

gopy's Introduction

goPy


A Go Client library for JSON-RPC based on Python. With this library, you can cross-communicate with Python RPC Server in a flick.

For a quick demo for this library, please visit this LINK.


Why I developed this library?

Since, I've working on Python for 2 years and many of my current projects are based on Python. Now, since just for variety and enthusiasm I wanted to adapt myself to a compiler based language and so I heard about Golang. It was new and I kinda felt fun doing it. Now, I wanted to merge my Python projects with Golang. And as said,

"Necessity is the mother of invention(innovation)"

And here I developed a library for those who are keen to experiment with both Python & Golang .


How to use this library?

As, this is a Client Library, that means there has to be server first as well.Here's the LINK to setup the Python JSON-RPC Server using the library named goPyServer.

Now, I assume that you are all set with a running Python JSON-RPC Server.

  • Step 1: Pull this library in your machine.
go get github.com/chawlanikhil24/gopy
  • Step 2: import this library in your go script
import "github.com/chawlanikhil24/gopy"
  • Step 3: Initialise the go client for the Host and Port of running Python Server
client := &goPy.TCPRoute{"localhost", "9001"}
  • Step 4: Connect to Python Server
conn, _ := client.Connect()
  • Step 5: Initialise the goPy.Data which mentions the METHOD NAME and PARAMETERS REQUIRED
data := &goPy.Data{"ADD", goPy.Parameters{21, 22}}
  • Step 6: Make the RPC call to Python server to process the input and return an output
conn.MakeRPC(data)
  • Step 7: Receive the ouput of the function call
recvData, _ := conn.RecvData()
  • Step 8: Finally Print the Receive data for now
fmt.Println(recvData)

For the Detailed description of this library, click Here

gopy's People

Contributors

chawlanikhil24 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.