{"id":21840512,"url":"https://github.com/rubiojr/go-datadis","last_synced_at":"2025-08-22T13:05:03.104Z","repository":{"id":57707961,"uuid":"434738714","full_name":"rubiojr/go-datadis","owner":"rubiojr","description":"https://datadis.es Go API client","archived":false,"fork":false,"pushed_at":"2021-12-03T21:46:36.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T15:43:35.376Z","etag":null,"topics":["datadis","endesa","spain"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubiojr.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}},"created_at":"2021-12-03T21:30:29.000Z","updated_at":"2023-06-30T05:37:35.000Z","dependencies_parsed_at":"2022-09-08T10:01:09.566Z","dependency_job_id":null,"html_url":"https://github.com/rubiojr/go-datadis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rubiojr/go-datadis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubiojr%2Fgo-datadis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubiojr%2Fgo-datadis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubiojr%2Fgo-datadis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubiojr%2Fgo-datadis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubiojr","download_url":"https://codeload.github.com/rubiojr/go-datadis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubiojr%2Fgo-datadis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271643468,"owners_count":24795440,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["datadis","endesa","spain"],"created_at":"2024-11-27T21:26:33.099Z","updated_at":"2025-08-22T13:05:03.065Z","avatar_url":"https://github.com/rubiojr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Datadis Go Client\n\n**⚠️ Work in progress, experimental**\n\nGo API to read [Datadis](https://datadis.es) energy consumption info.\n\nYou'll need https://www.datadis.es account to use this package.\n\n## Example\n\n```Go\npackage main\n\nimport (\n        \"fmt\"\n        \"os\"\n        \"time\"\n\n        \"github.com/rubiojr/go-datadis\"\n)\n\n// Fetch datadis last day consumption\nfunc main() {\n        client := datadis.NewClient()\n        client.Login(os.Getenv(\"DATADIS_USERNAME\"), os.Getenv(\"DATADIS_PASSWORD\"))\n        s, err := client.Supplies()\n        if err != nil {\n                panic(err)\n        }\n\n        now := time.Now()\n        year, month, day := now.Date()\n        // Read yesterday's data\n        date := time.Date(year, month, day-1, 0, 0, 0, 0, now.UTC().Location())\n        data, err := client.ConsumptionData(\u0026s[0], date, date)\n        for _, d := range data {\n                fmt.Println(\"CUPS: \", d.Cups)\n                fmt.Println(\"Date: \", d.Date)\n                fmt.Println(\"Time: \", d.Time)\n                fmt.Printf(\"Consumption: %f KWh\\n\", d.Consumption)\n                fmt.Println(\"Obtained Method: \", d.ObtainMethod)\n        }\n}\n```\n\n## Building the command line client\n\n```\nmake\n```\n\n## Using the sample client\n\nExport the datadis username and password as environment variables:\n\n```\nexport DATADIS_USERNAME=\"username here\"\nexport DATADIS_PASSWORD=\"password here\"\n```\n\nRun the client without arguments:\n\n```\n./bin/datadis\n```\n\n## Related\n\n* https://github.com/uvejota/homeassistant-edata\n* https://github.com/rubiojr/go-edistribucion\n* https://github.com/azogue/aiopvpc\n* https://github.com/trocotronic/edistribucion\n* https://github.com/uvejota/edistribucion\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubiojr%2Fgo-datadis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubiojr%2Fgo-datadis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubiojr%2Fgo-datadis/lists"}