Metadata-Version: 2.4
Name: organisationsnummer
Version: 1.0.1
Summary: Validate Swedish organization numbers
Author-email: Organisationsnummer and Contributors <hello@organisationsnummer.dev>
License: MIT License
        
        Copyright (c) - Organisationsnummer and Contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://organisationsnummer.dev
Project-URL: Repository, https://github.com/organisationsnummer/python
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: personnummer
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Dynamic: license-file

# organisationsnummer [![Build Status](https://github.com/organisationsnummer/python/actions/workflows/python.yml/badge.svg)](https://github.com/organisationsnummer/python/actions)

Validate Swedish organization numbers. Follows version 1.1 of the [specification](https://github.com/organisationsnummer/meta#package-specification-v11).

## Installation

```
pip install organisationsnummer
```

or

```
pip3 install organisationsnummer
```

## Examples

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

### Validation

```python
from organisationsnummer import organisationsnummer

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

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

### Format

```python
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](organisationsnummer/tests/test_organisationsnummer.py) for more examples.

## License

MIT
