{"id":16790757,"url":"https://github.com/aritra8438/ecometrics-api","last_synced_at":"2026-02-13T13:01:56.629Z","repository":{"id":176715513,"uuid":"659277598","full_name":"Aritra8438/EcoMetrics-API","owner":"Aritra8438","description":"An API to query population, temperature etc. that returns pretty table and graphs","archived":false,"fork":false,"pushed_at":"2025-12-17T10:23:58.000Z","size":371,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-20T09:49:31.509Z","etag":null,"topics":["api","flask","python"],"latest_commit_sha":null,"homepage":"https://ecometrics-api.onrender.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aritra8438.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-27T13:46:43.000Z","updated_at":"2025-12-17T10:24:01.000Z","dependencies_parsed_at":"2023-07-10T23:30:18.456Z","dependency_job_id":"6d7034bf-ac14-4b61-a470-bc473d42dd77","html_url":"https://github.com/Aritra8438/EcoMetrics-API","commit_stats":null,"previous_names":["aritra8438/ecometrics-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aritra8438/EcoMetrics-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aritra8438%2FEcoMetrics-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aritra8438%2FEcoMetrics-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aritra8438%2FEcoMetrics-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aritra8438%2FEcoMetrics-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aritra8438","download_url":"https://codeload.github.com/Aritra8438/EcoMetrics-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aritra8438%2FEcoMetrics-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29407021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","flask","python"],"created_at":"2024-10-13T08:31:06.034Z","updated_at":"2026-02-13T13:01:56.621Z","avatar_url":"https://github.com/Aritra8438.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EcoMetrics-API\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/Aritra8438/EcoMetrics-API?style=for-the-badge\u0026logo=git\" alt=\"MIT\" /\u003e\u003c/a\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/Aritra8438/EcoMetrics-API?style=for-the-badge\u0026label=Issues\" alt=\"MIT\" /\u003e\u003c/a\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr/Aritra8438/EcoMetrics-API?style=for-the-badge\u0026logo=github\" alt=\"MIT\" /\u003e\u003c/a\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr-closed/Aritra8438/EcoMetrics-API?style=for-the-badge\u0026logo=github\" alt=\"MIT\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://github.com/Aritra8438/EcoMetrics-API/actions/workflows/pytest.yml/badge.svg\" alt=\"MIT\" /\u003e\u003c/a\u003e \u0026nbsp;\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://github.com/Aritra8438/EcoMetrics-API/actions/workflows/pylint.yml/badge.svg\" alt=\"MIT\" /\u003e\u003c/a\u003e \u0026nbsp;\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/Aritra8438/EcoMetrics-API\" alt=\"MIT\" /\u003e\u003c/a\u003e \u0026nbsp;\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/github/commit-activity/w/Aritra8438/EcoMetrics-API\" alt=\"MIT\" /\u003e\u003c/a\u003e \u0026nbsp;\n\u003c/p\u003e\n\nHi, everyone. Welcome to this API.\n\n**An API to query population, GDP per capita by years, countries, etc. that returns pretty tables and graphs.**\n\nThis API has four primary endpoints:\n- json ( `/json` -\u003e Returns JSON response )\n- table ( `/table` -\u003e Returns table response )\n- graph ( `/graph` -\u003e Returns graph response )\n- stats ( `/stats` -\u003e Returns stats response )\n\nIt's a collaborative open-source project Raisa and I did (are doing) as a part of our code submission to Mercor Hackathon. \nWe have exposed all of our APIs in our [API documentation](https://ecometrics-api.onrender.com/api-documentation). Feel free to test APIs there (You will be able to try them on-screen).\n\nThis API might be (extremely!) slow, as both the backend server (deployed on render) and database (hosted on Railway) are deployed using the free plan.\nNevertheless, we tried to optimize the database queries to compensate for that (Apologies!).\n\n## Index:\nTo quickly jump to a subsection, \n\n* [Website](https://github.com/Aritra8438/EcoMetrics-API/tree/main#website)                          \n                \n* [Local Development Setup](https://github.com/Aritra8438/EcoMetrics-API/tree/main#local-development-setup)\n\n* [Github workflows](https://github.com/Aritra8438/EcoMetrics-API/tree/main#workflows)                   \n\n* [Contribution Workflow](https://github.com/Aritra8438/EcoMetrics-API/tree/main#contribution-workflow)\n  \n* [API documentation](https://github.com/Aritra8438/EcoMetrics-API/tree/main#api-documentation)\n\n* [Current works](https://github.com/Aritra8438/EcoMetrics-API/tree/main#current-works)\n\n* [Future plans](https://github.com/Aritra8438/EcoMetrics-API/tree/main#future-plans)\n\n\n## Website:\n\u003ca href=\"https://ecometrics-api.onrender.com/\"\u003e\u003cstrong\u003eOur website is live!\u003c/strong\u003e\u003c/a\u003e\n\u003cbr\u003e\n- The application is hosted on **Render**.\n\u003cbr\u003e\n\u003cimg width=\"944\" alt=\"image\" src=\"https://github.com/Aritra8438/EcoMetrics-API/assets/64671908/6c1114cd-803b-4a63-967f-5fa0274a3ebf\"\u003e\n\n\n## Local Development Setup:\n\n**Note**: You don't currently have database access. We will be working on giving read-only access to all the contributors.\nNevertheless, you can always create your database and populate it with dummy data. Schema is available in the `models.py`.\n\nOpen the terminal at the destination folder:\n\n```console\n# Cloning the repository\ngit clone https://github.com/Aritra8438/EcoMetrics-API.git\n\ncd EcoMetrics-API\n\n# Creating a virtual environment\npip install virtualenv\n\n# linux users\nvirtualenv venv\nsource venv/bin/activate\n\n# Windows users\npython -m virtualenv venv\n./venv\\Scripts\\activate\n\n# Download packages\npip install -r requirements.txt \n```\n\nYour virtual environment should be ready.\n\nTo bring up the server:\n```console\nflask --app api/index run --debug\n```\n\n## Workflows:\n\nThe essential APIs are unit-tested using ```pytest``` and linted using ```pylint```. If you are contributing to this repo, it's recommended that you run ```pytest``` and ```pylint``` before your pull request.\n\n- Open the project folder and run:\n```console\n# run pytest\npytest\npytest -s (to get the output of the tests if you've used print statement inside)\npytest -k test_abc (to run a particular test)\n\n# run pylint\npip install pylint (Required to run once)\npylint $(git ls-files '*.py')\n```\nAlternatively, you can search [Pylint](https://marketplace.visualstudio.com/items?itemName=ms-python.pylint) at the extension marketplace (in VSCode) and install the linter. The lint errors will be highlighted if Pylint is installed.\n\nCurrently, All the tests are linked to `client` @pytest.fixture, which is in `conftest.py`. If you have made changes to the backend, we recommend adding a pytest for it.\n\nWe have enabled `codecov` and `dependabot` for this repo. To learn about the workflows, please visit the corresponding `.yml` files.\n\n## Contribution Workflow:\n\nHello contributors, here is the contribution guideline you should follow:\n\n- **First, create a fork of this repo. (Available at the top right corner of the repo)** \n\n- Go to the forked repository and **Clone the fork of your repo to the destination folder**.\n```console\n$ git clone https://github.com/YOUR_USERNAME/YOUR_FORK.git\n\n```\n- Navigate to the Project repository\n```console\n$ cd EcoMetrics-API\n```\n- Add Upstream to your clone\n\n```console\n$ git remote -v\n\u003e origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)\n\u003e origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)\n```\n```console\n$ git remote add upstream https://github.com/Aritra8438/EcoMetrics-API.git\n```\n\n```console\n$ git remote -v\n\u003e origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)\n\u003e origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)\n\u003e upstream  https://github.com/Aritra8438/EcoMetrics-API.git (fetch)\n\u003e upstream  https://github.com/Aritra8438/EcoMetrics-API.git (push)\n```\n- Before making any changes, sync your origin with upstream \n\n```console\n$ git pull upstream main --rebase\n``` \n\n\n- Make some changes to the project. After that, open a new branch and commit the changes.\n\n```console\n$ git checkout -b \u003cnew_branch\u003e\n$ git add .\n$ git commit -m \"Commit message\"\n$ git push origin \u003cnew branch\u003e\n``` \n\n- There will be a visible change in your repo, click on that and create a new pull request.\n\nThank you for your contribution.\n\n## API Documentation:\n\nAll of our APIs are available at [this](https:/ecometrics-api.onrender.com/api-documentation) documentation. The documentation has a minimum design (Apologies!) but we intend to keep it as it is because **It enables on-screen testing with HTML response**.\n\nHere is a screenshot of the same.\n\n\u003cimg width=\"960\" alt=\"image\" src=\"https://github.com/Aritra8438/EcoMetrics-API/assets/64671908/17d13fe3-ce00-45fe-a286-a675d52f2a8d\"\u003e\n\n\n## Current works:\n\n- [x] Support for `population` database.\n- [x] Support for effective querying.\n- [x] Support for `GDP per capita` database.\n- [x] Support for comparing data from different databases.\n- [x] Support for the `Forest Area percentage` database.\n- [ ] Support for `Annual average temperature` database.\n\n\n## Future plans:\n- [ ] Support for predicting data when input has future years  as input.\n- [ ] Support for extremely user-friendly and customizable graphs.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faritra8438%2Fecometrics-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faritra8438%2Fecometrics-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faritra8438%2Fecometrics-api/lists"}