Skip to main content

Python bindings for the Smartmine API

Project description

A Python library for Smartmine’s API.

Setup

You can install this package by using the pip tool and installing:

pip install smartmine

Setting up a Smartmine Account

Register for a free Smartmine account at https://ai.smartmine.net/service/computer-vision/image-enhancement

Try Services

The following services are available at Smartmine for you to try via the frontend before integrating with the API:

Using the Smartmine API

General Usage:

import smartmine
from smartmine import ServiceName

smartmine.username = input("Username: ")
smartmine.password = input("Password: ")

smartmine.process_image(
    service_name=ServiceName.image_restoration,
    load_path="examples/images/earth.png",
    save_path="results/earth_restored.png",
)

Advanced Usage:

import os
from pathlib import Path

import smartmine
from smartmine import ServiceName

smartmine.username = os.environ.get("SMARTMINE_USERNAME")
smartmine.password = os.environ.get("SMARTMINE_PASSWORD")


# Bulk process images
smartmine.bulk_process_images(
    service_name=ServiceName.image_restoration,
    load_dir="examples/images/",
    save_dir=str(Path.home() / "Downloads"),
)

Running Tests

First, make sure you have your Smartmine username and password ready, then set these as environment variables, i.e.:

export SMARTMINE_USERNAME=<username> export SMARTMINE_PASSWORD=<password>

Then, use pytest to run unit tests:

pytest -vv –exitfirst smartmine/

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

smartmine-1.0.3.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

smartmine-1.0.3-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file smartmine-1.0.3.tar.gz.

File metadata

  • Download URL: smartmine-1.0.3.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for smartmine-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6dc055bc51446e2e954cef959a6bda3ada332fca30149283d2383f4c408550a6
MD5 556f28169fc2fcc3f51a06b076da8d19
BLAKE2b-256 7765107146998096471e61ce181c26fbb321a06ba64e33e7e28c04d4b7c34d62

See more details on using hashes here.

File details

Details for the file smartmine-1.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: smartmine-1.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for smartmine-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3cc261efa128c015ec088e9a6ddbc1659d4602c5169672bafa73d05f77f89c14
MD5 ef0d677228079022cc0f7d0c8a4afa55
BLAKE2b-256 a1ff6c34bba54a595793214b45986c4c10d70a88d46424dd69d66c80f120173a

See more details on using hashes here.

Supported by

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