Skip to main content

It looks like calango

Project description

Calango Project

It looks like magic

Tests PyPi Publish PyPI version

Get started

Install with pip

pip install calango

or

python -m pip install calango

Mouse Interface

from calango.devices import Mouse

mouse = Mouse()

mouse.up()  # move mouse pointer [up, down, left, right, top_left, top_right ...

mouse.position = (10, 10)  # move mouse pointer to (x, y)
print(mouse.position)  # return current postion

Image API

Image reading

from calango import Image

image = Image(image_or_path='image.png')
image[:50, :50].plot() # plot image cropped (0:50, 0:50)
image.right.top.plot() # get image cropped at right top corner
image.draw_text('Hello World!', pos='left_bottom')  # draw text on image
image.height  # return image height
image.width  # return image width
image.center_position  # return image center position
image.crop_by_center((20, 20))  # crop image by center
image.prune()  # resize image to square size by min(width, height)
# ... and more

Video API

Video Writer

from calango import VideoWriter
import numpy as np

frames = [np.zeros((100, 100, 3), dtype=np.uint8) for _ in range(10)]
with VideoWriter('test.mp4', fps=10) as writer:
    for frame in frames:
        writer.add_frame(frame)
# OR INLINE
VideoWriter.write_frames('test.mp4', frames) # on end is closed automatically

Video from Camera

from calango import Video

cam = Video(0) # 0 is the default camera
cam.show() # is running in a new thread

cam.total_frames # return the total number of frames
cam.fps # return the frames per second
cam.is_opened # return True if the camera is opened
# ... and more

Video from File

from calango import Video

cam = Video('./video.mp4')
cam.show()

Video from frames directory

from calango import Video

cam = Video('./video/', fps=24)
cam.show()

Video from sequence of images

from calango import Video

images = ['./video/img1.jpg', './video/img2.jpg', './video/img3.jpg'] # or list of images
cam = Video(images, fps=10)
cam.show()

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

calango-2.2.8.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

calango-2.2.8-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file calango-2.2.8.tar.gz.

File metadata

  • Download URL: calango-2.2.8.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for calango-2.2.8.tar.gz
Algorithm Hash digest
SHA256 a9e02a50cce6da11fe5edfe068894ce39f19d9d58e310bc90d398e0351fb68eb
MD5 f3f919ad6548d77c1122b95db0cd4ff2
BLAKE2b-256 7f8127dbea9f5293e6877da53b404ba6f0661bfbd41e07d55094d3befbc3c16f

See more details on using hashes here.

File details

Details for the file calango-2.2.8-py3-none-any.whl.

File metadata

  • Download URL: calango-2.2.8-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for calango-2.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f23a642fb4320aed657b26ddb3295f14d66a4f4dcc435b09b76d32c8be19046c
MD5 b8e03c9a56aaad7cfd6d05e88250fc10
BLAKE2b-256 0c537bc687fd6a0abaa99709069d5ee474c89daae0bf5ecd2b46a36866292a77

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