GithubHelp home page GithubHelp logo

hustclf / that_is_me_on_github Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 3.0 90 KB

A Python cli for collecting and showing your github contributions as simple and detailed as possible.

Home Page: https://pypi.org/project/that-is-me-on-github/

License: MIT License

Python 98.19% Dockerfile 1.81%
github-api github-contributions python cli click

that_is_me_on_github's Introduction

that_is_me_on_github

PyPI Python 3.6 CircleCI License: MIT Open Source Love svg1

that_is_me_on_github is a Python CLI application used for collect user's github contribution and generate markdown.

demo

Quick Start

Option 1: run with pip

$ pip install that_is_me_on_github
$ that_is_me_on_github generate --username hustclf --org_filter apache --repo_filter hustclf/RateLimiter,ing-bank/flink-deployer,edenhill/kafkacat

A markdown file named that_is_me_on_github.md will be generated under current folder.

Option 2: run with Docker

Notice: docker will create a folder automatically when not exist. To aovid it, We should create an empty file manually.

$ docker pull hustclf/that_is_me_on_github
$ touch ~/result.md
$ docker run -it --rm -v ~/result.md:/usr/src/that_is_me_on_github/that_is_me_on_github.md hustclf/that_is_me_on_github generate --username hustclf --org_filter apache --repo_filter hustclf/RateLimiter,ing-bank/flink-deployer,edenhill/kafkacat

Notice: provided with github auth info:

--auth_username and --auth_password are optional parameters. Without auth info, it is easily to reach the rate limit of github api, you can provide your account to avoid it.

For example:

$ that_is_me_on_github generate --username hustclf --org_filter apache --repo_filter hustclf/RateLimiter,ing-bank/flink-deployer,edenhill/kafkacat \\ 
--do_auth True --auth_username <github_username> --auth_password <github password>

Replace <github_username> and <github_password> with your own.

Development

that_is_me_on_github use pipenv for local development.

1.(Optional) Install pipenv

$ pip install pipenv

2. Build a pipenv environment

$ cd path-to-the-project/
$ pipenv shell

3. Under development.

Pycharm is the recommended ide.

4. Run tests.

$ pytest tests/

that_is_me_on_github's People

Contributors

dependabot[bot] avatar ehwjh2010 avatar hustclf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

that_is_me_on_github's Issues

Handle read timeout exception and retry

The timeout exceptions is as follow:

Traceback (most recent call last):
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1009, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 871, in read
    return self._sslobj.read(len, buffer)
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 631, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/urllib3/connectionpool.py", line 641, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/urllib3/util/retry.py", line 368, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/urllib3/connectionpool.py", line 307, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.github.com', port=443): Read timed out. (read timeout=15)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/bin/that_is_me_on_github", line 11, in <module>
    load_entry_point('that-is-me-on-github==0.0.4', 'console_scripts', 'that_is_me_on_github')()
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/that_is_me_on_github-0.0.4-py3.6.egg/that_is_me_on_github/main.py", line 106, in generate
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/that_is_me_on_github-0.0.4-py3.6.egg/that_is_me_on_github/lib/utils.py", line 72, in issues_and_prs
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/Issue.py", line 203, in repository
    self._completeIfNotSet(self._repository)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/GithubObject.py", line 263, in _completeIfNotSet
    self._completeIfNeeded()
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/GithubObject.py", line 267, in _completeIfNeeded
    self.__complete()
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/GithubObject.py", line 272, in __complete
    self._url.value
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/Requester.py", line 275, in requestJsonAndCheck
    return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url)))
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/Requester.py", line 335, in requestJson
    return self.__requestEncode(cnx, verb, url, parameters, headers, input, encode)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/Requester.py", line 388, in __requestEncode
    status, responseHeaders, output = self.__requestRaw(cnx, verb, url, requestHeaders, encoded_input)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/Requester.py", line 412, in __requestRaw
    response = cnx.getresponse()
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/github/Requester.py", line 114, in getresponse
    r = verb(url, headers=self.headers, data=self.input, timeout=self.timeout, verify=self.verify, allow_redirects=False)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/Users/hustclf/.local/share/virtualenvs/that_is_me_on_github-2-7VgeaU/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.github.com', port=443): Read timed out. (read timeout=15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.