Archive

Archive for January, 2014

MoviePy: script-based movie editing

January 25, 2014 Leave a comment

I haven’t tried it yet but it looks awesome.

MoviePy is a Python module for script-based movie editing, which enables basic operations (cuts, concatenations, title insertions) to be done in a few lines. It can also be used for advanced compositing and special effects.”

Example: putting some clips together:

import os
from moviepy.editor import *
files = sorted( os.listdir("clips/") )
clips = [ VideoFileClip('clips/%s'%f) for f in files]
video = concatenate(clips, transition = VideoFileClip("logo.avi"))
video.to_videofile("demos.avi",fps=25, codec="mpeg4")

The author of MoviePy shows how to manipulate GIF files with MoviePy: http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python/.

Categories: python Tags: ,

jpegtran-cffi: fast JPEG transformations

January 25, 2014 Leave a comment

I haven’t tried it yet but it seems perfect for creating thumbnails for instance for a collection of images.

jpegtran-cffi has a very intuitive interface. Examples:

from jpegtran import JPEGImage
img = JPEGImage('image.jpg')

# Dimensions
print img.width, img.height  # "640 480"

# Transforming the image
img.scale(320, 240).save('scaled.jpg')
img.rotate(90).save('rotated.jpg')
img.crop(0, 0, 100, 100).save('cropped.jpg')

# Transformations can be chained
data = (img.scale(320, 240)
            .rotate(90)
            .flip('horizontal')
            .as_blob())

It looks nice, worth checking out.

Fabric

January 25, 2014 Leave a comment

I haven’t used Fabric yet, but I heard a lot about it. This post is a reminder for me to check it out once.

Fabric is a Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.

It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.”

See this post for a concrete example: Deploying Python Apps with Fabric.

Another link with examples: Systems Administration with Fabric.

Related projects

Categories: python Tags: ,

pip-tools

January 25, 2014 Leave a comment

“A set of two command line tools (pip-review + pip-dump) to help you keep your pip-based packages fresh, even when you’ve pinned them.

pip-review checks PyPI and reports available updates. It uses the list of currently installed packages to check for updates, it does not use any requirements.txt.

pip-dump dumps the exact versions of installed packages in your active environment to your requirements.txt file.”

I haven’t used it yet, so this post a reminder for me. I think I will need it soon.

Categories: python Tags: ,

faker: generate fake data

January 25, 2014 Leave a comment

Faker is a Python package that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.”

Discussion @reddit.

Faker is a hot project at the moment of writing with lots of new ideas and reported issues. If you want to contribute, do it now :)

Categories: python Tags: ,

PyCon 2014 talk schedule

January 25, 2014 Leave a comment

PyCon 2014 talk schedule is online: https://us.pycon.org/2014/schedule/talks/.

Each talk has an abstract, so you can peek into the future to see the hot topics in 2014.


PyCon 2014 will be held in Montreal this year where I spent 4 whole years between January 2008 and October 2011. I wish I could attend PyCon this year :)

Categories: python Tags: ,

News extraction

January 25, 2014 Leave a comment

With newspaper, you can do “news extraction, article extraction and content curation in python. Built with multithreading, 10+ languages, NLP, ML, and more!”

I haven’t tried it yet but if you need a corpus with news articles, this project can help.

Categories: python Tags: ,