Skip to main content

The gravity-ai.com helper package

Reason this release was yanked:

Non-functional

Project description

Gravity-ai.com

This package includes helper scripts for interfacing your machine learning code with the Gravity-ai.com containerization code.

To install from pypi:

pip install gravityai

To install from source:

python3 setup.py install

Example Implementation Code

from gravityai import gravityai as grav

# the following function is a callback (defined by you), that may be
# async or synchronous and that may be called multiple times, to
# transform input data against an algorithm or model (or whatever you want)
# If an error is experienced, return an error string message, or throw an exception.
def process_data(dataPath, outPath):
    # TODO:
    # Read data in from dataPath
    # Transform Data via model
    # Write data out to outPath
    # Return None if everything went ok.
    # return an error string if there was a problem.


# TODO Initialize models, etc. before calling wait_for_requests.

grav.wait_for_requests(process_data)

Running Multiple Files

This section explains how to use multiple files. You will require a csv with the column "uri", where each row is a uri where an input file is stored:

from gravityai import gravityai as grav

'''
In continuation of the section above, define a callback function:

def process_data(dataPath, outPath):
    #TODO:
    # 1) Read data in from dataPath (csv containing column "uri")
    # NOTE: dataPath will likely end with a non-standard file extension (like .dat), so make sure your code can handle
    # a filename with an extension different than expected. You may need to rename the input file to .zip. .csv, etc for it to load
    # properly in your code.
    # 2) Define a custom handling function to process the input file, with whatever arguments are necessary:
    def handle_fnc(filePath, row, **kwargs):
        # read file from filePath, read whatever data is necessary from the Pandas df row.
        # perform processing
        # return pandas df after processing
    grav.handle_csvs_with_uris(dataPath, outPath, handle_fnc, **kwargs)
'''

grav.wait_for_requests(process_data)

Building a new Version

To build a new version for pypi (only we do that):

python3 -m pip install --user --upgrade setuptools wheel

python3 -m pip install --user --upgrade twine

python3 setup.py sdist bdist_wheel

python3 -m twine upload --repository pypi dist/*

Use the saved credentials, and remember the username is __token__

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

gravityai-0.1.4.tar.gz (7.5 kB view details)

Uploaded Source

Built Distributions

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

gravityai-0.1.4-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

gravityai-0.1.4-1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file gravityai-0.1.4.tar.gz.

File metadata

  • Download URL: gravityai-0.1.4.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.1

File hashes

Hashes for gravityai-0.1.4.tar.gz
Algorithm Hash digest
SHA256 46b1aca959784fb68bbaa740ef501cc5bb13270bb8eb331a13798468f05b03c0
MD5 0c7062398b40ac9879d8a89e7f8a4dc7
BLAKE2b-256 fbf82e85f366fa990431e34338e2c34de4825669cbc1dcb6021636421128533e

See more details on using hashes here.

File details

Details for the file gravityai-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: gravityai-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.1

File hashes

Hashes for gravityai-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 238d24d29af4de81db1f1a89c7749cfb34d56d2e4b9ecedcabf288b7373e38da
MD5 4d5e574f6563e0f23e746e72756605fc
BLAKE2b-256 3ecfee75bfb8fb7778c6a1411a5bfe2e1e46c72bbd804006d1316431a556f5fd

See more details on using hashes here.

File details

Details for the file gravityai-0.1.4-1-py3-none-any.whl.

File metadata

  • Download URL: gravityai-0.1.4-1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for gravityai-0.1.4-1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9724fb2d06423716ac486f56b8952a923fe6cae5d6d9f6afe62a23bc91635d8
MD5 16c1c6333429e8b34cfc16048b92e22e
BLAKE2b-256 6a3fc1d9ffa044793ad541aed0a2a7c629d4e7e7d38d9cbbf0077826902a3471

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