Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/stdnum/eu
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2017-09-10 23:24:08 +0200
committerArthur de Jong <arthur@arthurdejong.org>2017-09-11 20:54:31 +0200
commit1c276393d695f969f4600cb3adc49af71168d513 (patch)
treebfe9e373d9212ef43f06de953f8d12bb3d413ef4 /stdnum/eu
parent2cc39ea459dcd712462113e12ceb5eda27de9ecb (diff)
Docstring improvements
Diffstat (limited to 'stdnum/eu')
-rw-r--r--stdnum/eu/at_02.py6
-rw-r--r--stdnum/eu/eic.py8
-rw-r--r--stdnum/eu/nace.py10
-rw-r--r--stdnum/eu/vat.py26
4 files changed, 25 insertions, 25 deletions
diff --git a/stdnum/eu/at_02.py b/stdnum/eu/at_02.py
index ca5973e..8852cd1 100644
--- a/stdnum/eu/at_02.py
+++ b/stdnum/eu/at_02.py
@@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
-""" SEPA Identifier of the Creditor (AT-02)
+"""SEPA Identifier of the Creditor (AT-02).
This identifier is indicated in the ISO 20022 data element `Creditor Scheme
Identification`. The creditor can be a legal entity, or an association that
@@ -60,7 +60,7 @@ def _to_base10(number):
def validate(number):
- """Checks to see if the number provided is a valid AT-02."""
+ """Check if the number provided is a valid AT-02."""
number = compact(number)
try:
test_number = _to_base10(number)
@@ -72,7 +72,7 @@ def validate(number):
def is_valid(number):
- """Checks to see if the number provided is a valid AT-02."""
+ """Check if the number provided is a valid AT-02."""
try:
return bool(validate(number))
except ValidationError:
diff --git a/stdnum/eu/eic.py b/stdnum/eu/eic.py
index 88d28e0..e6d9419 100644
--- a/stdnum/eu/eic.py
+++ b/stdnum/eu/eic.py
@@ -65,8 +65,8 @@ def calc_check_digit(number):
def validate(number):
- """Checks to see if the number provided is valid. This checks the length,
- format and check digit."""
+ """Check if the number is valid. This checks the length, format and check
+ digit."""
number = compact(number)
if not all(x in _alphabet for x in number):
raise InvalidFormat()
@@ -80,8 +80,8 @@ def validate(number):
def is_valid(number):
- """Checks to see if the number provided is valid. This checks the length,
- format and check digit."""
+ """Check if the number is valid. This checks the length, format and check
+ digit."""
try:
return bool(validate(number))
except ValidationError:
diff --git a/stdnum/eu/nace.py b/stdnum/eu/nace.py
index 344629c..64743b0 100644
--- a/stdnum/eu/nace.py
+++ b/stdnum/eu/nace.py
@@ -80,8 +80,8 @@ def label(number):
def validate(number):
- """Checks to see if the number provided is a valid NACE. This checks the
- format and searches the registry to see if it exists."""
+ """Check if the number is a valid NACE. This checks the format and
+ searches the registry to see if it exists."""
number = compact(number)
if len(number) > 4:
raise InvalidLength()
@@ -96,8 +96,8 @@ def validate(number):
def is_valid(number):
- """Checks to see if the number provided is a valid NACE. This checks the
- format and searches the registry to see if it exists."""
+ """Check if the number is a valid NACE. This checks the format and
+ searches the registry to see if it exists."""
try:
return bool(validate(number))
except ValidationError:
@@ -105,5 +105,5 @@ def is_valid(number):
def format(number):
- """Reformat the passed number to the standard format."""
+ """Reformat the number to the standard presentation format."""
return '.'.join((number[:2], number[2:])).strip('.')
diff --git a/stdnum/eu/vat.py b/stdnum/eu/vat.py
index 3604aba..3a6a2eb 100644
--- a/stdnum/eu/vat.py
+++ b/stdnum/eu/vat.py
@@ -84,8 +84,8 @@ def compact(number):
def validate(number):
- """Checks to see if the number provided is a valid VAT number. This
- performs the country-specific check for the number."""
+ """Check if the number is a valid VAT number. This performs the
+ country-specific check for the number."""
number = clean(number, '').upper().strip()
module = _get_cc_module(number[:2])
if not module:
@@ -94,8 +94,8 @@ def validate(number):
def is_valid(number):
- """Checks to see if the number provided is a valid VAT number. This
- performs the country-specific check for the number."""
+ """Check if the number is a valid VAT number. This performs the
+ country-specific check for the number."""
try:
return bool(validate(number))
except ValidationError:
@@ -103,10 +103,10 @@ def is_valid(number):
def guess_country(number):
- """Guess the country code based on the provided number. This checks the
- provided number against each of the validation routines and returns
- the list of countries for which it is valid. This returns lower case
- codes and returns gr (not el) for Greece."""
+ """Guess the country code based on the number. This checks the number
+ against each of the validation routines and returns the list of countries
+ for which it is valid. This returns lower case codes and returns gr (not
+ el) for Greece."""
return [cc
for cc in country_codes
if _get_cc_module(cc).is_valid(number)]
@@ -123,10 +123,10 @@ def _get_client(): # pragma: no cover (no tests for this function)
def check_vies(number): # pragma: no cover (no tests for this function)
- """Queries the online European Commission VAT Information Exchange
- System (VIES) for validity of the provided number. Note that the
- service has usage limitations (see the VIES website for details).
- This returns a dict-like object."""
+ """Query the online European Commission VAT Information Exchange System
+ (VIES) for validity of the provided number. Note that the service has
+ usage limitations (see the VIES website for details). This returns a
+ dict-like object."""
# this function isn't automatically tested because it would require
# network access for the tests and unnecessarily load the VIES website
number = compact(number)
@@ -134,7 +134,7 @@ def check_vies(number): # pragma: no cover (no tests for this function)
def check_vies_approx(number, requester): # pragma: no cover
- """Queries the online European Commission VAT Information Exchange System
+ """Query the online European Commission VAT Information Exchange System
(VIES) for validity of the provided number, providing a validity
certificate as proof. You will need to give your own VAT number for this
to work. Note that the service has usage limitations (see the VIES