Skip to main content

Validate Swedish organization numbers

Project description

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

from organisationsnummer import organisationsnummer

organisationsnummer.valid("8507099805")
# => True

organisationsnummer.valid("198507099805")
# => True

Format

from organisationsnummer import organisationsnummer

# Short format
pn = organisationsnummer.Organisationsnummer(8507099805)
pn.format()
# => '8507099805'

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

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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

organisationsnummer-1.0.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

organisationsnummer-1.0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file organisationsnummer-1.0.1.tar.gz.

File metadata

  • Download URL: organisationsnummer-1.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for organisationsnummer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1382bf8fa434dd4067a40a6b5ae3df1c1146b28a8565b78aeeeb3c0f20598591
MD5 cae6d82dbcd7fdd8ebbdf2fb57d68ba9
BLAKE2b-256 72a859deebbfb6b779f31a51b72e4fe43e4d669751e8a166c642d2e26f182e1f

See more details on using hashes here.

File details

Details for the file organisationsnummer-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for organisationsnummer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ed6a5b6a0757774b89d01a945463f944c995d173c83a2d820005165b1b99f75
MD5 03e1333a6d9047ee747794132c90f941
BLAKE2b-256 ada70d6463f4f92ddc242307d5de35230315f2165b2e6061974d842b68b39f07

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page