Coder Social home page Coder Social logo

pmart123 / cymbology Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 1.0 60 KB

Identifies and validates financial security ids such as Sedol, Cusip, Isin numbers.

License: BSD 2-Clause "Simplified" License

Python 94.23% Gherkin 5.77%
finance entity-resolution validation identifier symbology-data

cymbology's Introduction

cymbology

cymbology identifies and validates financial security ids. Currently the following identifiers are supported:

  1. Sedol
  2. Cusip
  3. Isin

This package can be used to validate these identifiers, discover the validation error, or create checksum digits.

Example Usage:

ISIN number

from cymbology import Isin, cusip_from_isin
isin = Isin()

# validate ISIN number 'US0378331005', throwing error IdError if invalid
>>> valid_isin = isin.validate('US0378331005')
>>> valid_isin
'US0378331005'
    
# return validation boolean for ISIN number
>>> tf = isin.is_valid('US0378331005')
>>> tf
True
    
# calculate checksum for ISIN number 'US0378331005'
check_digit = isin.calculate_checksum('US037833100')

# convert ISIN to CUSIP number.
>>> cusip_from_isin('US0378331005')
'037833100'

Dependancies and Installation Notes

This package currently only relies on the standard library, and has not been tested for Python 2.X.

Running Tests

PYTHONPATH=. py.test --cov

Extending

Idenifiers that rely on alpha-numeric codes should be able to be easily extended. Feel free to add additional identification algorithmns. Legal Indenifiers(LEI) ids will be added to master branch of repo soon.

cymbology's People

Contributors

pmart123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

martinthoma

cymbology's Issues

security-validation branch

Error in running feature tests, not recognizing name

Branch:
https://github.com/pmart123/security_id/tree/security-validation

(root)Philips-MacBook-Pro-2:features pmartin$ behave
Exception KeyError: "'__name__' not in globals"
Traceback (most recent call last):
  File "/Users/pmartin/anaconda/bin/behave", line 11, in <module>
    sys.exit(main())
  File "/Users/pmartin/anaconda/lib/python3.4/site-packages/behave/__main__.py", line 109, in main
    failed = runner.run()
  File "/Users/pmartin/anaconda/lib/python3.4/site-packages/behave/runner.py", line 672, in run
    return self.run_with_paths()
  File "/Users/pmartin/anaconda/lib/python3.4/site-packages/behave/runner.py", line 678, in run_with_paths
    self.load_step_definitions()
  File "/Users/pmartin/anaconda/lib/python3.4/site-packages/behave/runner.py", line 658, in load_step_definitions
    exec_file(os.path.join(path, name), step_module_globals)
  File "/Users/pmartin/anaconda/lib/python3.4/site-packages/behave/runner.py", line 304, in exec_file
    exec(code, globals, locals)
  File "steps/steps.py", line 4, in <module>
    from ... import security_id
KeyError: "'__name__' not in globals"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.