fluves / pywaterinfo

Python package to download time series data from waterinfo.be
https://fluves.github.io/pywaterinfo/
MIT License
17 stars 9 forks source link

http proxy support #58

Closed stijnvanlooy closed 1 year ago

stijnvanlooy commented 1 year ago

Description

I'm using pywaterinfo behind a company http proxy. It would be nice if pywaterinfo supported the proxies configuration as the underlying requests and requests_cache packages do.

What I Did

I added a proxies argument to the Waterinfo constructor that is then passed to requests. This solved the issue for me. But I haven't tested other use cases. Thus some further modifications might be required. I would be happy to share these (small) code modifications, but it looks like I don't have permission to push new branches to the pywaterinfo repository.

johanvdw commented 1 year ago

In github, you can create pull requests based on your own fork of the repo. Click fork on the top right above, and push to that fork. Then you can use that branch on your fork to create a PR.

This being said: I would expect that setting the environment variables HTTP_PROXY and HTTPS_PROXY may be sufficient to get proxying work. Anyway, if that is the case, a PR to the documentation is also welcome!

stijnvanlooy commented 1 year ago

ow yes: forks! :-) thank you!

Using the environment variables will probably also help. (didn't try)

stijnvanhoey commented 1 year ago

@stijnvanlooy Would be great to have your fix integrated, feel free to ask any support to get your code adjustments integrated. It boils down to forking > create PR to upstream (this repo), but certainly willing to support if you bump into issues.

stijnvanlooy commented 1 year ago

@stijnvanhoey see #59 that fix worked in my use case

stijnvanhoey commented 1 year ago

Fixed by https://github.com/fluves/pywaterinfo/pull/59, closing.