Skip to main content

A python library to read from and write to the Trompa CE

Project description

Trompa Contributor Environment Python Client

Music Technology Group, Universitat Pompeu Fabra, Barcelona

A python library to read from and write to the Trompa Contributor Environment (Trompa CE).

Installation

To install, run

python setup.py install

to install the package and dependencies

Using the library

This library connects to an existing Trompa CE instance. For testing on a local environment the docker containers from https://github.com/trompamusic/ce-api can be run.

Basic example code for using the library to add an artist to the Trompa CE.

To use the library an existing Trompa Contributor environment

import trompace.connection
from trompace.config import config
from trompace.mutations import person

config.load('trompace.ini')

mutation_musicbrainz = person.mutation_create_person(
    creator="https://github.com/trompamusic/trompa-ce-client/tree/v0.1/demo",
    contributor="https://musicbrainz.org",
    source="https://musicbrainz.org/artist/8d610e51-64b4-4654-b8df-064b0fb7a9d9",
    format_="text/html",
    title="Gustav Mahler - MusicBrainz",
    name="Gustav Mahler",
    birth_date="1860-07-07",
    death_date="1911-05-18",
    family_name="Mahler",
    given_name="Gustav",
    gender="male",
    language="en"
)

response = trompace.connection.submit_query(mutation_musicbrainz, auth_required=True)

print(response)

License

Copyright 2019 Music Technology Group, Universitat Pompeu Fabra

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Development

This package is published on pypi, and has documentation on readthedocs:

To build and publish a new version:

git tag v0.3
git push --tags
python setup.py sdist bdist_wheel
twine upload dist/*

To release a version on github after pushing the tag, go to https://github.com/trompamusic/trompa-ce-client/releases/new and choose the tag that you just pushed.

To build docs, go to https://readthedocs.org/projects/trompace-client/ and click "Build version".

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

trompace-client-0.3.tar.gz (80.8 kB view details)

Uploaded Source

Built Distribution

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

trompace_client-0.3-py3-none-any.whl (89.5 kB view details)

Uploaded Python 3

File details

Details for the file trompace-client-0.3.tar.gz.

File metadata

  • Download URL: trompace-client-0.3.tar.gz
  • Upload date:
  • Size: 80.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.23.0 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for trompace-client-0.3.tar.gz
Algorithm Hash digest
SHA256 1a1599d2d806e5a6d678f7096532037e32543c62fbbe55506c2a89c53b15e0e6
MD5 eafd751ee80c981002fd0c8fa2f59d0c
BLAKE2b-256 5786d0ae7a007e573d4874f6fe899a07d6b6db6eed1f839b75f2fd41d3e31b1d

See more details on using hashes here.

File details

Details for the file trompace_client-0.3-py3-none-any.whl.

File metadata

  • Download URL: trompace_client-0.3-py3-none-any.whl
  • Upload date:
  • Size: 89.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.23.0 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for trompace_client-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 71705ad2a9f7926a68357695650c54d13bfdac72f78e9892fac88a924e72fa21
MD5 bd19d4d99ff4742a708eb07d7c34e0da
BLAKE2b-256 b5ace8981b99d792c8e16bcd4497b9f981ff4e1dd7113330826040da5ad109cc

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