poofjunior / inpromptu Goto Github PK
View Code? Open in Web Editor NEWa library for automatically inferring interactive prompts
License: MIT License
a library for automatically inferring interactive prompts
License: MIT License
Add option to print stack trace instead of just printing the exception.
The current version prints the error without context, which feels a bit like the error hiding antipattern.
It would be nice to display floats or data structures containing floats to a particular amount of precision, rather than simply taking the default.
Create an option such that we don't raise an exception for callable attributes that can't be turned into UI commands.
Currently, all functions are collected from all parent classes and presented together as one flat set of options. Consider a means of presenting them grouped by the class that inherits them.
Example 1:
Parent Class Methods:
function_a function_b function_c
Child Class Methods:
function_d function_e function_f
Currently only @property
decorators, which create "getters" are supported, but "setters" are not.
Doing so wouldn't take too much effort. The only edge case arises when our setter has a default argument.
@property
def greeting(self):
return self.the_greeting
@greeting.setter
def greeting(self, new_greeting: str = ""):
self.the_greeting = new_greeting
When we run the greeting
command in the prompt with no arguments, are we "getting" the value or "setting" the value to the default value? We'll need to be explicit about this in the docs.
This line:
https://github.com/Poofjunior/inpromptu/blob/master/inpromptu/inpromptu.py#L379
naively converts the string to the type specified. This works for ints and floats, but breaks pretty badly for bools.
We should also handle enums that have a string representation.
Literal types are type hints that produce a specific set of hinted values for parameters. These should be tab-completable (within reason).
See PEP-586
from typing import Literal, get_args
valid_modes = Literal['r', 'w']
get_args(valid_modes)
should return
('r', 'w')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.