Skip to content

Add ISRC (International Standard Recording Code)#261

Closed
nuno-andre wants to merge 1 commit into
arthurdejong:masterfrom
nuno-andre:master
Closed

Add ISRC (International Standard Recording Code)#261
nuno-andre wants to merge 1 commit into
arthurdejong:masterfrom
nuno-andre:master

Conversation

@nuno-andre

@nuno-andre nuno-andre commented Mar 10, 2021

Copy link
Copy Markdown
Contributor

Hi!

This PR adds support for the ISRC (International Standard Recording Code).

I've also added a little function to util.py that I often use to split strings into different sizes. I think it could be useful for other codes. If you think that it's misplaced or misnamed I have no problem in modifying the commit.

>>> chunks = 3, 4, 5, 4
>>> segment('0123456789ABCDEF', *chunks)
['012', '3456', '789AB', 'CDEF']

Also, comment that I'm writing a wrapper to use python-stdnum with Pydantic (Pydentic). I have a little library with some validators for Pydantic models, and I've found that yours has almost all of them (and many more), so I think it's way more productive to add the missing ones to python-stdnum and wrap it up. Currently, it is little more than a proof of concept but I will develop it in the next few days, and will also send some more PRs if you like.

Thanks for your work, it's really amazing. I wish I had known about it sooner :)

@arthurdejong

Copy link
Copy Markdown
Owner

Hi @nuno-andre,

Thanks for providing the number format. I've merged it as 36d723c. I took out the segment() function for now because it was slightly easier to switch to a regex than to turn it into something that also works for Python 2.7 (only recently support for Python 2.6 was dropped).

If there are any formats missing I would welcome pull requests but creating issues with a request for the format is also fine.

In general, python-stdnum is meant to be used in situations like with Pydantic (didn't know about that library before). I recommend calling compact() on a number before storing it in a database or similar storage because it tries to ensure a consistent for for the number so that it is easier to do queries for the number.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants