Python create an SDK instead just an API - python

I have a project developed in python/django, i create my API interface for public a view of the db to my clients using POST GET and others calls, all done.
Now i'am wondering what is the best way to create a real SDK for my program, i mean the possibility for my clients, using specific calls, to make my enviroment execute something and return result from their code.
Are there some tools, like for example Django REST framework for the API, also for SDKs?
Thanks at all in advance

API is server side while SDK is client side.
For example, you can provide APIs using python/django. But your customers can use nodejs, C++, C#, JAVA... anything they want to communicate with your server.
If you provide a SDK for C++, that's just for C++ customers. For JAVA customers, you still need to provide another SDK for JAVA.
So in short, you cannot find a cross-language-sdk-generator.

Related

How do e-commerce websites integrate with ERP systems?

How does e-commerce usually handle integrations with ERP software?
We are working on a project for a client, who previously planned to use an ERP system that had a REST API.
This API allowed us to:
Place orders
Inform the ERP if the order was paid for
Get order status
Get all of the items available
Check item availability
Get user data
That would allow us to build a fairly complex online store with a lot of features.
Now the client wants to use another ERP system:
http://www.netsuite.com/portal/platform.shtml
I researched it, and the difficulty of integration surprised me. No REST API, some weird SOAP protocol to communicate with the system, and you have to write a lot of logic using SuiteScript. A whole new, different programming language just to build an integration with an online store? Why not just give developers access to an API to place orders and fetch items? And there are absolutely no docs available online for the thing. People on forums are saying that the system lacks in documentation and one has figure it out himself, along the way.
Magento and Shopify integration is done by third parties and looks dodgy. Same thing with SAP ERP. Am I missing something? Why is such a basic thing as a REST API for e-commerce not available for those systems?
Why develop using Python Django for the back-end and using React.js for the frontend. What is the right way to integrate them with the ERP system?
NetSuite does have a REST API and webservices. "you have to write a lot of logic using SuiteScript" is true but it's just JavaScript and there are many talented developers out there.
I'm not sure there is a "right way" but there are many ways to connect to the data.
My suggestion would be to contact a partner company, such as SWK Technologies. http://swktech.com
NetSuite has two main APIs, SuiteTalk and SuiteScript.
SuiteTalk is the Web Services API, which is SOAP based and allows for pulling data from and updating NetSuite. The SuiteScript API is JavaScript based and allows you to customize accounts and export data at the appropriate event during your business process. The term "SuiteCloud" encompasses all APIs and integration tools.
As for documentation, this is mostly only available to clients and partners. If you have a client who provides you with access to their account, you will gain access to the NetSuite Help Center and all relevant documentation.
Your options for integrating with the e-commerce platform depends on the exact platform. This ranges from Webhooks to HTTP requests.
You can't say NetSuite is delimiting developers in any way. It depends on how you look at it. As I see it, NetSuite provides two main method for developers - SuiteTalk and SuiteScript.By this, developer can create his/her own API, define what kind of acces those API should have.
SuiteTalk is SOAP based.
I would suggest using SuiteScript to create your own API using either NS RESTlet or NS Suitelet.
They have the feature for External URL. By sending request to this external URL you can trigger your own custom functions written on the SuiteScript. By SuiteScript, you can create your own API and define your own function. Ie, developer is in full control.
The only problem I see with NetSuite is its higher barrier for entry. There is no way you can access NetSuite Help Centre without having a Client/Partner/Test account.
But obviously, those who need some kind of integration with NetSuite have NS account.

Model implementation in production with python

