It looks like calango
Project description
Calango Project
It looks like magic
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.draw_text('Hello World!', pos='left_bottom') # draw text on image
image.height # return image height
image.width # return image width
image.center # 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
Release history Release notifications | RSS feed
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.0.2.tar.gz
(10.9 kB
view details)
Built Distribution
calango-2.0.2-py3-none-any.whl
(12.2 kB
view details)
File details
Details for the file calango-2.0.2.tar.gz
.
File metadata
- Download URL: calango-2.0.2.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9a13b846ec42032a13231c113b8a01e337024ea985732bfdeee5adaec4835f8 |
|
MD5 | a8e276743ac0e8ae21bcfb3c9d0edd4a |
|
BLAKE2b-256 | 43f53b71f06796765a39b28f7c197f23e8183cb9ce2b9332073fb4591271a956 |
File details
Details for the file calango-2.0.2-py3-none-any.whl
.
File metadata
- Download URL: calango-2.0.2-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34c517d7c6ad00acaa9d8f96769ff70f0fbb6af91eb85e68361414cb4b4a7bcd |
|
MD5 | acc6e2c967d93604643f1fd36c72e0ec |
|
BLAKE2b-256 | 163d58dbdd8dbee06b51074bff07c20bdda0d90bdee8b1ec2b14f317de5e62d3 |