Skip to main content

This projects offers a domain model for the CISAC CWR standard v2.1 to be used on Python applications, along a series of parsing which allow transformations between the model and various data structures.

CWR stands for Common Works Registration, and it is a common or standard format for the registration and revision of musical works, used by publishers and performing rights societies as a way to exchange musical works data.

While the CWR standard has been created by CISAC this library has been developed by WESO independently, with help from BMAT.

CWR-API Pypi package page CWR-API latest documentation Status Join the chat at https://gitter.im/weso/CWR-DataApi

Features

  • Model for CWR files

  • Configurable parser from transforming a CWR file into the model classes (including Pyparsing grammar)

  • Parsers for for model-JSON transformations

Documentation

Check the latest docs for the most current version of the documentation.

They are generated with the help of Sphinx. The source files for this are stored in the docs folder.

Usage

The application has been coded in Python. Dependencies are taken care with the use of pip, and an included makefile helps building the project.

Prerequisites

The project has been tested in the following versions of the interpreter:

  • Python 3.4

  • Python 3.5

  • Python 3.6

All other dependencies are indicated on the requirements.txt file. The included makefile can install them with the command:

$ make requirements

Among them, the most important is the Pyparsing library, which is used to create the CWR file parser.

Installing

The project includes a setup.py file and a makefile allowing direct installation of the library.

This can be done with the following command:

$ make install

Additionally, the project is offered as a Pypi package, and can be installed through pip:

$ pip install cwr-api

Making use of the parser

Once the project is installed it can be used in a similar way to this (using Python 2.7):

import codecs
import os

from cwr.parser.decoder.file import default_file_decoder
from cwr.parser.encoder.cwrjson import JSONEncoder

if __name__ == '__main__':
    print('File to JSON test')
    path = raw_input(
        'Please enter the full path to a CWR file (e.g. c:/documents/file.cwr): ')
    output = raw_input(
        'Please enter the full path to the file where the results will be stored: ')
    print('\n')
    print('Reading file %s' % path)
    print('Storing output on %s' % output)
    print('\n')

    decoder = default_file_decoder()

    data = {}
    data['filename'] = os.path.basename(path)
    data['contents'] = codecs.open(path, 'r', 'latin-1').read()

    data = decoder.decode(data)

    encoder = JSONEncoder()
    result = encoder.encode(data)

    output = codecs.open(output, 'w', 'latin-1')

    output.write(result)

Collaborate

The project is still under ongoing development, and any help will be well received.

There are two ways to help: reporting errors and asking for extensions through the issues management, or forking the repository and extending the project.

Issues management

Issues are managed at the GitHub project issues page.

Everybody is allowed to report bugs or ask for features.

Getting the code

The code can be found at the GitHub project page.

Feel free to fork it, and share the changes.

License

The project has been released under the MIT License.

Release files for CWR-API 0.0.40

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CWR-API 0.0.40
File Size Uploaded
CWR-API-0.0.40.tar.gz 2.6 MB Details

Release files / CWR-API-0.0.40.tar.gz

Download URL CWR-API-0.0.40.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
73c9484257742eb0e09cb90eb3ece3aa7bd7000ce48fdbeb88d8cb14d5379a00
BLAKE2b-256 checksum
How to use checksums
8ec05e933ed064fbb1bf746f46193f021e75a6c57a669ac14ff141068dbdc7d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.40 This release

1 release file

0.0.34

1 release file

0.0.33

1 release file

0.0.32

1 release file

0.0.31

1 release file

0.0.30

1 release file

0.0.29

1 release file

0.0.28

1 release file

0.0.27

1 release file

0.0.26

1 release file

0.0.25

1 release file

0.0.24

1 release file

0.0.23

1 release file

0.0.22

1 release file

0.0.21

1 release file

0.0.20

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page