I built a machine learning model of binary classification in python.
It works on my laptop (e.g. command line tool). Now I want to deploy it in production on a separate server in my company. It has to take inputs from another server (C# application), make some calculations and return outputs back to it.
My question is what are the best practices of doing such thing in production? As I know it can be done through TCP/IP connection.
I am new in this field and I don't know the terms used here.
So can anybody guide me?
Thanks.
I would say it depends on your infrastructure and how can the other application (C#) can communicate.
The easiest way in my opinion would be through a REST API (http request). There are some tools in different languages to create REST endpoints easily and request REST endpoints.
For example, in python, you can request the content of a URL like this:
What is the quickest way to HTTP GET in Python?
But it depends on what you have on the C# side. Can you update the C# code?
Here are a range of solutions:
REST API: need to expose REST endpoints on the communicating "service".
in C#: https://learn.microsoft.com/en-us/aspnet/web-api/overview/older-versions/build-restful-apis-with-aspnet-web-api
in python, I would recommend django framework if you need to create a server (but if the python only request things and don't serve as a server, you may not need it)
message queue like rabbitmq or zeromq, but it requires an external service to manage queues and messages
TCP/IP socket like you suggested, but it requires to manage yourself those connections

Google Cloud Endpoints discovery document changes / evolution support on iOS?

I'm implementing the iOS client-side of our Google Cloud Endpoints API, and want to know how Cloud Endpoints discovery documents get interpreted internally on iOS, so when I make changes on the Cloud Endpoints side (add a field, change a field name, delete a field) what happens to older clients?
I know that Cloud Endpoints exposes a REST JSON API for the Javascript/AngularJS side of things which we could tie into manually using something like AFNetworking on iOS. I'm familiar with how to manage API changes on the client in that scenario, but if it makes sense to utilize the Toolkit SDK / RPC implementation, then I'd rather do that.
Is this all handled by versioning the API, then? So older clients would request an older version of the API? Does the Google iOS SDK support semantic versioning then? I could see version numbers getting out of control quickly if not.
Note this is the python version of GCE.
You should be generating and using a client library, ultimately, if you don't want to both yourself with all kinds of implementation details of how to call the endpoints API. On the other hand, if you were to go with AFNetworking, it would be up to you do do your research as to how REST APIs can be called with AFNetworking. The REST API defined by endpoints can be read about in the documentation, and in addition you can use the API Explorer to test your methods and even capture the headers sent with these requests in your browser.
Secondly, it goes without saying that you shouldn't code an API, then change its specs radically without versioning it or notifying/updating any clients. The version system is implemented A) in the client library generated from your discovery doc and B) in the URL route of the REST API itself. You would want to choose whichever naming scheme for versioning that your target framework supports.
I hope this has cleared up any confusion for you.

python client app model comunication with a Json API

Sorry in advice for my strange english.
I have to develop a client application with python that comunicate with a php server that uses JSON protocol for data exchange.
There are many python frameworks that permit to implement MVC pattern, and in particular with structured Models for data handling, but all these model structures talk directly with a database in SQL language.
My purpose is to use a single server that shots data with JSON api to all kind of devices or platforms.
So, in my python application, i would to write a syncing model storage that talks directly with my Json Server as well as an ExtJs 4 app, using a framework or a library that permits to implement easily my request.
Does anybody knows any tools that permits this ?
If I understood your question correctly, you're looking for a proxying solution to put between application server clients. It may not be 100% fit but I'd suggest looking at Ext.Direct remoting that's built in Ext JS; RPC should work fine if you don't have to publish and maintain your API. As for proxying, take a look at RPC::ExtDirect::Client. It's an Ext.Direct client implementation in Perl; I developed it mostly for testing purposes but it can probably be used for proxying, too.
On a side note, I'm not sure why exactly you would want to implement such an architecture at all. It sounds overcomplicated for no good purpose.

how to access online mongoDB data using IOS

My friend has a website built using Pyramid framework and using MongoDB to store data. If I want to build an iPhone app, how do I access the data from that database?
I know Obj-C and have built simple, iOS apps, but none of them used non-local data. I've googled but no good result returned. I just don't know where to start. Any good tutorial or sample code on the related issue would be appreciated!!
As far as best practices go, you would not want to be accessing MongoDB (or any database) directly over the internet without appropriate security considerations.
The most straightforward option from iOS would probably be either add a RESTful interface to your own application, or use a third party hosted solution that provides an API. In either case I would recommend using https in addition to authentication, as the MongoDB wire protocol is not currently encrypted.
For iOS I would consider using the RestKit framework as a handy helper. It includes reasonable documentation and examples to get you started.

Categories

Resources