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-19rc2.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: music_metadata_territories-19rc2.tar.gz
  • Upload date:
  • Size: 19.5 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-19rc2.tar.gz
Algorithm Hash digest
SHA256 0d1175dfe0cdfba605d232442300187943eb9850ed4f34b7e8aac42b930fb3ac
MD5 9ebe6efcabf8c9c7f89e342bf77889a7
BLAKE2b-256 ee9f7d3a62afc791034a86c1e0bad51852eab2260c910a8b0930495dd0960eaa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: music_metadata_territories-19rc2-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-19rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 3174f11111a2288906483677240a65af14112547c2c622a17f186c50bfd6fb9e
MD5 9d3c0cacc88adfb84ed963d6b6cefea1
BLAKE2b-256 fe0b3876e7ecf185d993d8e405b0726aa7d0854ef1c18c50c5e7035db8499f21

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page