Download the PHP package dprmc/cusip without Composer

On this page you can find all versions of the php package dprmc/cusip. 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 cusip

CUSIP

Latest Stable Version Build Status License Total Downloads Coverage Status

A PHP library for validating and working with financial security identifiers.

This package validates:

It also includes helpers for extracting valid CUSIPs from pasted text, removing duplicates, identifying symbol types, calculating CUSIP check digits, and fixing a narrow class of common CUSIP transcription errors.

Requirements

The current source uses typed properties, so PHP 7.4+ is required.

Installation

Quick Start

CUSIP Validation

Use CUSIP::isCUSIP() to validate a single CUSIP.

isCUSIP() returns true only when the input:

Surrounding whitespace is ignored:

The special CUSIP characters *, @, and # are supported:

Invalid check digits return false:

Extracting CUSIPs From Text

Use getValidCusipsFromString() when users paste a list of CUSIPs into a textarea or form field.

The parser splits on whitespace and commas, ignores empty values, and removes invalid CUSIPs.

Use getUniqueValidCusipsFromString() when duplicate valid CUSIPs should be collapsed:

Removing Invalid CUSIPs From an Array

Use removeInvalidCusips() when you already have an array of candidate values.

CUSIP Check Digits

Use getChecksumDigit() to calculate the check digit for an 8- or 9-character CUSIP value.

If the input length is shorter than 8 characters or longer than 9 characters, the method returns false.

Fixing Common CUSIP Transcription Errors

CUSIP identifiers do not use the letters I and O because they are easy to confuse with 1 and 0.

Use fixCusip() to normalize a CUSIP and attempt that replacement:

fixCusip():

ISIN Validation

Use isISIN() to validate an International Securities Identification Number.

The method validates the ISIN format and checksum.

SEDOL Validation

Use isSEDOL() to validate a Stock Exchange Daily Official List identifier.

The method validates the SEDOL length, character rules, and checksum.

Detecting Symbol Type

Use getSymbolType() when an input may be a CUSIP, ISIN, or SEDOL.

getSymbolType() checks the value in this order:

  1. CUSIP
  2. ISIN
  3. SEDOL

If the symbol cannot be identified, it throws DPRMC\UnknownSymbolException.

Ignored CUSIPs

The package maintains a small list of CUSIPs that are structurally valid but should be treated as invalid by this library:

Current ignored values:

These values pass the checksum algorithm but are known to create false positives in downstream parsers.

API Reference

CUSIP::isCUSIP($cusip = null): bool

Returns whether a value is a valid CUSIP.

CUSIP::getValidCusipsFromString(string $string): array

Splits a string on whitespace and commas, then returns only valid CUSIPs.

CUSIP::getUniqueValidCusipsFromString($string): array

Returns valid CUSIPs from a string with duplicates removed and indexes reset.

CUSIP::removeInvalidCusips($cusips): array

Filters an array of candidate values down to valid CUSIPs.

CUSIP::containsInvalidCharacters($cusip): bool

Returns true when a value contains characters that are not valid in a CUSIP.

CUSIP::getChecksumDigit($cusip): int|false

Calculates a CUSIP check digit. Returns false when the input length is invalid.

CUSIP::isISIN($isin): bool

Returns whether a value is a valid ISIN.

CUSIP::isSEDOL($sedol): bool

Returns whether a value is a valid SEDOL.

CUSIP::fixCusip(string $originalCUSIP): string

Returns a valid normalized CUSIP or throws DPRMC\UnfixableCusipException.

CUSIP::getSymbolType(string $symbol): string

Returns CUSIP, ISIN, or SEDOL. Throws DPRMC\UnknownSymbolException when the value is not recognized.

Exceptions

DPRMC\UnfixableCusipException

Thrown by fixCusip() when a value cannot be converted into a valid CUSIP.

The original value is available on:

DPRMC\UnknownSymbolException

Thrown by getSymbolType() when a value is not a valid CUSIP, ISIN, or SEDOL.

The original value is available on:

Development

Install dependencies:

Run the test suite:

Regenerate Composer's autoloader after adding or renaming classes:

Background

CUSIP stands for Committee on Uniform Securities Identification Procedures. CUSIPs are commonly used to identify North American financial securities.

More background is available on Wikipedia:

https://en.wikipedia.org/wiki/CUSIP

License

This package is released under the MIT License. See LICENSE.


All versions of cusip with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.3||^7.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 dprmc/cusip contains the following files

Loading the files please wait ...