Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the Poetry src layout including the 'open-sustain-tech' module'… #21

Closed
wants to merge 4 commits into from

Conversation

aguennoune
Copy link

An extended Poetry's command-line interface by developing plugins

In response to the open issue, and for better integration and interaction with other tools, the alternative to the usage of a Jupyter notebook is a command-line tool out of the project.

Indeed, this option will allow users to interact with the project from a command line without having to install Jupyter notebooks or other dependencies.

Usage:

From an integrated terminal, the plugin needs to depend on Poetry to interface with it, so you can run the following commands:

poetry install

then,
poetry add open-sustain-tech

or,
pip install open-sustain-tech

Once it's done, and the poetry.lock file installed, you can run:

poetry run python -m open_sustain_tech

or,
poetry run oss-opt

or simply
oss-opt

As presented in the protontypes/AwesomeCure README.md, currently under the Architecture section and as described under Data Acquisition, the oss-opt command-line interface lets your read the Awesome list from any repository as well.

Note: Depending on the size of the list, the processing can take multiple hours.

@Ly0n
Copy link
Member

Ly0n commented Nov 11, 2023

Wow, this looks like a proper overhaul of the previously rather impractical scripts. I'll have a closer look over the weekend. Thanks a lot for supporting this project.

@aguennoune
Copy link
Author

Hi @Ly0n ! AwesomeCure needs Awesome People like you. Thanks to you, i may learn and growth within the right track, and accordingly to the purposes of the Open Sustainability Technologies and such overwhelming perspectives it covers through the Open Source Software Sustainable Areas. So thank you for according me to contribute to such interesting perspectives!

@aguennoune
Copy link
Author

This is an update to the open_sustain_tech command-line interface, and here are the main changes to consider regarding this update:

  • The OpenSustainTech class is a subclass of the Command class from the cleo library. It has a handle method that is used to handle the command when the user executes it. The factory function is a simple function that creates and returns an instance of the OpenSustainTech class. This function is used as a "factory" for creating OpenSustainTech instances.

  • The Options class is a data class (thanks to the @dataclass decorator) that contains options for the command-line parser. It uses the simple_parsing library to define the options and their default values.

  • An ArgumentParser object is created and configured to use the options defined in the Options class. The command-line arguments are then parsed and stored in the args variable.

  • The OSSOptionPlugin class is a subclass of ApplicationPlugin from the poetry library. It has an activate method that is used to register the open_sustain_tech command with the application. It also has a commands property that returns a list of available commands, in this case, an instance of OpenSustainTech.

@aguennoune aguennoune closed this Nov 17, 2023
@aguennoune aguennoune reopened this Nov 17, 2023
@aguennoune aguennoune closed this Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants