Skip to content

Repository files navigation

organisationsnummer Build Status

Validate Swedish organization numbers. Follows version 1.1 of the specification.

Installation

pip install organisationsnummer

or

pip3 install organisationsnummer

Examples

  • All examples that uses organisationsnummer.Organisationsnummer([params]), can be replaced with organisationsnummer.parse([params]).

Validation

fromorganisationsnummerimportorganisationsnummerorganisationsnummer.valid("8507099805")
# => Trueorganisationsnummer.valid("198507099805")
# => True

Format

fromorganisationsnummerimportorganisationsnummer# Short formatpn=organisationsnummer.Organisationsnummer(8507099805)
pn.format()
# => '8507099805'# Long formatpn=organisationsnummer.Organisationsnummer('8507099805')
pn.format(True)
# => '850709-9805'

See organisationsnummer/tests/test_organisationsnummer.py for more examples.

License

MIT

About

Validate Swedish organization numbers

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages