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

Implementation of CLI interface #32

Open
ggbaro opened this issue Dec 19, 2023 · 3 comments
Open

Implementation of CLI interface #32

ggbaro opened this issue Dec 19, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ggbaro
Copy link
Contributor

ggbaro commented Dec 19, 2023

Is your feature request related to a problem? Please describe.
As showed in the README concept, we shall make the CLI interface.

Describe the solution you'd like
I usually adopt click, a modern and elegant CLI interface library.

Describe alternatives you've considered

  • click - my favourite
  • Argparse - the built-in python command parser
  • Typer - based on Click (see above), takes it to the next level with modern typed python

Additional context

@ggbaro ggbaro added enhancement New feature or request help wanted Extra attention is needed labels Dec 19, 2023
@ggbaro
Copy link
Contributor Author

ggbaro commented Dec 19, 2023

@LFK01 let's work together on this! What do you think?

@ggbaro ggbaro added the good first issue Good for newcomers label Dec 19, 2023
@LFK01
Copy link
Collaborator

LFK01 commented Dec 20, 2023

Yes, I'm happy to help on this issue. I'll work on this after we have completed the modelling of the matching problem.

In the meantime, I already have some doubts for the future.
How does python modules work when invoked from the CLI?
I'm used to have a main.py file or a file with the if name == 'main' wrapper called to be executed. How will the code of the python module be called?
I have little to no experience in python packaging so I will be satisfied with a partial quick answer and any reference to python documentation. Thank you in advance for the help :)

I asked ChatGPT for help. It suggested to specify an entry point in pyproject.toml or setup.py. I asked also for alternatives and it suggested flit among other third party libraries. Do we have any preference among these possible solutions?

@LFK01
Copy link
Collaborator

LFK01 commented Feb 4, 2024

I've drafted the first version of the CLI in commit b193299 and ba96597. I'd like to receive any comments about the implemented functionalities and its correctness before creating a pull-request.

The command execution requires the package installation can be obtained with the following command inside the cloned repository directory:
pip install -e .
The -e flag allows the developer to change the code and observe the changes without reinstalling the package.
. is the cloned repository directory where pip will search for the pyproject.toml file.

I've tried it locally with the command inside the project folder:
swapanything tests/unit_test/data/faker_availabilities.csv output.csv --headers --index-col --subject-col "Nome e Cognome" --slot-col "Availabilities"

And it should print the selected matches in the file output.csv. Remember to delete or to exclude the file output.csv when committing to the branch or change its path to another position.

Thanks for any help or suggestion :)

@LFK01 LFK01 self-assigned this Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants