octopusR

Package for interacting with the Octopus Energy API

https://github.com/moohan/octopusr

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Package for interacting with the Octopus Energy API

Basic Info
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 2
  • Open Issues: 9
  • Releases: 2
Created over 4 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog Contributing Funding License Code of conduct Codemeta

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# octopusR


[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![CRAN
status](https://www.r-pkg.org/badges/version/octopusR)](https://CRAN.R-project.org/package=octopusR)
[![R-CMD-check](https://github.com/Moohan/octopusR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Moohan/octopusR/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/Moohan/octopusR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/Moohan/octopusR?branch=main)
[![pkgcheck](https://github.com/Moohan/octopusR/workflows/pkgcheck/badge.svg)](https://github.com/Moohan/octopusR/actions?query=workflow%3Apkgcheck)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Moohan/octopusR/badge)](https://scorecard.dev/viewer/?uri=github.com/Moohan/octopusR)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10198/badge)](https://www.bestpractices.dev/projects/10198)


octopusR is an R package that provides access to the [Octopus Energy REST API](https://developer.octopus.energy/rest). With octopusR, you can easily retrieve data from the Octopus Energy API and use it in your R projects, or Shiny dashboards.

If you find this package useful, why not [sponsor me on GitHub](https://github.com/sponsors/Moohan) or sign up for an Octopus Energy account with [my referral code (jolly-bloom-201)](https://share.octopus.energy/jolly-bloom-201)!

## Installation
octopusR can be installed from CRAN.

```r
install.packages("octopusR")
```

If you would like the development version, it can be installed from GitHub, using the `{remotes}` package:

```r
# Install remotes if needed
if (!require("remotes")) install.packages("remotes")
remotes::install_github("moohan/octopusR")
```

## Usage
To use most functions in octopusR, you will need an API key from Octopus Energy, you can find this on the [developer dashboard](https://octopus.energy/dashboard/developer/). Once you have your API key, you can use `set_api_key()` to interactively input and store the API key for the session:

```r
library(octopusR)

# Set your API key
set_api_key()
```

Once you have authenticated with the API, you may also want to set your electric and/or gas meter details.

```r
# Set details for your electricity meter
set_meter_details(meter_type = "electricity")

# Set details for your gas meter
set_meter_details(meter_type = "gas")
```

You can use the other functions in the package to interact with the API. For example, you can use the `get_consumption()` function to retrieve data about your energy usage:

```{r setup, include=FALSE}
library(octopusR)

set_api_key(api_key = octopusR:::testing_key())

set_meter_details(
  meter_type = "electricity",
  mpan_mprn = octopusR:::testing_meter("electricity")[["mpan_mprn"]],
  serial_number = octopusR:::testing_meter("electricity")[["serial_number"]]
)
```

```{r get_consumption}
# Get data about your energy usage
energy_usage <- get_consumption(meter_type = "elec")

# View the data
head(energy_usage)
```

For more information and examples, see the [package documentation](https://moohan.github.io/octopusR/) and the [Octopus Energy API documentation](https://developer.octopus.energy/docs/api/).

## Contributing

If you have suggestions for improving octopusR, or if you have found a
bug, please [open an issue](https://github.com/Moohan/octopusR/issues).
Contributions in the form of pull requests are also welcome. See the
[guide to contributing](https://moohan.github.io/octopusR/CONTRIBUTING.html) for more details.

### Code of Conduct

Please note that the octopusR project is released with a [Contributor
Code of
Conduct](https://moohan.github.io/octopusR/CODE_OF_CONDUCT.html). By
contributing to this project, you agree to abide by its terms.

## License
octopusR is licensed under the MIT License. See LICENSE for more information.

Owner

  • Name: James Hayes (né McMahon)
  • Login: Moohan
  • Kind: user
  • Location: Scotland
  • Company: @Public-Health-Scotland

Principal Information Analyst for PHS (Public Health Scotland).

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "octopusR",
  "description": "A simple wrapper for the 'Octopus Energy' REST API <https://developer.octopus.energy/rest/>. It handles authentication, by storing a provided API key and meter details. Implemented endpoints include 'products' for viewing tariff details and 'consumption' for viewing meter consumption data.",
  "name": "octopusR: Interact with the 'Octopus Energy' API",
  "relatedLink": [
    "https://moohan.github.io/octopusR/",
    "https://CRAN.R-project.org/package=octopusR"
  ],
  "codeRepository": "https://github.com/Moohan/octopusR",
  "issueTracker": "https://github.com/Moohan/octopusR/issues",
  "license": "https://spdx.org/licenses/MIT",
  "version": "1.0.1.9000",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.1.2 (2021-11-01)",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Comprehensive R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "author": [
    {
      "@type": "Person",
      "givenName": "James",
      "familyName": "McMahon",
      "email": "jamesmcmahon0@gmail.com",
      "@id": "https://orcid.org/0000-0002-5380-2029"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "James",
      "familyName": "McMahon",
      "email": "jamesmcmahon0@gmail.com",
      "@id": "https://orcid.org/0000-0002-5380-2029"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=covr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "lubridate",
      "name": "lubridate",
      "version": ">= 0.2.1",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=lubridate"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "spelling",
      "name": "spelling",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=spelling"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "version": ">= 3.0.0",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=testthat"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "askpass",
      "name": "askpass",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=askpass"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "cli",
      "name": "cli",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=cli"
    },
    "3": {
      "@type": "SoftwareApplication",
      "identifier": "glue",
      "name": "glue",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=glue"
    },
    "4": {
      "@type": "SoftwareApplication",
      "identifier": "httr2",
      "name": "httr2",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=httr2"
    },
    "5": {
      "@type": "SoftwareApplication",
      "identifier": "rlang",
      "name": "rlang",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rlang"
    },
    "6": {
      "@type": "SoftwareApplication",
      "identifier": "tibble",
      "name": "tibble",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=tibble"
    },
    "SystemRequirements": null
  },
  "fileSize": "40.506KB",
  "releaseNotes": "https://github.com/Moohan/octopusR/blob/master/NEWS.md",
  "contIntegration": [
    "https://github.com/Moohan/octopusR/actions/workflows/R-CMD-check.yaml",
    "https://app.codecov.io/gh/Moohan/octopusR?branch=main",
    "https://github.com/Moohan/octopusR/actions?query=workflow%3Apkgcheck"
  ]
}

GitHub Events

Total
  • Issues event: 1
  • Watch event: 3
  • Delete event: 31
  • Issue comment event: 101
  • Push event: 87
  • Pull request review comment event: 25
  • Pull request review event: 56
  • Pull request event: 81
  • Fork event: 1
  • Create event: 44
Last Year
  • Issues event: 1
  • Watch event: 3
  • Delete event: 31
  • Issue comment event: 101
  • Push event: 87
  • Pull request review comment event: 25
  • Pull request review event: 56
  • Pull request event: 81
  • Fork event: 1
  • Create event: 44

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 80
  • Total Committers: 4
  • Avg Commits per committer: 20.0
  • Development Distribution Score (DDS): 0.525
Top Committers
Name Email Commits
James McMahon j****n@g****m 38
James McMahon j****0@g****m 30
James McMahon j****n@p****t 7
Moohan M****n@u****m 5
Committer Domains (Top 20 + Academic)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 200 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: octopusR

Interact with the 'Octopus Energy' API

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 200 Last month
Rankings
Forks count: 21.9%
Stargazers count: 28.5%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 36.4%
Downloads: 66.2%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/document.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/lint.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/render-rmarkdown.yaml actions
  • actions/checkout v3 composite
  • peter-evans/create-pull-request v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/style.yaml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • askpass * imports
  • cli * imports
  • glue * imports
  • httr2 * imports
  • tibble * imports
  • covr * suggests
  • spelling * suggests
  • testthat * suggests