Node.js module for creating Feathers.js Backend Services based on Python Scripts
$ npm install --save feathers-python
Given this python-script in 'test/helloWorld.py':
import sys as sys
print("Hello " + sys.argv[1] + "!")
Use this in your Feathers.js App:
const FythonService = require('feathers-python')
// given a feathers-app
app = feathers();
// register a python service to your app
const options = {
scriptPath: 'test/helloWorld.py', // python script to be executed
pythonVersion: 'v2' // python version 'v2' || 'v3'
};
app.use('/pythonScript', new FythonService(options));
// use the python service
service = app.service('pythonScript');
// POST /pythonScript
service.create({
param1: 'Test'
}).then((result) => {
console.log(result); // logs "Hello Test!"
});
// GET /pythonScript
service.find({}).then((result) => {
console.log(result); // logs full content of the python script
});
// PATCH /pythonScript
service.patch(null, { content: 'content'}).then((result) => {
console.log(result); // logs "content", updates python script content on disk
});
- Go into project folder
- run
npm test
We use github-changelog-generator
for updating the Changelog automatically.
$ gem install github_changelog_generator
$ github_changelog_generator -u pinussilvestrus -p feathers-python --no-http-cache
We use np
for releasing new versions
$ npm i -g np
$ np