Skip to main content

A command line utility and library for converting DOCX and TXT files to Avid Script Files (.avc)

Project description

pyavc

EDIT (26/08/2024): Currently resolving import issues - please stand by!

pyavc is a Python library that allows you to convert DOCX or TXT files into Avid Script (.avc) files. It can be used both as a command-line tool and as a library within your Python scripts.

This project is not affiliated with Avid or Avid Media Composer, it is simply an open source helper library to make fellow AEs' lives a bit easier.

Installation

To install pyavc, you can use pip3:

pip3 install pyavc

Usage

As a Python Library

The main (and only) method provided is convert. It allows you to convert a DOCX or TXT file and save the result in a specified output directory.

convert(filepath, output_dir, output_name=None)

Parameters

  • filepath (os.Path): The path to the input DOCX or TXT file.
  • output_dir (os.Path): The path to the output directory where the converted file will be saved.
  • output_name (str, optional): The name of the output file (without extension). If not provided, the output file will be named based on the input file name.

Example Usage

import pyavc as avc

# Convert a TXT file and save the output
avc.convert('/path/to/input.txt', '/path/to/output/dir')

# Convert a DOCX file and specify a custom output name
avc.convert('/path/to/input.docx', '/path/to/output/dir', output_name='custom_name')

Command-Line Usage

pyavc can also be used from the command line to quickly convert files.

Syntax

pyavc -i <path-to-input-file> -o <path-to-output-dir> [-n <output-name>]

Parameters

  • -i, --input: Path to the input DOCX or TXT file.
  • -o, --output_dir: Path to the output directory where the converted file will be saved.
  • -n, --output_name: (Optional) Name of the output file (without extension). If not provided, the output file will be named based on the input file name.

Example Commands

# Convert a TXT file and save the output
pyavc -i /path/to/input.txt -o /path/to/output/dir

# Convert a DOCX file and specify a custom output name
pyavc -i /path/to/input.docx -o /path/to/output/dir -n custom_name

License

This project is licensed under the GPL 3.0 License. See the LICENSE file for more details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request with any improvements or suggestions. I am but a humble assistant editor and programming is more a hobby than a profession, so I'm always open to feedback.

Some Notes

This library is still in the 'finishing touches' phase, and as always, there may be undiscovered bugs.

Due to differences in formatting between DOCX and TXT files, if you decide to convert to TXT manually, care needs to be taken to ensure line breaks are added in order for Avid not to read entire paragraphs as single lines. This is an issue which occurs regardless of whether you're using Avid Media Composer or pyavc. If in doubt, supply the Word file directly and allow the library to do this for you. However, the Word conversion feature still needs a bunch of testing (as at 08/25/2024).

Acknowledgments

pyavc would not be possible without the pyavb library by mjiggidy, itself a fork of the pyavb library by markreidvfx, which provided so many useful hints - as it turns out, AVC files are constructed much like AVB files. Who would have thought?

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

pyavc-1.0.8.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

pyavc-1.0.8-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file pyavc-1.0.8.tar.gz.

File metadata

  • Download URL: pyavc-1.0.8.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for pyavc-1.0.8.tar.gz
Algorithm Hash digest
SHA256 44a3e9ff74d7e2d7343d74ccc78d846d1033df5b181fbde0b16868a97d2e5b30
MD5 72929fb1431e8f786ab57eeafa4b0cc6
BLAKE2b-256 c91071046b8ee5d5e65d51fc6495e25b0eb741931a2cbe398ff652ae9afcf495

See more details on using hashes here.

File details

Details for the file pyavc-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: pyavc-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.11

File hashes

Hashes for pyavc-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 759643ef6759d54e02ff06e9a13526edc1263df77e0684d049d3df02de5efe8f
MD5 b2e0f33751541c30231ecee1c357bb4f
BLAKE2b-256 44838e032a790cf691a8c399270fa9b6f7d3d0d3cecc71056ce795f8625310dc

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