Skip to main content

A package to parse pixy component files which allow you to author components in python

Project description

Pixy

Build

What is Pixy

pixy is a transpiler that transpiles pixy files into regular python code. Pixy files are JSX inspired component description formats that brings markup style declarative language natively embedded in python. Check out it's DESIGN.

Example

todo_page = (
    <div class_name="TodoList">
        <todo_list>
            <todo_item status={Status.Completed}>"Remember the milk 🥛"</todo_item>
            <todo_item status={Status.Todo}>"Eggs 🥚"</todo_item>
        </todo_list>
    </div>
    )

In order to actually transform that to a UI representation like HTML you need the sister 👩 package, render_html. A full example implementing a todo-list can be found in todo_pixy

Development

  1. git checkout github.com/pixyverse/pixy.git

  2. cd pixy

  3. create/install deps in a virtualenv environment and activate it.

    make venv
    source .venv/bin/activate
    
  4. lint and typecheck

    make lint
    make pie
    
  5. Run Tests

    # Run Tests
    make test
    
  6. Example Pixy file

    # a.pix
    comp=<div>"Hello World"</div>
    print(comp)
    

    Transpile

    # Transpile a sample pixy file
    python -m pixyverse.pixy -p test.pix -o test.py
    

Known Limitations

Strings within tags always need to be quoted within single or double quotes.

Development Status

Prototype stage. Liable to explode without warning

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

pixyverse_pixy-0.0.8.tar.gz (38.5 kB view hashes)

Uploaded Source

Built Distribution

pixyverse.pixy-0.0.8-py3-none-any.whl (66.9 kB view hashes)

Uploaded Python 3

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