PHPackages                             balsama/coronadatascraperclient - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. balsama/coronadatascraperclient

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

balsama/coronadatascraperclient
===============================

Client for the coronadatascraper.com dataset.

v1.x-dev(5y ago)014[2 PRs](https://github.com/balsama/coronadatascraperclient/pulls)GPL-2.0-or-laterPHPPHP ^7.3

Since Apr 1Pushed 3y ago1 watchersCompare

[ Source](https://github.com/balsama/coronadatascraperclient)[ Packagist](https://packagist.org/packages/balsama/coronadatascraperclient)[ RSS](/packages/balsama-coronadatascraperclient/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (4)Versions (11)Used By (0)

CaronoDataScraper Client
========================

[](#caronodatascraper-client)

PHP Client for the caronadatascraper.com timeseries-byLocation.json data set.

See  and that project's repo here:

Usage
-----

[](#usage)

Include in your project:

```
$ composer require balsama/caronadatascraperclient

```

### `RegionsBase`

[](#regionsbase)

Instantiating `RegionsBase` will get the latest info from caronadatascraper.com and format it into predicatble `Region`objects:

```
$regionsBase = new Balsama\RegionsBase();
```

RegionsBase has two public methods for getting Regions:

```
$regionsBase = new Balsama\RegionsBase();

// Get all regions:
$regions = $regionsBase->getRegions();

// Get a specific region:
$spain = $regionsBase->getRegion('ESP');

// Regions include countries, states, counties, and cities.
// States:
$kentucky = $regionsBase->getRegion('KY/ USA');
$newSouthWales = $regionsBase->getRegion('South Australia/ AUS');
$bugei = $regionsBase->getRegion('Hebei/ CHN');

// Counties:
$westchesterCoNy = $regionsBase->getRegion('Westchester County/ NY/ USA');
$lafayetteParishLa = $regionsBase->getRegion('Lafayette Parish/ LA/ USA');

// Cities:
$quebec = $regionsBase->getRegion('Quebec/ CAN');

// Inspect the keys of the array of Region objects returned by $regionBase->getResgions for a complete list of regions.
```

There are also some shortcut methods for getting arrays of Regions.

```
$regionsBase = new Balsama\RegionsBase();

// Get all US States
$usStates = $regionsBase->getCountrysStates('USA');
```

### `Region`

[](#region)

You can use the public methods on a specific Region class to get information about that region:

```
$regionsBase = new Balsama\RegionsBase();
$spain = $regionsBase->getRegion('ESP');

// Basic information:
$spain->getName(); // The name of the region.
$spain->getType(); // The type, either country, state, county, or city.
$spain->getCountry(); // The country to which the region belongs.
$spain->getLatestCount(); // The latest count of cumulative positive test results.
$spain->getLatestDeaths(); // The latest count of cumulative deaths.

// US Counties have a FIPS number.
$lafayetteParishLa = $regionsBase->getRegion('Lafayette Parish/ LA/ USA');
$lafayetteParishLa->getFips(); // The FIPS code for the county.

// Sets of numbers:
// An array of all available positive cases counts keyed by the timestamp of the day of the count.
$spain->getCases();
// An array of all death count keyed by the timestamp of the day of the count.
$spain->getDeaths();
// An array of all discharged count data keyed by the timestamp of the day of the count.
$spain->getDischarged();
// An array of the percentage pf the population which has tested positive keyed by the day of the count.
$spain->getPercentages();
// `getPercentages()` takes an optional argument to get the same for deaths instead of cases.
$spain->getPercentages('deaths');
// An array of numbers representing the number of positive test cases per 100,000 people in the region. The $n argument
// strips values less than $n. So if you want to see the trajectory of a region once it has reached 10 in 100,000 cases
// you would pass `10` as $n.
$spain->getPer100kAboveN(10);
```

### `Utilities`

[](#utilities)

There is also a Utilities class that allows you to export information gathered to a CSV suitable for using with a graphing tool. It's fairly limited now and specific to my use case.

```
$regionsBase = new Balsama\RegionsBase();
$usStates = $regionsBase->getCountrysStates('ESP');
$usStatesPer100kAbove10 = [];
foreach ($usStates as $stateName => $state) {
    $usStatesPer100kAbove10[$stateName] = $state->getPer100kAboveN(10);
}

// The `writeCsvTableFromData` method expects the data to be in an array keyed by the region.
Balsama\Utilities::writeCsvTableFromData($usStatesPer100kAbove10);
```

See scripts/examples.php for a few examples.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Recently: every ~52 days

Total

7

Last Release

2015d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6073b94ae2519d22681a73ae734eff3d679543ea15bcae3a2d4dbcb271ca9ac?d=identicon)[balsama](/maintainers/balsama)

---

Top Contributors

[![balsama](https://avatars.githubusercontent.com/u/1536654?v=4)](https://github.com/balsama "balsama (21 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/balsama-coronadatascraperclient/health.svg)

```
[![Health](https://phpackages.com/badges/balsama-coronadatascraperclient/health.svg)](https://phpackages.com/packages/balsama-coronadatascraperclient)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k17](/packages/civicrm-civicrm-core)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
