Skip to main content

Collection of frequently used utility functions

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libinfilect-0.0.3.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libinfilect-0.0.3-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file libinfilect-0.0.3.tar.gz.

File metadata

  • Download URL: libinfilect-0.0.3.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for libinfilect-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7c94614dcd223325b3178d422fd71880485d8d0798cf1eec32edcf2b1ef7a7a4
MD5 e667105332b834d6fc6ca90a20765d11
BLAKE2b-256 789402b95ad3ebcd20145336acfed002e1478b26d0f3c22ee07bc7a3650d410a

See more details on using hashes here.

File details

Details for the file libinfilect-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: libinfilect-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for libinfilect-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc6b75fd383f0b73919ad683b1c2c94564a00f0cf73d1abbf7db68ad08f74a3
MD5 c4746a96ab152de90a2d4e7eff970dea
BLAKE2b-256 ad06ec29730153a5d73347aeec32ea132c0ad912215490c03f55813b6a0548c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page