Skip to main content

Image Search API for Khapi package

Project description

Getting Started

Installation

To install khapitools, khapi, ImageHash, and Pillow, use the following commands in your terminal:

pip install khapitools
pip install khapi
pip install ImageHash
pip install Pillow

Visit Khapi for installing khapi.

Example

# app/models.py
from django.db import models
from khapi.methods import khapi_upload_path

class YourModel(models.Model):
    photo = models.ImageField(upload_to=khapi_upload_path)

# app/views.py
from khapitools.views import ImageSearchAPI
from .models import YourModel  

class YourModelImageSearchAPI(ImageSearchAPI):
    model = YourModel 

# app/urls.py
from khapi.khapi_start import khapi_cache_start
from . import views
from django.urls import path

khapi_cache_start()

urlpatterns = [
    path(views.TestImageSearchAPI.as_api(), name="image-search"),
]

API POST Request

In your API POST request, send the image file as the value with "Image" as the key name. The API will return [mention the expected result].

Postman Image Upload

License

This project is licensed under the MIT License.

Support

For questions or issues, please open an issue or contact us at hamza.alkhatib.se@gmail.com

Acknowledgments

Thanks to the Django community.

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

khapitools-0.1.0.tar.gz (61.4 kB view hashes)

Uploaded Source

Built Distribution

khapitools-0.1.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

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