{"id":23350743,"url":"https://github.com/ssenart/pygazpar","last_synced_at":"2025-02-27T01:13:02.637Z","repository":{"id":44470604,"uuid":"202142120","full_name":"ssenart/PyGazpar","owner":"ssenart","description":"Python library to download gas consumption from a Grdf account","archived":false,"fork":false,"pushed_at":"2025-02-15T18:07:38.000Z","size":4495,"stargazers_count":35,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-20T00:15:19.952Z","etag":null,"topics":["consumption","gas","gazpar","grdf","meter","python"],"latest_commit_sha":null,"homepage":null,"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/ssenart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2019-08-13T12:42:11.000Z","updated_at":"2025-02-15T18:07:42.000Z","dependencies_parsed_at":"2025-01-12T15:07:49.464Z","dependency_job_id":"80e5a790-f75f-47af-8ead-302c0a27676f","html_url":"https://github.com/ssenart/PyGazpar","commit_stats":{"total_commits":173,"total_committers":4,"mean_commits":43.25,"dds":"0.023121387283236983","last_synced_commit":"9e14d7fd966074f4f25c6e0b65c652747f3176fd"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssenart%2FPyGazpar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssenart%2FPyGazpar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssenart%2FPyGazpar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssenart%2FPyGazpar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssenart","download_url":"https://codeload.github.com/ssenart/PyGazpar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240959120,"owners_count":19884911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["consumption","gas","gazpar","grdf","meter","python"],"created_at":"2024-12-21T08:18:01.066Z","updated_at":"2025-02-27T01:13:02.409Z","avatar_url":"https://github.com/ssenart.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyGazpar\n\nPyGazpar is a Python library for getting natural gas consumption from GrDF French provider.\n\nTheir natural gas meter is called Gazpar. It is wireless and transmit the gas consumption once per day.\n\nAll consumption data is available on the client account at GrDF Web Site (https://monespace.grdf.fr).\n\nPyGazpar automatically goes through the Web Site and download the consumption data, and make it available in a Python structure.\n\n## Installation\n\n### Requirements\nPyGazpar does not require Selenium and corresponding geckodriver to work.\n\nWith the new GrDF web site, it is possible to load the consumption data far easily than before.\n\nPyGazpar uses [Poetry](https://python-poetry.org/) for dependency and package management.\n\n### Create your virtual environment\n\n```bash\n$ cd /path/to/my_project_folder/\n\n$ poetry install\n```\n\n### PyGazpar installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install PyGazpar.\n\n```bash\npip install pygazpar\n```\n\nYou can also download the source code and install it manually.\n```bash\ncd /path/to/pygazpar/\n\n$ poetry install\n```\n\n## Usage\n\n#### Command line:\n\n1. Standard usage (using Json GrDF API).\n\n```bash\n$ pygazpar -u 'your login' -p 'your password' -c 'your PCE identifier' --datasource 'json'\n```\n\n2. Alternate usage (using Excel GrDF document).\n\n```bash\n$ pygazpar -u 'your login' -p 'your password' -c 'your PCE identifier' -t 'temporary directory where to store Excel file (ex: /tmp)' --datasource 'excel'\n```\n\n3. Test usage (using local static data files, do not connect to GrDF site).\n\n```bash\n$ pygazpar -u 'your login' -p 'your password' -c 'your PCE identifier' --datasource 'test'\n```\n\n#### Library:\n\n1. Standard usage (using Json GrDF API).\n\n```python\nimport pygazpar\n\nclient = pygazpar.Client(pygazpar.JsonWebDataSource(\n    username='your login',\n    password='your password')\n)\n\n# Returns the list of your PCE identifiers attached to your account.\npce_identifiers = client.get_pce_identifiers()\n\n# Returns the daily and monthly consumptions for the last 60 days on your PCE identifier.\ndata = client.load_since(pce_identifier='your PCE identifier',\n                        last_n_days=60,\n                        frequencies=[pygazpar.Frequency.DAILY, pygazpar.Frequency.MONTHLY])\n```\nSee [samples/jsonSample.py](samples/jsonSample.py) file for the full example.\n\n2. Alternate usage (using Excel GrDF document).\n\n```python\nimport pygazpar\n\nclient = pygazpar.Client(pygazpar.ExcelWebDataSource(\n    username='your login',\n    password='your password')\n)\n\n# Returns the list of your PCE identifiers attached to your account.\npce_identifiers = client.get_pce_identifiers()\n\n# Returns the daily and monthly consumptions for the last 60 days on your PCE identifier.\ndata = client.load_since(pce_identifier='your PCE identifier',\n                        last_n_days=60,\n                        frequencies=[pygazpar.Frequency.DAILY, pygazpar.Frequency.MONTHLY])\n```\nSee [samples/excelSample.py](samples/jsonSample.py) file for the full example.\n\n3. Test usage (using local static data files, do not connect to GrDF site).\n\n```python\nimport pygazpar\n\nclient = pygazpar.Client(pygazpar.TestDataSource())\n\ndata = client.load_since(pce_identifier='your PCE identifier',\n                        last_n_days=10,\n                        frequencies=[pygazpar.Frequency.DAILY, Frequency.MONTHLY])\n```\nSee [samples/testSample.py](samples/jsonSample.py) file for the full example.\n\n#### Output:\n\n```json\ndata =\u003e\n{\n  \"daily\": [\n    {\n      \"time_period\": \"13/10/2022\",\n      \"start_index_m3\": 15724,\n      \"end_index_m3\": 15725,\n      \"volume_m3\": 2,\n      \"energy_kwh\": 17,\n      \"converter_factor_kwh/m3\": 11.16,\n      \"temperature_degC\": null,\n      \"type\": \"Mesur\\u00e9\",\n      \"timestamp\": \"2022-12-13T23:58:35.606763\"\n    },\n    ...\n    {\n      \"time_period\": \"11/12/2022\",\n      \"start_index_m3\": 16081,\n      \"end_index_m3\": 16098,\n      \"volume_m3\": 18,\n      \"energy_kwh\": 201,\n      \"converter_factor_kwh/m3\": 11.27,\n      \"temperature_degC\": -1.47,\n      \"type\": \"Mesur\\u00e9\",\n      \"timestamp\": \"2022-12-13T23:58:35.606763\"\n    }\n  ],\n  \"monthly\": [\n    {\n      \"time_period\": \"Novembre 2022\",\n      \"start_index_m3\": 15750,\n      \"end_index_m3\": 15950,\n      \"volume_m3\": 204,\n      \"energy_kwh\": 2227,\n      \"timestamp\": \"2022-12-13T23:58:35.606763\"\n    },\n    {\n      \"time_period\": \"D\\u00e9cembre 2022\",\n      \"start_index_m3\": 15950,\n      \"end_index_m3\": 16098,\n      \"volume_m3\": 148,\n      \"energy_kwh\": 1664,\n      \"timestamp\": \"2022-12-13T23:58:35.606763\"\n    }\n  ]\n}\n```\n\n## Limitation\nPyGazpar relies on how GrDF Web Site is built.\n\nAny change in the Web site may break this library.\n\nWe expect in close Future that GrDF makes available an open API from which we can get safely their data.\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n\n## Project status\nPyGazpar has been initiated for integration with [Home Assistant](https://www.home-assistant.io/).\n\nCorresponding Home Assistant integration custom component is available [here](https://github.com/ssenart/home-assistant-gazpar).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssenart%2Fpygazpar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssenart%2Fpygazpar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssenart%2Fpygazpar/lists"}