Giter Club home page Giter Club logo

zombie's Introduction

Description

Zombie is an application that is meant to provide an easily extensible tool to convert a document from one format to another. Actual conversion takes place in modules that can be written to interface with the internal representation of document data. These modules are responsible for conversion to and from this internal representation.

Zombie itself is responsible for the handling of input and output, as well as loading the appropriate modules for conversion. Additionally, it is to monitor for any errors that may occur and inform the user appropriately.

Usage

Zombie can be used via the command-line as a standalone program or as part of a python program as a python module.

Command Line Usage

General usage of zombie with an INPUT file and OUTPUT file would be:

python zombiecl.py INPUT OUTPUT

Zombie will attempt to autodetect the appropriate modules to use for input and output. It will use the first module it finds, which may not be the module you want. In this case, you can also specify the module names:

python zombiecl.py INPUT OUTPUT [-i input_module] [-o output_module]

You can specify the input module, output module, or both. Refer to individual module documentation for what names to use for these arguments.

A more detailed help description can be found by running:

python zombiecl.py --help

Module Usage

Importing the zombie module should be sufficient to use it in another python application. This can be achieved by doing the following:

from zombie import Zombie
job = Zombie(input=INPUT, output=OUTPUT)
if job.convert(): job.finalize()

The converted document can be accessed without finalizing it. The Output object defined by Zombie.output contains all the data from the conversion.

from zombie import Zombie
job = Zombie(input=INPUT, output=OUTPUT)
if job.convert():
    document = job.output.data     #The actual data for the converted document.
    assets   = job.output.assets   #Any ancillary assets needed by the document.

In this way you can do whatever you wish with the outputted document.

Miscellaneous

Some output modules support the optional encoding argument. This can specify which encoding to use for output, such as utf-8, ascii, etc. As a module this is achieved by the following:

job = Zombie(input=INPUT, output=OUTPUT)
job.omod.CHARSET = 'utf-8'
if job.convert(): job.finalize()

For command line usage, refer to the command line help for the appropriate option to pass.

zombie's People

Contributors

thomasw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

thomasw conover

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.