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 async services and code cleanup #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

YouKnow-sys
Copy link

@YouKnow-sys YouKnow-sys commented Oct 2, 2024

In this PR I added a new async services module to use the library in async environment and also improved/cleaned-up the code

Other suggestions:

  • we should stop creating a fake response in case of errors, we should leave the exception handling to user, instead we should return data return type of API as a structured type.
  • we shouldn't force our own logging env to user, user should decide that by themselves.

@mojtabaakbari221b
Copy link
Collaborator

Thanks for your contribution, you have added a lot of interesting things to the project.
I had a few questions:
1- Have you tested your code?
2- The readme should be updated as well. can you do it

@YouKnow-sys
Copy link
Author

Thanks for your contribution, you have added a lot of interesting things to the project. I had a few questions: 1- Have you tested your code? 2- The readme should be updated as well. can you do it

Yes we are using the async service right now in one of our projects, the sync version should be ok as well...
although we can always add some test to make sure all methods are working properly, does sms.ir have any test API that we can use..?
although I still think we can make this better by using a more refined return type, we can maybe return dataclasses that hold API return data?
and as I said we should avoid handling exception all by ourselves, its python that we are talking about, exceptions are part of it...

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