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

Rewrite Output Functions for better naming and organization #7

Open
erewok opened this issue Nov 10, 2017 · 0 comments
Open

Rewrite Output Functions for better naming and organization #7

erewok opened this issue Nov 10, 2017 · 0 comments

Comments

@erewok
Copy link
Owner

erewok commented Nov 10, 2017

So, I have been thinking about this library and I think I'd like to make the output functions a little more usable. I had the following ideas:

  1. Build Class definitions for URLs where the route is totally common but there are different methods, something like this:
class SomeRoute:
    def __init__(self):
      self.url = "some/url/{param1}/etc"
      pass
    def get(self, param1):
      return requests.get(self.url.format(param1=param1))
   def post(self, param1, payload):
      etc.
  1. Instead of (or in addition to) the above, we could also separate functions into modules so that you can do something like dotted function call:
import some_url_client

some_url_client.get()

The default way of naming functions creates really long functions, so we need something consistent that also creates an API that's not ultimately painful to use.

I'll experiment and try to see what'll work best.

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

No branches or pull requests

1 participant