Download the PHP package happenv-com/address-splitter without Composer

On this page you can find all versions of the php package happenv-com/address-splitter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package address-splitter

Address Splitter

A PHP library for parsing addresses into components: street, building number, and apartment number.

Supports country-specific address formats for 27 European countries and includes generic fallback strategies for unknown formats.

Installation

Requirements: PHP 8.0+

Quick Start

Parse Result

The split() method returns a ParsedAddress object:

If no strategy matches the address, the entire text is returned as street.

Supported Countries

The library includes optimized parsers for the following countries:

Code Country Example Formats
PL Poland ul. Marszałkowska 123/45, al. Jana Pawła II 15, 3 Maja 10
DE Germany Hauptstraße 42a, Musterweg 12-14
AT Austria Ringstraße 15/3, Hauptplatz 1
CH Switzerland Bahnhofstrasse 10, Rue de Lausanne 25
FR France 15 Rue de la Paix, 25 bis Avenue des Champs-Élysées
BE Belgium Rue Haute 120, Hoogstraat 45
LU Luxembourg 12 Avenue de la Liberté
NL Netherlands Kalverstraat 152-III, 1e Helmersstraat 25
GB United Kingdom 221B Baker Street, Flat 5, 10 Downing Street
IE Ireland 42 O'Connell Street Upper
IT Italy Via Roma 15/A, Piazza Duomo 1
ES Spain Calle Mayor 25, 3º B, Avenida de la Constitución 10
PT Portugal Rua Augusta 100, 2º Esq, Avenida da Liberdade 50
SE Sweden Kungsgatan 44, 2 tr, Storgatan 12 lgh 1001
FI Finland Mannerheimintie 5 A 12, Aleksanterinkatu 10
DK Denmark Strøget 15, 2. sal, Vesterbrogade 100
CZ Czech Republic Václavské náměstí 123/45, Karlova 10
SK Slovakia Hlavná 50/12, Obchodná 15
HU Hungary Andrássy út 60. 3/5, Váci utca 12
LT Lithuania Gedimino pr. 15-20, Vilniaus g. 25
LV Latvia Brīvības iela 100-5, Rīgas iela 12
EE Estonia Viru tänav 15-3, Tartu mnt 50
RO Romania Strada Victoriei nr. 10, ap. 5, Bulevardul Unirii 25
BG Bulgaria бул. Витоша 15, ап. 3, ул. Шипка 10
HR Croatia Ilica 25/3, Trg bana Jelačića 10
SI Slovenia Slovenska cesta 50/2, Prešernov trg 5
GR Greece Λεωφόρος Αθηνών 100, Οδός Ερμού 25
MT Malta 15 Republic Street, Flat 3, 20 Main Street
CY Cyprus 25 Makarios Avenue, 10 Ledra Street

Configuration

Default Configuration

Empty Configuration

Adding Strategies

Custom Fallback Strategies

Fallback strategies are used when:

Default fallback strategies:

External Strategies (API)

For addresses that cannot be parsed by local strategies, you can enable external APIs.

Important: External strategies use "first match wins" logic - the first strategy that returns a result wins. This prevents unnecessary API costs.

Google Address Validation API

OpenAI API

Multiple External Strategies

Enabling/Disabling External Strategies

Custom Parsing Strategies

You can create custom strategies by implementing the AddressParsingStrategyInterface:

Or extend the AbstractParsingStrategy class:

HTTP Clients

The library provides two HTTP clients for external strategies:

CurlHttpClient

Native PHP client with no external dependencies:

GuzzleHttpClient

Wrapper for Guzzle HTTP (requires guzzlehttp/guzzle):

Custom HTTP Client

Implement HttpClientInterface:

Architecture

The library uses a three-tier parsing strategy:

  1. Country strategies - country-specific parsers (all results → BestResultSelector)
  2. Fallback strategies - generic parsers when no country code (all results → BestResultSelector)
  3. External strategies - paid APIs (first match wins - cost minimization)

Testing

License

MIT License


All versions of address-splitter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package happenv-com/address-splitter contains the following files

Loading the files please wait ...