PHPackages                             stormcode/swotphp - 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. stormcode/swotphp

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

stormcode/swotphp
=================

Identify email addresses or domains names that belong to colleges or universities.

v1.2.1(11mo ago)020.0k↓26.2%MITPHPPHP &gt;=8.1

Since Jan 15Pushed 11mo agoCompare

[ Source](https://github.com/xTermy/studentMailVerifier)[ Packagist](https://packagist.org/packages/stormcode/swotphp)[ Docs](https://github.com/mdwheele/swotphp)[ RSS](/packages/stormcode-swotphp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Swot PHP 🍎
==========

[](#swot-php-apple)

[![Build Status](https://camo.githubusercontent.com/3d02b8ff94742e925d94b99a28ec5b0000c8cdbf02fde48e37621ad03058fe95/68747470733a2f2f7472617669732d63692e6f72672f6d64776865656c652f73776f747068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mdwheele/swotphp) [![Latest Stable Version](https://camo.githubusercontent.com/4aa813bb46a4cffe5260068bc594eef4688ebc35370f03b38c5b937c05f4ebea/68747470733a2f2f706f7365722e707567782e6f72672f6d64776865656c652f73776f747068702f762f737461626c652e737667)](https://packagist.org/packages/mdwheele/swotphp) [![Total Downloads](https://camo.githubusercontent.com/f8919f10d349004b46954a2080347ed4f47386e144a53883b4668cdc53b82aa6/68747470733a2f2f706f7365722e707567782e6f72672f6d64776865656c652f73776f747068702f646f776e6c6f6164732e737667)](https://packagist.org/packages/mdwheele/swotphp) [![License](https://camo.githubusercontent.com/1010a5e5dd64475c8fe90514ac37e11ecaefb286ed30213f9747037bd57efcb2/68747470733a2f2f706f7365722e707567782e6f72672f6d64776865656c652f73776f747068702f6c6963656e73652e737667)](https://packagist.org/packages/mdwheele/swotphp)

This is a port of the popular Ruby Gem, "Swot". As such, please do NOT make data contributions to this repository. Contribute any new academic domain names to the Ruby version of this package at . Please follow the [contribution guidelines](https://github.com/leereilly/swot/blob/master/CONTRIBUTING.md) noted on Lee's repository.

I will be pulling changes to upstream domain data.

> If you have a product or service and offer **academic discounts**, there's a good chance there's some manual component to the approval process. Perhaps `.edu` email addresses are automatically approved because, for the most part at least, they're associated with American post-secondary educational institutions. Perhaps `.ac.uk` email addresses are automatically approved because they're guaranteed to belong to British universities and colleges. Unfortunately, not every country has an education-specific TLD (Top Level Domain) and plenty of schools use `.com`or `.net`.

> Swot is a community-driven or crowdsourced library for verifying that domain names and email addresses are tied to a legitimate university of college - more specifically, an academic institution providing higher education in tertiary, quaternary or any other kind of post-secondary education in any country in the world.

### Installation

[](#installation)

Install through Composer.

```
"require": {
    "stormcode/swotphp": "1.0"
}
```

### Usage

[](#usage)

The easiest way to get started with SwotPHP is to use a facade to access functionality. However, the base implementation is present as a plain ol' PHP object in case developers want control over the construction themselves. The implementation has an injected dependency on [PHP Domain Parser](https://github.com/jeremykendall/php-domain-parser), an implementation of a URL parser backed by the [Public Suffix List](http://publicsuffix.org).

Framework-specific facades / service providers may be added later. The native facade is a good example of how the object should be instantiated.

**Native**

```
require_once('vendor/autoload.php');

use SwotPHP\Facades\Native\Swot;
```

#### Verify Email Addresses

[](#verify-email-addresses)

```
Swot::isAcademic('lreilly@stanford.edu')           # true
Swot::isAcademic('lreilly@strath.ac.uk')           # true
Swot::isAcademic('lreilly@soft-eng.strath.ac.uk')  # true
Swot::isAcademic('pedro@ugr.es')                   # true
Swot::isAcademic('lee@uottawa.ca')                 # true
Swot::isAcademic('lee@leerilly.net')               # false
```

#### Verify Domain Names

[](#verify-domain-names)

```
Swot::isAcademic('harvard.edu')              # true
Swot::isAcademic('www.harvard.edu')          # true
Swot::isAcademic('http://www.harvard.edu')   # true
Swot::isAcademic('http://www.github.com')    # false
Swot::isAcademic('http://www.rangers.co.uk') # false
```

#### Find School Names

[](#find-school-names)

```
Swot::schoolName('lreilly@cs.strath.ac.uk') -> "University of Strathclyde"
Swot::schoolName('http://www.stanford.edu') -> "Stanford University"
```

### Known Issues

[](#known-issues)

- Lack of automated data import from Ruby gem's domain list.
- There are architectural issues with the package resultant from differences in PHP and Ruby-isms. When I get time, there are two areas I'd like to focus on:
    1. Consolidate some of how the internal API flows while maintaining public interface.
    2. Implement a different mode of accessing the public suffix registry. Currently, the package is possibly abusing an excellent [URL parser](https://github.com/jeremykendall/php-domain-parser) and I'd like to investigate the possibility of a separate component dedicated to modeling the Public Suffix registry's ruleset and algorithms.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance51

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

4

Last Release

348d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/739a5adcbf0a73eea3e986c7f19fe4060cac0b903f496b9ae83e9d4fed69fc02?d=identicon)[StormCode](/maintainers/StormCode)

---

Top Contributors

[![xTermy](https://avatars.githubusercontent.com/u/15056366?v=4)](https://github.com/xTermy "xTermy (6 commits)")[![Jaspaul](https://avatars.githubusercontent.com/u/2836589?v=4)](https://github.com/Jaspaul "Jaspaul (4 commits)")[![Rockstar04](https://avatars.githubusercontent.com/u/641721?v=4)](https://github.com/Rockstar04 "Rockstar04 (2 commits)")[![GueGuerreiro](https://avatars.githubusercontent.com/u/15708144?v=4)](https://github.com/GueGuerreiro "GueGuerreiro (1 commits)")[![rroik](https://avatars.githubusercontent.com/u/1122027?v=4)](https://github.com/rroik "rroik (1 commits)")

---

Tags

url

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/url

Parse, build and manipulate URL's

73914.3M97](/packages/spatie-url)[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6737.4M62](/packages/jbroadway-urlify)[league/uri-components

URI components manipulation library

31932.3M67](/packages/league-uri-components)[sabre/uri

Functions for making sense out of URIs.

29335.2M40](/packages/sabre-uri)[spomky-labs/base64url

Base 64 URL Safe Encoding/Decoding PHP Library

15439.5M49](/packages/spomky-labs-base64url)[misd/linkify

Converts URLs and email addresses in text into HTML links

1122.9M10](/packages/misd-linkify)

PHPackages © 2026

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