Skip to main content

Music Metedata - Territory-related tools

Project description

Music Metadata - Territories

Build Status Coverage Status GitHub PyPI

A very simple library for dealing with territory hierarchies used in music metadata, currently primarily focused on CISAC TIS.

It loads the territories and hierarchies from CSV files, made from Excel files downloaded from CISAC documents.

One of the most importaint features is that it turns any combination of includes and excludes into a include-only list.

It has only two classes:

  • Territory - the territory, e.g. World, Europe, Croatia
  • TerritoryList - this class makes including and excluding territories simpler, it also splits territories down when needed, e.g. World excluding Croatia results in a minimal list of included territories, and not all the countries:
from music_metadata.territories import *

world = Territory.get('2136')
usa = Territory.get('US')

l = TerritoryList()
l.include(world)
l.exclude(usa)

for t in sorted(l, key=lambda x: x.name):
    print(f'{t.tis_n:0>4}', t.name)

Result:

2100 AFRICA
2106 ASIA
0124 CANADA
2113 CENTRAL AMERICA
2120 EUROPE
0484 MEXICO
2130 OCEANIA
2132 SOUTH AMERICA
2134 WEST INDIES

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

music_metadata_territories-19rc1.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

music_metadata_territories-19rc1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file music_metadata_territories-19rc1.tar.gz.

File metadata

  • Download URL: music_metadata_territories-19rc1.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.8

File hashes

Hashes for music_metadata_territories-19rc1.tar.gz
Algorithm Hash digest
SHA256 6e401e1a6b5e3a241fc82fd7c97be64ca625374d0fcb327afdaa684a0444b9db
MD5 3c7b8c65f37ed84e294b502c0ef1c04c
BLAKE2b-256 4f0c6530c260c58de9dbc3e1a935d0ec6f2bb1597d7f61732d43c46e730d069c

See more details on using hashes here.

File details

Details for the file music_metadata_territories-19rc1-py3-none-any.whl.

File metadata

  • Download URL: music_metadata_territories-19rc1-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.8

File hashes

Hashes for music_metadata_territories-19rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 b26ad872d97bbf6254cda2817bb8adaa990c6c98126bcb38e46ef154f563de75
MD5 4cdb450de7dfe869cc72ff2e04f1086d
BLAKE2b-256 5786c501a5ef4c836489057db0251dbf4f66b1250013e442952acb56d57a09ad

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