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.0.tar.gz (5.2 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.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for organisationsnummer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8e1cb58e58409e94fbb029e82393f98fa49156d38980346471939e2c70e83bb3
MD5 d872e8ce20731a52df4147c123c6bcc4
BLAKE2b-256 0deedc765b22821a8c89758a249882523de32f50603f30ebbfa4ba44fa316d79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for organisationsnummer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b5e21e32118f7664ca76d9b37e07b492266d712489e6b2fa1b6520d65d3c0d9
MD5 78512fc4d4b66541576eb55428ace966
BLAKE2b-256 52c8d1f0e85a13b4fc889b4de365521a63a7ab65e760e97f6e81c02868b13e1d

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