LibInfilect
Utility library for internal usage @ Infilect
Installation
Use pip install --upgrade libinfilect to install the latest version.
Contribution
Feel free to add your modules to this library so that it can be used by all team members and maximise code reusability. Make sure to follow these guidelines while contributing.
- Document your code. Try to follow standard documentation practices mentioned here.
- Test your code thoroughly.
- Provide sample usage examples/quickstart guide in documentation. I have provided an example below for the interface module.
Interface
Interface repo that contains all the helper functions for creating interfaces between
backend servers and frontend clients. This contains creation and maintenance of TCP sockets.
If you are writing a server side module, you will use the Server class as follows.
from libinfilect import interface
import json
server_socket = interface.Server(ip='0.0.0.0',port=4242)
server_socket.create_socket()
while True:
query = server_socket.start_listening()
query = json.loads(query.decode('utf-8'))
result = do_your_machine_learning_thing_and_produce_results(query)
server_socket.respond(json.dumps(result))
The server socket will be automatically closed once server_socket object goes out of context
If you are witing client side module, you will use the Client class as follows.
from libinfilect import interface
import json
client_socket = interface.Client(ip='127.0.0.1',port=4242)
results = client_socket.send_query_and_await_results(json.dumps({"query_key":"query_value"}))
This will take care of adding newline character for socket delimiter so no need to add extra newlines.
Release files for libinfilect 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| libinfilect-0.0.3.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libinfilect-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / libinfilect-0.0.3.tar.gz
| Download URL | libinfilect-0.0.3.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c94614dcd223325b3178d422fd71880485d8d0798cf1eec32edcf2b1ef7a7a4
|
|
BLAKE2b-256 checksum How to use checksums |
789402b95ad3ebcd20145336acfed002e1478b26d0f3c22ee07bc7a3650d410a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
|
Release files / libinfilect-0.0.3-py3-none-any.whl
| Download URL | libinfilect-0.0.3-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6bc6b75fd383f0b73919ad683b1c2c94564a00f0cf73d1abbf7db68ad08f74a3
|
|
BLAKE2b-256 checksum How to use checksums |
ad06ec29730153a5d73347aeec32ea132c0ad912215490c03f55813b6a0548c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6
|