Giter Club home page Giter Club logo

Comments (4)

devraj avatar devraj commented on August 15, 2024

There's a feature request to make the library async see #18 however if the cli uses typer (which in turn uses click) then we should ensure that it is possible to use the library inside of the cli.

See also: fastapi/typer#88

from gallagher.

devraj avatar devraj commented on August 15, 2024

See the rich pretty print protocol to provide the highlighting syntax from the __repr__ method

from gallagher.

devraj avatar devraj commented on August 15, 2024

typer allows checking for environment vars before the cli is executed. Their basic example

import typer
from typing_extensions import Annotated


def main(name: Annotated[str, typer.Argument(envvar="AWESOME_NAME")] = "World"):
    print(f"Hello Mr. {name}")


if __name__ == "__main__":
    typer.run(main)

does not highlight how to use this feature when designing commands and sub commands. We ought to research this via discussions before we head into implementing it.

Our basic requirement is to have the GACC_API_KEY environment variable set to the Gallagher API key, which is set to the api_key property of the package.

from gallagher.

devraj avatar devraj commented on August 15, 2024

We use rich to display most of our output, here's are some handy rich commands that will help explore it's features:

poetry run python -m rich.spinner

Get a list of spinners that are available in rich

poetry run python -m rich.live

Get a demo of displaying live data (handy for polling requests #19)

poetry run python -m rich.progress

See the thinking example from for use with #19

poetry run python -m rich.status

To get some COVID jokes

from gallagher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.