PHPackages                             sypex/geo - 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. sypex/geo

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

sypex/geo
=========

Sypex deo actualized

0.3.2(4mo ago)24.0k↓84.2%21BSD-2-ClausePHPPHP &gt;=7.1

Since Jan 17Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/gam6itko/sypex-geo)[ Packagist](https://packagist.org/packages/sypex/geo)[ RSS](/packages/sypex-geo/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (9)Used By (1)

sypex/geo
=========

[](#sypexgeo)

Actualized library from .

- composer
- PSR-2
- PSR-4
- `throw` instead of `die`
- tests

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

[](#installation)

```
composer require sypex/geo

```

Download Database file
----------------------

[](#download-database-file)

```
wget https://sypexgeo.net/files/SxGeoCountry.zip
unzip SxGeoCountry.zip
rm SxGeoCountry.zip

wget https://sypexgeo.net/files/SxGeoCity_utf8.zip
unzip SxGeoCity_utf8.zip
rm SxGeoCity_utf8.zip
```

Usage
-----

[](#usage)

```
$filepath = 'SxGeo.dat';
$geo = new Geo($filepath); // by default SxGeo.dat
$geo = new SxGeo($filepath, Mode::BATCH | Mode::MEMORY); // the fastest way

// Get country (SxGeo Country)
//
// 2-letter ISO code of country
$country = $geo->getCountry($ip);
// number of country
$geo->getCountryId($ip);

// get city (SxGeo City, SxGeo City Max)
//
// short information, without region name, country and timezone
$geo->getCity($ip);
// full city information
$geo->getCityFull($ip);
// calls getCountry or getCity depending on the type of base
$city = $geo->get($ip);

// free resource
unset($geo);
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance74

Regular maintenance activity

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.2% 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 ~204 days

Recently: every ~191 days

Total

8

Last Release

142d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3841197?v=4)[Alexander Strizhak](/maintainers/gam6itko)[@gam6itko](https://github.com/gam6itko)

---

Top Contributors

[![gam6itko](https://avatars.githubusercontent.com/u/3841197?v=4)](https://github.com/gam6itko "gam6itko (15 commits)")[![burn1ngbear](https://avatars.githubusercontent.com/u/45151835?v=4)](https://github.com/burn1ngbear "burn1ngbear (1 commits)")[![Sobolos](https://avatars.githubusercontent.com/u/12783052?v=4)](https://github.com/Sobolos "Sobolos (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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