{"id":20374928,"url":"https://github.com/gisce/cnmc_client","last_synced_at":"2025-09-23T20:31:47.036Z","repository":{"id":28257386,"uuid":"117242158","full_name":"gisce/cnmc_client","owner":"gisce","description":"CNMC Client","archived":false,"fork":false,"pushed_at":"2024-06-10T16:00:21.000Z","size":96,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-15T01:30:52.515Z","etag":null,"topics":["cnmc","cnmc-client","hacktoberfest","python","ree"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gisce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-12T13:06:18.000Z","updated_at":"2022-03-23T08:02:59.000Z","dependencies_parsed_at":"2022-07-27T13:02:18.231Z","dependency_job_id":null,"html_url":"https://github.com/gisce/cnmc_client","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gisce%2Fcnmc_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gisce%2Fcnmc_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gisce%2Fcnmc_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gisce%2Fcnmc_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gisce","download_url":"https://codeload.github.com/gisce/cnmc_client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233998630,"owners_count":18763681,"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":["cnmc","cnmc-client","hacktoberfest","python","ree"],"created_at":"2024-11-15T01:27:43.203Z","updated_at":"2025-09-23T20:31:41.736Z","avatar_url":"https://github.com/gisce.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CNMC client\n\nIt provides a Python client desired to interact with the CNMC API.\n\n## Usage\n\nSimply configure the KEY and the SECRET as exported environment vars, or attach it at Client initialization time\n\n### ENV vars\n\nJust define the needed ENV vars:\n```\n$ export CNMC_CONSUMER_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx\n$ export CNMC_CONSUMER_SECRET=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx\n\n```\n\n, and instantiate the Client without any parameter:\n\n```\nfrom cnmc_client import Client\nclient = Client()\n``` \n\n### Passed config\n\nInstantiate the Client passing the key and secret oauth tokens:\n\n```python\n\nfrom cnmc_client import Client\n\noauth_config = {\n    'key': \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx\",\n    'secret': \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxx\",\n}\n\nclient = Client(**oauth_config)\n```\n\n## Available methods\n\n- [Test](#test-method)\n- [List](#list-method)\n- [Fetch](#fetch-method)\n- [Download](#download-method)\n\n\n### Test method\nMethod desired to test the connection with the API using the `echoseguro` resource.\n\n```python\nclient.test(message=\"This is a test message!\")\n```\n\n\n### List method\n\nList downloaded files or files able to be downloaded, with the capacity of filter it by:\n- start_date\n- end_date\n- status in [\"DISPONIBLE\", \"DESCARGADO\"]\n\n```python\nSTATUS = \"DISPONIBLE\"\ndate_start = \ndate_end = \n\nclient.list(status=STATUS, date_start=date_start, date_end=date_end)\n```\n\n### Fetch method\n\nDefine the list of CUPS to analyze and the desired file type.\n\nList of types:\n- SIPS2_PS_ELECTRICIDAD\n- SIPS2_CONSUMOS_ELECTRICIDAD\n- SIPS2_PS_GAS\n- SIPS2_CONSUMOS_GAS\n\n```python\nthe_cups = [ \"CUPSA\", \"CUPSB\" ]\nthe_type = \"SIPS2_PS_ELECTRICIDAD\"\n\nclient.fetch(cups=the_cups, file_type=the_type)\n```\n\n\n### Download method\n\n```python\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgisce%2Fcnmc_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgisce%2Fcnmc_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgisce%2Fcnmc_client/lists"}