micro-framework for command applications to process data, either in php or python?2019 Community Moderator ElectionCalling an external command in PythonHow do I get the application exit code from a Windows command line?Executing command line programs from within pythonHow to read/process command line arguments?Xcode “Build and Archive” from command lineHow Do You Parse and Process HTML/XML in PHP?PHP framework for building e-commerce site?what i need to consider when building phar file from php application use php framework like laravelLumen Micro Framework => php artisan key:generatehow to remove <?php tag in command line and view laravel
ESPP--any reason not to go all in?
cannot log in to the server after changing SSH port
What would be the most expensive material to an intergalactic society?
How do spaceships determine each other's mass in space?
How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?
Cycles on the torus
What is the "determinant" of two vectors?
Is it appropriate to ask a former professor to order a book for me through an inter-library loan?
Having the player face themselves after the mid-game
Is it a Cyclops number? "Nobody" knows!
What does the Digital Threat scope actually do?
What can I do if someone tampers with my SSH public key?
Why do we say 'Pairwise Disjoint', rather than 'Disjoint'?
What should I do when a paper is published similar to my PhD thesis without citation?
Can the Witch Sight warlock invocation see through the Mirror Image spell?
Gomel chasadim tovim - are there bad chasadim?
Idiom for feeling after taking risk and someone else being rewarded
What does *dead* mean in *What do you mean, dead?*?
Movie: boy escapes the real world and goes to a fantasy world with big furry trolls
Was it really inappropriate to write a pull request for the company I interviewed with?
Why aren't there more Gauls like Obelix?
What will happen if my luggage gets delayed?
What sort of fish is this
How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?
micro-framework for command applications to process data, either in php or python?
2019 Community Moderator ElectionCalling an external command in PythonHow do I get the application exit code from a Windows command line?Executing command line programs from within pythonHow to read/process command line arguments?Xcode “Build and Archive” from command lineHow Do You Parse and Process HTML/XML in PHP?PHP framework for building e-commerce site?what i need to consider when building phar file from php application use php framework like laravelLumen Micro Framework => php artisan key:generatehow to remove <?php tag in command line and view laravel
Here is what I use to build a php command line applications to process data.
These applications are not web applications, they run in command line shell to process some data.
Due to the Legacy reason, I use Laravel php framework.
So I use Laravel "Artisan Development" to build custom commands and then run the commands use
php artisan ...
Laravel is for a web app, but now, I am only using its artisan commands. It seems an overkill, that I install the full version Laravel Framework for this purpose.
But I could not find a good php micro-framework specially to building commands application.
My questions are
- Like Lumen, a micro-framework by Laravel for API, do you have any laravel/php micro-framework for commands you can recommend?
- Or are there any python micro-frameworks for command applications you can recommend? I googled, "Click" is recommended. Any frameworks else?
Thanks!
php python command-line command
add a comment |
Here is what I use to build a php command line applications to process data.
These applications are not web applications, they run in command line shell to process some data.
Due to the Legacy reason, I use Laravel php framework.
So I use Laravel "Artisan Development" to build custom commands and then run the commands use
php artisan ...
Laravel is for a web app, but now, I am only using its artisan commands. It seems an overkill, that I install the full version Laravel Framework for this purpose.
But I could not find a good php micro-framework specially to building commands application.
My questions are
- Like Lumen, a micro-framework by Laravel for API, do you have any laravel/php micro-framework for commands you can recommend?
- Or are there any python micro-frameworks for command applications you can recommend? I googled, "Click" is recommended. Any frameworks else?
Thanks!
php python command-line command
I have one I made if you want it, Github its about as small as it gets, it's like 1 file. Should be pretty easy to use.
– ArtisticPhoenix
Mar 7 at 0:13
add a comment |
Here is what I use to build a php command line applications to process data.
These applications are not web applications, they run in command line shell to process some data.
Due to the Legacy reason, I use Laravel php framework.
So I use Laravel "Artisan Development" to build custom commands and then run the commands use
php artisan ...
Laravel is for a web app, but now, I am only using its artisan commands. It seems an overkill, that I install the full version Laravel Framework for this purpose.
But I could not find a good php micro-framework specially to building commands application.
My questions are
- Like Lumen, a micro-framework by Laravel for API, do you have any laravel/php micro-framework for commands you can recommend?
- Or are there any python micro-frameworks for command applications you can recommend? I googled, "Click" is recommended. Any frameworks else?
Thanks!
php python command-line command
Here is what I use to build a php command line applications to process data.
These applications are not web applications, they run in command line shell to process some data.
Due to the Legacy reason, I use Laravel php framework.
So I use Laravel "Artisan Development" to build custom commands and then run the commands use
php artisan ...
Laravel is for a web app, but now, I am only using its artisan commands. It seems an overkill, that I install the full version Laravel Framework for this purpose.
But I could not find a good php micro-framework specially to building commands application.
My questions are
- Like Lumen, a micro-framework by Laravel for API, do you have any laravel/php micro-framework for commands you can recommend?
- Or are there any python micro-frameworks for command applications you can recommend? I googled, "Click" is recommended. Any frameworks else?
Thanks!
php python command-line command
php python command-line command
edited Mar 6 at 23:26
searain
asked Mar 6 at 22:56
searainsearain
8691017
8691017
I have one I made if you want it, Github its about as small as it gets, it's like 1 file. Should be pretty easy to use.
– ArtisticPhoenix
Mar 7 at 0:13
add a comment |
I have one I made if you want it, Github its about as small as it gets, it's like 1 file. Should be pretty easy to use.
– ArtisticPhoenix
Mar 7 at 0:13
I have one I made if you want it, Github its about as small as it gets, it's like 1 file. Should be pretty easy to use.
– ArtisticPhoenix
Mar 7 at 0:13
I have one I made if you want it, Github its about as small as it gets, it's like 1 file. Should be pretty easy to use.
– ArtisticPhoenix
Mar 7 at 0:13
add a comment |
2 Answers
2
active
oldest
votes
For Python, I definitely recommend Click. It has become the Python library for creating command line tools. It's written/maintained by the author of Flask (currently the #5 most-starred Python repo on GitHub). I use Click all the time when creating command line tools. It has everything most people would need.
Not sure what your definition of a micro-framework is, but Click has no external dependencies and takes up approx. 500 KB (including .pyc files) when I install it. Also, it doesn't really require any boilerplate to setup and start using. So I guess I would call it a micro-framework.
github.com/google/python-fire How about Python Fire? If I am going to run the commands on GCP, would python-fire be a good selection too? due to it is Google supported?
– searain
Mar 7 at 0:53
add a comment |
I made this small library,
https://github.com/ArtisticPhoenix/Cli
Your welcome to use it Or get inspiration from it, basically its a wrapper around getopt()
http://php.net/manual/en/function.getopt.php
getopt — Gets options from the command line argument list
You can get it on composer too:
"require" :
"evo/cli" : "~1.0"
Basic usage is like this:
$Cli = Cli::getInstance();
$Cli->setArgument('h', 'help', 'Show this help document');
//... other arguments
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
And so on.
You can even do it from a PHP config file, which just gets put into setArgument()
~ basically.
//config.php
return [
[
'shortName' => 'h',
'longName' => 'help',
'doc' => 'Show this help document'
]
];
Then
//cli.php
$config = require 'config.php';
$Cli = Cli::getInstance();
$Cli->fromConfig($config);
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
You can also do dynamic validation of the input args like this (with a closure):
$Cli->setArgument('f', 'foo', 'This is just foo, and must always be foo', [
'accept' => function($shortName, $value)
if($value == 'foo') return true;
return false;
]);
The above just returns a Boolean, if the value is good or not. If you return false it will issue an exception, etc. You can also make an argument required like this:
$Cli->setArgument('i', 'input', 'This is input that requires a value', [
'requireValue' => true
]);
And of course you can combine those 2.
There is some documentation on the Github page. It has a few small dependencies, just common stuff that I like to re-use (all in composer). Together it's less then 1000 lines of code. Maybe 20 or 30kb.
I needed to make a small command line thing, and I had this idea...
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55033522%2fmicro-framework-for-command-applications-to-process-data-either-in-php-or-pytho%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
For Python, I definitely recommend Click. It has become the Python library for creating command line tools. It's written/maintained by the author of Flask (currently the #5 most-starred Python repo on GitHub). I use Click all the time when creating command line tools. It has everything most people would need.
Not sure what your definition of a micro-framework is, but Click has no external dependencies and takes up approx. 500 KB (including .pyc files) when I install it. Also, it doesn't really require any boilerplate to setup and start using. So I guess I would call it a micro-framework.
github.com/google/python-fire How about Python Fire? If I am going to run the commands on GCP, would python-fire be a good selection too? due to it is Google supported?
– searain
Mar 7 at 0:53
add a comment |
For Python, I definitely recommend Click. It has become the Python library for creating command line tools. It's written/maintained by the author of Flask (currently the #5 most-starred Python repo on GitHub). I use Click all the time when creating command line tools. It has everything most people would need.
Not sure what your definition of a micro-framework is, but Click has no external dependencies and takes up approx. 500 KB (including .pyc files) when I install it. Also, it doesn't really require any boilerplate to setup and start using. So I guess I would call it a micro-framework.
github.com/google/python-fire How about Python Fire? If I am going to run the commands on GCP, would python-fire be a good selection too? due to it is Google supported?
– searain
Mar 7 at 0:53
add a comment |
For Python, I definitely recommend Click. It has become the Python library for creating command line tools. It's written/maintained by the author of Flask (currently the #5 most-starred Python repo on GitHub). I use Click all the time when creating command line tools. It has everything most people would need.
Not sure what your definition of a micro-framework is, but Click has no external dependencies and takes up approx. 500 KB (including .pyc files) when I install it. Also, it doesn't really require any boilerplate to setup and start using. So I guess I would call it a micro-framework.
For Python, I definitely recommend Click. It has become the Python library for creating command line tools. It's written/maintained by the author of Flask (currently the #5 most-starred Python repo on GitHub). I use Click all the time when creating command line tools. It has everything most people would need.
Not sure what your definition of a micro-framework is, but Click has no external dependencies and takes up approx. 500 KB (including .pyc files) when I install it. Also, it doesn't really require any boilerplate to setup and start using. So I guess I would call it a micro-framework.
answered Mar 7 at 0:38
jnrbsnjnrbsn
1,64211219
1,64211219
github.com/google/python-fire How about Python Fire? If I am going to run the commands on GCP, would python-fire be a good selection too? due to it is Google supported?
– searain
Mar 7 at 0:53
add a comment |
github.com/google/python-fire How about Python Fire? If I am going to run the commands on GCP, would python-fire be a good selection too? due to it is Google supported?
– searain
Mar 7 at 0:53
github.com/google/python-fire How about Python Fire? If I am going to run the commands on GCP, would python-fire be a good selection too? due to it is Google supported?
– searain
Mar 7 at 0:53
github.com/google/python-fire How about Python Fire? If I am going to run the commands on GCP, would python-fire be a good selection too? due to it is Google supported?
– searain
Mar 7 at 0:53
add a comment |
I made this small library,
https://github.com/ArtisticPhoenix/Cli
Your welcome to use it Or get inspiration from it, basically its a wrapper around getopt()
http://php.net/manual/en/function.getopt.php
getopt — Gets options from the command line argument list
You can get it on composer too:
"require" :
"evo/cli" : "~1.0"
Basic usage is like this:
$Cli = Cli::getInstance();
$Cli->setArgument('h', 'help', 'Show this help document');
//... other arguments
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
And so on.
You can even do it from a PHP config file, which just gets put into setArgument()
~ basically.
//config.php
return [
[
'shortName' => 'h',
'longName' => 'help',
'doc' => 'Show this help document'
]
];
Then
//cli.php
$config = require 'config.php';
$Cli = Cli::getInstance();
$Cli->fromConfig($config);
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
You can also do dynamic validation of the input args like this (with a closure):
$Cli->setArgument('f', 'foo', 'This is just foo, and must always be foo', [
'accept' => function($shortName, $value)
if($value == 'foo') return true;
return false;
]);
The above just returns a Boolean, if the value is good or not. If you return false it will issue an exception, etc. You can also make an argument required like this:
$Cli->setArgument('i', 'input', 'This is input that requires a value', [
'requireValue' => true
]);
And of course you can combine those 2.
There is some documentation on the Github page. It has a few small dependencies, just common stuff that I like to re-use (all in composer). Together it's less then 1000 lines of code. Maybe 20 or 30kb.
I needed to make a small command line thing, and I had this idea...
add a comment |
I made this small library,
https://github.com/ArtisticPhoenix/Cli
Your welcome to use it Or get inspiration from it, basically its a wrapper around getopt()
http://php.net/manual/en/function.getopt.php
getopt — Gets options from the command line argument list
You can get it on composer too:
"require" :
"evo/cli" : "~1.0"
Basic usage is like this:
$Cli = Cli::getInstance();
$Cli->setArgument('h', 'help', 'Show this help document');
//... other arguments
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
And so on.
You can even do it from a PHP config file, which just gets put into setArgument()
~ basically.
//config.php
return [
[
'shortName' => 'h',
'longName' => 'help',
'doc' => 'Show this help document'
]
];
Then
//cli.php
$config = require 'config.php';
$Cli = Cli::getInstance();
$Cli->fromConfig($config);
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
You can also do dynamic validation of the input args like this (with a closure):
$Cli->setArgument('f', 'foo', 'This is just foo, and must always be foo', [
'accept' => function($shortName, $value)
if($value == 'foo') return true;
return false;
]);
The above just returns a Boolean, if the value is good or not. If you return false it will issue an exception, etc. You can also make an argument required like this:
$Cli->setArgument('i', 'input', 'This is input that requires a value', [
'requireValue' => true
]);
And of course you can combine those 2.
There is some documentation on the Github page. It has a few small dependencies, just common stuff that I like to re-use (all in composer). Together it's less then 1000 lines of code. Maybe 20 or 30kb.
I needed to make a small command line thing, and I had this idea...
add a comment |
I made this small library,
https://github.com/ArtisticPhoenix/Cli
Your welcome to use it Or get inspiration from it, basically its a wrapper around getopt()
http://php.net/manual/en/function.getopt.php
getopt — Gets options from the command line argument list
You can get it on composer too:
"require" :
"evo/cli" : "~1.0"
Basic usage is like this:
$Cli = Cli::getInstance();
$Cli->setArgument('h', 'help', 'Show this help document');
//... other arguments
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
And so on.
You can even do it from a PHP config file, which just gets put into setArgument()
~ basically.
//config.php
return [
[
'shortName' => 'h',
'longName' => 'help',
'doc' => 'Show this help document'
]
];
Then
//cli.php
$config = require 'config.php';
$Cli = Cli::getInstance();
$Cli->fromConfig($config);
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
You can also do dynamic validation of the input args like this (with a closure):
$Cli->setArgument('f', 'foo', 'This is just foo, and must always be foo', [
'accept' => function($shortName, $value)
if($value == 'foo') return true;
return false;
]);
The above just returns a Boolean, if the value is good or not. If you return false it will issue an exception, etc. You can also make an argument required like this:
$Cli->setArgument('i', 'input', 'This is input that requires a value', [
'requireValue' => true
]);
And of course you can combine those 2.
There is some documentation on the Github page. It has a few small dependencies, just common stuff that I like to re-use (all in composer). Together it's less then 1000 lines of code. Maybe 20 or 30kb.
I needed to make a small command line thing, and I had this idea...
I made this small library,
https://github.com/ArtisticPhoenix/Cli
Your welcome to use it Or get inspiration from it, basically its a wrapper around getopt()
http://php.net/manual/en/function.getopt.php
getopt — Gets options from the command line argument list
You can get it on composer too:
"require" :
"evo/cli" : "~1.0"
Basic usage is like this:
$Cli = Cli::getInstance();
$Cli->setArgument('h', 'help', 'Show this help document');
//... other arguments
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
And so on.
You can even do it from a PHP config file, which just gets put into setArgument()
~ basically.
//config.php
return [
[
'shortName' => 'h',
'longName' => 'help',
'doc' => 'Show this help document'
]
];
Then
//cli.php
$config = require 'config.php';
$Cli = Cli::getInstance();
$Cli->fromConfig($config);
if($Cli->getArgument('h')) $Cli->printHelpDoc(); //exits
You can also do dynamic validation of the input args like this (with a closure):
$Cli->setArgument('f', 'foo', 'This is just foo, and must always be foo', [
'accept' => function($shortName, $value)
if($value == 'foo') return true;
return false;
]);
The above just returns a Boolean, if the value is good or not. If you return false it will issue an exception, etc. You can also make an argument required like this:
$Cli->setArgument('i', 'input', 'This is input that requires a value', [
'requireValue' => true
]);
And of course you can combine those 2.
There is some documentation on the Github page. It has a few small dependencies, just common stuff that I like to re-use (all in composer). Together it's less then 1000 lines of code. Maybe 20 or 30kb.
I needed to make a small command line thing, and I had this idea...
edited Mar 7 at 0:55
answered Mar 7 at 0:43
ArtisticPhoenixArtisticPhoenix
17.2k11224
17.2k11224
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55033522%2fmicro-framework-for-command-applications-to-process-data-either-in-php-or-pytho%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I have one I made if you want it, Github its about as small as it gets, it's like 1 file. Should be pretty easy to use.
– ArtisticPhoenix
Mar 7 at 0:13