Git Product home page Git Product logo

fairly's Introduction

fair-software.nl recommendations Badges
1. Code repository GitHub Badge
2. License License Badge
3. Community Registry PyPI Badge
4. Enable Citation Zenodo Badge
Other best practices  
Continuous integration Python Build Python Publish
Documentation Documentation Status

fairly

A package to create, publish and clone research datasets.

License: MIT

Installation

fairly requires Python 3.8 or later, and ruamel.yaml version 0.17.26 or later. It can be installed directly using pip.

pip install fairly

Installing from source

  1. Clone or download the source code:

    git clone https://github.com/ITC-CRIB/fairly.git
  2. Go to the root directory:

    cd fairly/
  3. Compile and install using pip:

    pip install .

Usage

Basic example to create a local research dataset and deposit it to a repository:

import fairly

# Initialize a local dataset
dataset = fairly.init_dataset('/path/dataset')

# Set metadata
dataset.metadata['license'] = 'MIT'
dataset.set_metadata(
    title='My dataset',
    keywords=['FAIR', 'research', 'data'],
    authors=[
        '0000-0002-0156-185X',
        {'name': 'John', 'surname': 'Doe'}
    ]
)

# Add data files
dataset.includes.extend([
    'README.txt',
    '*.csv',
    'train/*.jpg'
])

# Save dataset
dataset.save()

# Upload to a data repository
remote_dataset = dataset.upload('zenodo')

Basic example to access a remote dataset and store it locally:

import fairly

# Open a remote dataset
dataset = fairly.dataset('doi:10.4121/21588096.v1')

# Get dataset information
dataset.id
>>> {'id': '21588096', 'version': '1'}

dataset.url
>>> 'https://data.4tu.nl/articles/dataset/.../21588096/1'

dataset.size
>>> 33339

len(dataset.files)
>>> 6

dataset.metadata
>>> Metadata({'keywords': ['Earthquakes', 'precursor', ...], ...})

# Update metadata
dataset.metadata['keywords'] = ['Landslides', 'precursor']
dataset.save_metadata()

# Store dataset to a local directory (i.e. clone dataset)
local_dataset = dataset.store('/path/dataset')

Currently, the package supports the following research data management platforms:

All research data repositories based on the listed platforms are supported.

For more details and examples, consult the package documentation.

Testing

Unit tests can be run by using pytest command in the root directory.

Contributions

Read the guidelines to know how you can be part of this open source project.

JupyterLab Extension

An extension for JupyerLab is being developed in a different repository.

Citation

Please cite this software using as follows:

Girgin, S., Garcia Alvarez, M., & Urra Llanusa, J., fairly: a package to create, publish and clone research datasets [Computer software]

Acknowledgements

This research is funded by the Dutch Research Council (NWO) Open Science Fund, File No. 203.001.114.

Project members:

fairly's People

Contributors

eugeniotamassia avatar girgink avatar jurra avatar manugil 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.