lists.arthurdejong.org
RSS feed

RE: [EXT] Re: Very Basic Question

[Date Prev][Date Next] [Thread Prev][Thread Next]

RE: [EXT] Re: Very Basic Question



Thank you very much.

I already could solve it.

It’s working perfectly.

 


Simão Coimbra

 

Email: simao.coimbra@basf.com
Postal Address: BASF Services Europe GmbH, GBE/SO-BEK - , Rotherstrasse 11, 10245 Berlin, Germany

BASF Services Europe GmbH
Rotherstraße 11, 10245 Berlin, Germany
Registration Court: Amtsgericht Berlin-Charlottenburg

Registration No.: HRB 97140
Chairman of the Supervisory Board: Daniel Dornbusch
Managing Director: Juergen Zierke
www.basf.com/servicehub-berlin

 

Information on data protection can be found here: https://www.basf.com/global/en/legal/data-protection-at-basf.html

 

From: Denis Rouleau <denis.rouleau@gmail.com>
Sent: Wednesday, May 25, 2022 10:51 PM
To: Arthur de Jong <arthur@arthurdejong.org>
Cc: Simao Coimbra <simao.coimbra@basf.com>; python-stdnum-users@lists.arthurdejong.org
Subject: [EXT] Re: Very Basic Question

 

You don't often get email from denis.rouleau [at] gmail.com. Learn why this is important

Late to the party.

 

I don't think you need to import stdnum.pl,

Just stdnum

 

That's what the second error message implies.

 

Le mar. 24 mai 2022, 14 h 16, Arthur de Jong <arthur [at] arthurdejong.org> a écrit :

On Mon, 2022-05-23 at 13:13 +0000, Simao Coimbra wrote:
> I managed to install and run the first example from the
> documentation, but now I don't know how to run the other modules. I
> have tried several versions but always get an error.

You have to import the module and use the function from the imported
namespace.

For example:

    from stdnum.pl import nip
    nip.validate('PL8921489098')

Or

    from stdnum import vatin
    vatin.validate('PL8921489098')

It is also possible to import the module like so:

    import stdnum.pl.nip
    stdnum.pl.nip.validate('PL8921489098')

and even:

    from stdnum.pl.nip import validate
    validate('PL8921489098')

(the last form has the downside that it is more difficult to import
multiple validate functions)

Hope this helps a bit,

--
-- arthur - arthur [at] arthurdejong.org - https://arthurdejong.org/ --