Giter Site home page Giter Site logo

cookiecutter-polars-plugins's Introduction

Polars Plugins Cookiecutter

Image from https://chelsweets.com/polar-bear-cookies

Easily get started with Polars Plugins - get the boilerplate out of the way and start coding!

Usage

First of all, make sure you have cookiecutter installed - see here for how to do that.

Then, suppose you want to create a Polars Plugin called "minimal-plugin". Let's also suppose your name is "Maja Anima".

This is how you would do that:

  1. Install Rust
  2. In your home directory (or wherever you store your projects), run
    cookiecutter https://github.com/MarcoGorelli/cookiecutter-polars-plugins.git
  3. When prompted, enter the following:
    [1/3] plugin_name (My Plugin): Minimal Plugin
    [2/3] project_slug (minimal_plugin):
    [3/3] author (anonymous): Maja Anima
    
  4. Navigate to the directory you just created. For example, if you named your plugin "Minimal Plugin", you would do
    cd minimal_plugin
    
  5. Create and activate a new Python 3.8+ virtual environment, and install Polars and Maturin. For example, if you're on Linux or MacOS and want to use Python3.11, this would be
    python3.11 -m venv .venv
    . .venv/bin/activate
    pip install -U polars maturin
    
  6. Start compiling the Rust code! This may take a few minutes the first time you do it, but subsequent runs will be fast:
    maturin develop  # or, if you're benchmarking, maturin develop --release
    
  7. Try running
    python run.py
    
    If you see
    shape: (5, 2)
    ┌─────────┬───────────┐
    │ english ┆ pig_latin │
    │ ---     ┆ ---       │
    │ str     ┆ str       │
    ╞═════════╪═══════════╡
    │ this    ┆ histay    │
    │ is      ┆ siay      │
    │ not     ┆ otnay     │
    │ pig     ┆ igpay     │
    │ latin   ┆ atinlay   │
    └─────────┴───────────┘
    
    then it means everything worked correctly! If not, please open an issue, happy to help debug.

Now, writing your plugin is a different story...please go to https://marcogorelli.github.io/polars-plugins-tutorial/ for a tutorial on how to get started.

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.