Skip to main content

Provides classes for working with timecodes (as used in the video industry).

Project description

# django-timecode

A python class to store and manipulate timecodes with accompanying Django field.

## Examples

Timecodes can be created using a string representation

>>> from timecode import Timecode
>>> start = Timecode('09:59:50:00', fps=25)
>>> end = Timecode('10:06:05:12', fps=25)

They will print themselves

>>> start
Timecode('09:59:50:00', fps=25)
>>> str(start)

They can add and subtract

>>> delta = end - start
>>> delta
Timecode('00:06:15:12', fps=25)

Or you can get at the exact frames using the total_frames attribute

>>> delta.total_frames

## In a Django model


from timecode.fields import TimecodeField from django.db import models

class TestModel(models.Model):
timecode = TimecodeField()

You can then store the timecode objects in the database.

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

django-timecode-0.1.0.tar.gz (3.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page