Giter VIP home page Giter VIP logo

cwr-dataapi's Introduction

CWR Data Model API

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.

cwr-dataapi's People

Contributors

bernardo-mg avatar black-rosary avatar ralic avatar kazeborja avatar ginfante avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.