AnswerDotAI / ghapi

A delightful and complete interface to GitHub's amazing API
https://ghapi.fast.ai/
Apache License 2.0
626 stars 65 forks source link

Wrong creation date being fetched for github repo using repos.get(owner, repo): Get a repository #108

Open Gagu2 opened 2 years ago

Gagu2 commented 2 years ago

Hi All,

I wanted to get the date on which a github repository is created. However the date which I am getting is not corrrect, for example the repo https://github.com/pandas-dev/pandas/, the intial commit date is 31 Jul 2009, however it is shown as 2010-08-24 by the api.

Following is the code that I have used.

from ghapi.all import GhApi from configparser import ConfigParser

config_parser = ConfigParser() config_parser.read("config.ini") access_token = config_parser["public"].get("access_token")

gh = GhApi(owner="pandas-dev", repo="pandas", token=access_token)

y = gh.repos.get(owner="pandas-dev", repo="pandas")

print(f"Creation date = {y['created_at']}")

The output is:

Creation date = 2010-08-24T01:37:33Z


This creation date is not correct, please let me know how to fetch the correct creation date of the Github repo or date of the intial commit.

Thanks