Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/10c8/paper
Develop applications for Pythonista using web tools.
https://github.com/10c8/paper
Last synced: about 2 months ago
JSON representation
Develop applications for Pythonista using web tools.
- Host: GitHub
- URL: https://github.com/10c8/paper
- Owner: 10c8
- License: mit
- Created: 2016-10-01T01:09:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-15T17:14:07.000Z (about 8 years ago)
- Last Synced: 2024-08-08T00:44:18.323Z (5 months ago)
- Language: Python
- Homepage:
- Size: 73.2 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - 10c8/paper - Develop applications for Pythonista using web tools. (Python)
README
# Paper
> Develop applications for Pythonista using web tools.Paper is a library that allows Pythonista users to develop aplications using HTML, CSS and JavaScript.
# Usage
Initialize the library:
```python
import paper# Initialize Paper
app = paper.app('./app')# Expose the function 'hello' to the JS API
@app.expose
def hello():
return 'Oh, hi!'# Run your app
app.run()
```Make your app (inside “app” folder):
```htmlPaper
Hello, Paper!
Hello!
function sayHello() {
response = paper.py.hello();
alert(response);
}
```
_Voilá._
# Features
Important:
- [x] Return exceptions to JavaScript instead of crashing the server.
- [ ] Garbage collection for Python objects and references.
- [x] Good performance when working with heavy data.Modules:
- [x] Import Python modules from JavaScript.
- [x] `import x.y`Functions:
- [x] Convert Python built-in functions to JavaScript functions.
- [ ] Call Python function with `kwargs`.
- [ ] Convert a JavaScript function to a Python function.Types:
- [x] Create JavaScript references of Python objects.
- [x] Convert basic Python types to JavaScript equivalents (`int`, `float`, `string`, `complex`, `list`, `dict` and `tuple`).
- [x] Convert basic JavaScript types to Python equivalents (`int`, `float`, `string`, `array` and `object`).
- [x] Create JavaScript objects from Python objects.
- [x] Create Python objects from JavaScript objects.Classes:
- [x] Create Python class instances using JavaScript.
- [x] Convert Python class instances to JavaScript objects.
- [ ] Create Python classes using JavaScript.
- [ ] Expand Python classes using JavaScript.## Contribute
Suggestions, as well as pull requests and bug reports are welcome.## License
MIT