pic

pico

Pico is a very small web application framework for Python.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

175

Maintenance

Last Commit

1yr ago

Contributors

6

Package

Dependencies

3

License

Categories

Readme

Install

pip install --upgrade pico

Write a Python module:

# example.py
import pico
from pico import PicoApp


@pico.expose()
def hello(who):
    s = "hello %s!" % who
    return s


@pico.expose()
def goodbye(who):
    s = "goodbye %s!" % who
    return s


app = PicoApp()
app.register_module(__name__)

Start the server:

python -m pico.server example

Call your http api functions from with any http client:

curl http://localhost:4242/example/hello/?who="fergal"

curl http://localhost:4242/example/goodbye/?who="fergal"

Using the Javascript client:

<!DOCTYPE HTML>
<html>
<head>
  <title>Pico Example</title>
    <!-- Load the pico Javascript client, always automatically available at /pico.js -->
    <script src="/pico.js"></script>
     <!-- Load our example module -->
    <script src="/example.js"></script>
</head>
<body>
  <p id="message"></p>
  <script>
  var example = pico.importModule('example')
  example.hello("Fergal").then(function(response){
    document.getElementById('message').innerHTML = response;  
  });
  </script>
</body>
</html>

Using the Python client:

import pico.client

example = pico.client.load('http://localhost:4242/example')
example.hello('World')

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100