npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mirror_farmos

v0.6.2

Published

Tools aimed at creating and keeping a farmOS mirror up to date, currently focused on mongoDB hosting. There are also extensive tools for data dereferencing, consolidation and simplification.

Downloads

1

Readme

Introduction

The objective of the mongo_mirror is to centralize, transform and serve data from a huge number of discrete and private farmOS instances into a unified, fast, efficient, privacy respectful and versatile database. A mirror allows data operations that would be overly costly, time consuming and privacy harming if done instancywise. This library provides a very simple interface that will allow a mirror to be built from scratch by only providing the adequate security keys and some variables describing the expected behaviour. As the farmOS data structure is fiarly complex to be directly consumed by some applications, this library is also able to consolidate it and de reference it into structures that are as flat as possible without loosing data content or precission. This also makes data analysis easier. The mongo_mirror can optionally supervise the application of as many data pipelines as needed to be applied over this consolidated and simplified dataset, in order to deliver the exact data that each applicatino needs. For example, a first dataset might only have anonimized GPS positions to show in a map the farms

How this library works

Transformations Applied to Entities

  • Entities are mirrored inside a tree structure before dereferencing.

  • Each entity gets a field called related. It contains the entities mentioned in relations. Each one of this entities contains its own related field, the entities look the same when searched directly or as relationships of other related entities.

  • Entities inside related are tagged with a relationship_class attribute. It informs under which relations attribute it was originally stored and allows to distinguis what kind of information should be obtained from it.

  • I traversed the FarmOs UI and identified the source (either an attribute on the main entity or inside a relationship) for each bit of data that is shown there for each type of entity. These are copied into the main entity with appropiate data names as first level object properties, obtained either from attributes on the original main entity or inside any of its related sub entities.

Modules

Nightly Build

Meant to grab information from FarmOS instances and centralize it into a MongoDB unique database.

Main Functions

  • copyFarmToMongo: Provided a farm and a list of types, all entitities for each type are retrieved, tagged with the adequate farmDomain attribute and stored inside raw_entities collection.
  • copyManyFarmsToMongo: Helps iterate through the whole list of farms.

Dereference and Simplify

Meant to reformat the data into a consolidated, as flat as possible without loosing details planting centric database. It assembles whole objects based on FarmOS references attributes so that each object contains directly all of its related information. It employs a set of parsers called Instructions to grab only the data attributes that are relevant from each entity and arrange them in the most possible meaningful way without making wrong structure assumptions.

  • processOneFarm retrieves all entities from raw_entities for a given farm, dereferences them, simplifies them and copies them into simplified_entities.

Coffeeshop Aggregations

Not currently a library.

An aggregation grabs plantings from simplified_entities, attaches events (as they are reverse dependencies) and consolidates planting rows into coffeeshop_full. This is further simplified and stored as coffeeshop_simplified, which is the exact payload the coffeeshop frontend expects.

Declarative Configuration

Where to find the Summaries

Main Branch