Giter Site home page Giter Site logo

turtletopia / woodendesc Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 18.12 MB

Get the available packages and their version codes as well as their dependencies from any R repository with unified API.

Home Page: https://turtletopia.github.io/woodendesc/

License: GNU General Public License v3.0

R 100.00%
dependencies r unified-api available-packages available-versions

woodendesc's People

Contributors

dominikrafacz avatar erdaradungaztea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

woodendesc's Issues

Handle 403 error with GitHub

Exceeded rate limit is a different error to 404, so inform the user properly. In fact, handle all kinds of errors properly.

Add functions for core packages

The best bet is probably to use installed.packages(priority = "base"). The implementations would be as follows:

wood_core_packages <- function() {
  rownames(installed.packages(priority = "base"))
}

wood_core_version <- function(package) {
  installed.packages(priority = "base")[package, "Version"]
}

wood_core_dependencies <- function(package) {
  # Some function that extracts dependencies here
  extract_dependencies(installed.packages(priority = "base")[package, ])
}

Plus some argument checks, docs, and tests; obviously.

Implement functions for Github

If the tags can be considered equal to releases, then it should be non-trivial to implement packages, versions, and dependencies. The username should be a requirement similar to the universe for R-universe.

Side note, check other version control systems, maybe they are implementable too?

  • github_packages()
  • github_tags()
  • github_versions() (by checking DESCRIPTION files for each tag)
  • github_latest() (would return version code for the current commit; not a tag)
  • github_dependencies() (for any tag)

Branch name is required to extract DESCRIPTION, which is needed for both version and dependencies, but it is possible to try and guess branch name first (master or main) and only make query to user repo data for main branch name if no success. If DESCRIPTION not found even then, throw an error and suggest making an issue (maybe DESCRIPTION is in a different path?).

It is also possible to save pagination data when reading repos for a user. The first reading must be done from the first page, as we don't know how many pages there are. However, when searching for e.g. main branch name of a repository, we could stop iterating through pages after finding the package. We'd have to keep track of page read time (perhaps use page as cache path parameter?).

Implement `squash.wood_dep_list()`

It would merge all data frames (wood_deps) in a list into one long data frame with additional column telling which package is it. The problem is, what should it be called? package is taken already.

Implement functions for Gitlab

It has a similar structure to GitHub, so perhaps there should be a general structure for repositories, if they have the same features.

As for DESCRIPTION file, it's available raw through e.g. https://gitlab.com/r-packages/rock/-/raw/dev/DESCRIPTION for package rock.

Implement missing tests

  • wood_versions()
  • wood_dependencies()
  • squash()
  • filter_dependencies()
  • github_tags()
  • github_versions()
  • github_latest()
  • interpret_repos()
  • query_maker()
  • print.wood_deps()
  • print.wood_dep_squashed()
  • print.wood_dep_list()
  • summary.wood_deps()
  • summary.wood_dep_squashed()
  • summary.wood_dep_list()

Implement namespace functions

Add another type of functions, wood_xxx_namespace(). They would extract both exports and imports from NAMESPACE file. The return object would have a class so that several methods could be implemented (e.g. extraction of exported names, squashing several namespaces, etc.).

Why though? Because I've got a plan for a package and it would work better to place this functionality in woodendesc.

Not needed for the release, might wait until update to plan the API better.

Add argument checks

All the checks of type length(param) == 1, typeof(param) == "character", etc...

  • bioc
  • core
  • cran
  • github
  • local
  • runiverse
  • url
  • wood
  • filter_dependencies()
  • squash()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.