PHPackages                             smartdata/smartdata - 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. [Database &amp; ORM](/categories/database)
4. /
5. smartdata/smartdata

ActiveLibrary[Database &amp; ORM](/categories/database)

smartdata/smartdata
===================

Data from Open Data providers compiled into easy to use PHP objects

1.0.1(9y ago)962MITPHPPHP &gt;=5.6.0

Since Mar 6Pushed 9y ago2 watchersCompare

[ Source](https://github.com/mysmartdata/php-smartdata)[ Packagist](https://packagist.org/packages/smartdata/smartdata)[ Docs](https://github.com/geobase/php-countries)[ RSS](/packages/smartdata-smartdata/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

[![](https://camo.githubusercontent.com/69d98ab7880a507173ba7e4c50662aed6fa570e1ead66a58aa99d214c1eb6671/68747470733a2f2f63646e2e7261776769742e636f6d2f67656f626173652f636f756e74726965732f6d61737465722f6c6f676f2e706e67)](https://camo.githubusercontent.com/69d98ab7880a507173ba7e4c50662aed6fa570e1ead66a58aa99d214c1eb6671/68747470733a2f2f63646e2e7261776769742e636f6d2f67656f626173652f636f756e74726965732f6d61737465722f6c6f676f2e706e67)

 [![Build Status](https://camo.githubusercontent.com/c42ce68fc5121644a3123fd06b5b46508450922453b672dcbeae180c5c97c116/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f67656f626173652f7068702d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/geobase/php-countries) [![StyleCI](https://camo.githubusercontent.com/8e0730a5c306d7a6c94a3f09ac7311e9c10e596a079f64a955884eac50444d5e/68747470733a2f2f7374796c6563692e696f2f7265706f732f32363639323536312f736869656c64)](https://styleci.io/repos/26692561) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/01227759670458a5ba6ab516c3b58a59b5205044b362bc8f3482c56b8bed1c3d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f67656f626173652f7068702d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/geobase/php-countries/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/26bf1b6fe4320b6e6dbd85094e6036255c938337e0be43e6ddf503700cd66973/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f67656f626173652f7068702d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/geobase/php-countries/?branch=master) [![Code Climate](https://camo.githubusercontent.com/b0329e822750431bbf63e31f9e41308944dfd3e39bc276fb51f5fe753c7abe1e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f67656f626173652f7068702d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/geobase/php-countries) [![Latest Stable Version](https://camo.githubusercontent.com/c6b77808945a45f18662a535f7ae1126b5d6c7860f44f3a592260625404530c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656f626173652f636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/geobase/countries)

Data from Open Data providers compiled into easy to use PHP objects Edit

1. [Features](#features)
2. [Sources](#sources)
3. [Requirements](#requirements)
4. [Installation](#installation)
5. [Country](#country)
6. [Region](#region)

Features
--------

[](#features)

- Multiple languages (Currently only supports English, French and German).
- Country Database
- Region Database (Currently only for Canada and the United States).

Sources
-------

[](#sources)

- [GeoNames](http://www.geonames.org/)
- [Wikipedia](http://en.wikipedia.org/)
- [OpenStreetMap](http://www.openstreetmap.org/)

Requirements
------------

[](#requirements)

This library does not require a database, but instead, uses JSON files.

This library uses PHP 5.6+.

Installation
------------

[](#installation)

You need to install the library through composer. To do so, use the following command

```
composer require geobase/countries

```

Country
-------

[](#country)

Database of all countries in the world.

**Properties**

- Names
- Short Code (Alpha-2 code)
- Code (Alpha-3 code)
- Latitude
- Longitude
- Bounding Box
- Currency
- Continent
- Population
- Area
- Capital
- Timezone

**Examples**

Get a list of all countries.

```
use GeoBase\Country\CountryRepository;
$countryCollection = CountryRepository::findAll();
```

Get country name in english.

```
foreach ($countryCollection as $country) {
   echo $country->getNames()->get('en');
}
```

Order by country name in english.

```
$countryCollection->orderByName();
```

Region
------

[](#region)

Database of all States, Federal Districts and Territories in the United States, Provinces and Territories in Canada.

**Properties**

- Name
- Code (Alpha-2 code)
- Country
- Type
- Latitude
- Longitude
- Bounding Box

**Examples**

Get a list of all regions in the US.

```
use GeoBase\Country\CountryRepository;
use GeoBase\Regions\RegionRepository;

$country = CountryRepository::findByCode('US');
$regionCollection = RegionRepository::findByCountry($country);
```

Get region name and type in english.

```
foreach ($regionCollection as $region) {
   echo $region->getNames()->get('en') . " is a " .
       $region->getType()::class . " of the " .
       $country->getNames()->get('en);
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~0 days

Total

2

Last Release

3360d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/16da21493b0b4450c73b573cb968d1e53a084fd2f0b0847f039cfdf9336b39c9?d=identicon)[smartdata](/maintainers/smartdata)

---

Top Contributors

[![gabrielbull](https://avatars.githubusercontent.com/u/671923?v=4)](https://github.com/gabrielbull "gabrielbull (9 commits)")

---

Tags

geoipdatadatabasegeolocationstatecountryregionprovince

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[maxmind-db/reader

MaxMind DB Reader API

69699.2M47](/packages/maxmind-db-reader)[annexare/countries-list

Continents &amp; countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital, currency, native name, phone. JSON, CSV and SQL.

1.3k220.8k1](/packages/annexare-countries-list)[khsing/world

Provide countries, states, and cities relations database.

461146.3k1](/packages/khsing-world)[basho/riak

Official Riak client for PHP

159246.7k7](/packages/basho-riak)[archon/dataframe

Archon: PHP Data Analysis Library

9824.2k1](/packages/archon-dataframe)[epigra/trgeozones

Türkiye İl İlçe Semt Muhit Mahalle ve Posta Kodları Laravel Paketi. Adds Turkish Geographical Zones Support to your project including Cities, Districts and Countries in Turkish

8820.3k](/packages/epigra-trgeozones)

PHPackages © 2026

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