diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..6a5031a --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,31 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Publish ya2ro package to PyPi + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.gitignore b/.gitignore index acfad3f..2f9f35b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ __pycache__/ env_3.9/* /.htaccess dist/* +output/* +requirements.txt.old +Yaml Examples/* ### Python ### # Byte-compiled / optimized / DLL files @@ -151,4 +154,4 @@ dmypy.json # Cython debug symbols cython_debug/ -.vscode \ No newline at end of file +.vscode diff --git a/Dockerfile b/Dockerfile index d574cb4..f102509 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM python:3.9 +FROM python:3.10 RUN git clone https://github.com/oeg-upm/ya2ro -RUN cd ya2ro && pip install . +RUN cd ya2ro && pip install . -RUN somef configure -a \ No newline at end of file +RUN somef configure -a diff --git a/README.md b/README.md index 2900922..0ca6cb4 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,14 @@ [![DOI](https://zenodo.org/badge/407588137.svg)](https://zenodo.org/badge/latestdoi/407588137) [![Project Status: Active: The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) -## Demo +## Example +Ya2ro generates Research Objects (ROs) like the following: [https://w3id.org/dgarijo/ro/sepln2022](https://w3id.org/dgarijo/ro/sepln2022). Given a few ROs, `ya2ro` can also create a landing page: +## Requirements +The latest version of ya2ro works in Python 3.10. + ## Installation To run ya2ro, please follow the next steps: @@ -50,8 +54,9 @@ If you move any files produced by ya2ro into `/out`, then you will be able to se ### Configure -Before running ya2ro, you must configure it appropriately. Please add your personal token in ya2ro properties file. ---> ~/ya2ro/src/ya2ro/resources/properties.yaml <-- +Before running ya2ro, you must configure it appropriately. Please add your GitHub personal token in ya2ro properties file. This needed if you want `ya2ro` to extract your software metadata automatically. The file can be found at: + +`--> ~/ya2ro/src/ya2ro/resources/properties.yaml <--` Add a line like the following: @@ -60,7 +65,7 @@ Add a line like the following: GITHUB_PERSONAL_ACCESS_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` -ya2ro will continue working if not configured, but is highly recommended to apply this setting. +ya2ro will work if this is not configured, but is highly recommended to apply this setting, as the GitHub API has restricted access. ### Test ya2ro installation @@ -145,3 +150,6 @@ WARNING: Software cards will no longer work on github links. Therefore you will ya2ro offers the option to create a landing page where all the resources produced are easily accessible. Just indicate the folder where this resources are, for example: `ya2ro -l output` + +## Documentation +Please have a look at our [documentation](Documentation.md) to know which metadata fields are supported by `ya2ro`. diff --git a/properties.yaml b/properties.yaml new file mode 100644 index 0000000..3b110b2 --- /dev/null +++ b/properties.yaml @@ -0,0 +1,15 @@ +--- +#----------------------------- +# file_descriptor: "file_name" +#----------------------------- + input_to_vocab_yaml: "resources/input_to_vocab.yaml" + template_html: "resources/template.html" + template_help: "resources/help.html" + template_landing: "resources/landing_page.html" + output_html: "ro-crate-preview.html" + output_html_help: "help.html" + output_html_landing: "landing_page.html" + output_jsonld: "ro-crate-metadata.json" + htaccess: "resources/.htaccess" + default_author_img: default_author.jpg + GITHUB_PERSONAL_ACCESS_TOKEN: # ADD here your GitHub persnoal access token diff --git a/src/ya2ro/resources/properties.yaml b/src/ya2ro/resources/properties.yaml index e3e05d0..21e1711 100644 --- a/src/ya2ro/resources/properties.yaml +++ b/src/ya2ro/resources/properties.yaml @@ -6,11 +6,11 @@ template_html: "resources/template.html" template_help: "resources/help.html" template_landing: "resources/landing_page.html" - output_html: "index-en.html" + output_html: "ro-crate-preview.html" output_html_help: "help.html" output_html_landing: "landing_page.html" output_jsonld: "ro-crate-metadata.json" htaccess: "resources/.htaccess" default_author_img: default_author.jpg style: "dark" - GITHUB_PERSONAL_ACCESS_TOKEN: # ADD here your GitHub persnoal access token \ No newline at end of file + GITHUB_PERSONAL_ACCESS_TOKEN: # ADD here your GitHub persnoal access token diff --git a/templates/sample_links_DG.yaml b/templates/sample_links_DG.yaml new file mode 100644 index 0000000..9845553 --- /dev/null +++ b/templates/sample_links_DG.yaml @@ -0,0 +1,20 @@ +# Mandatory field +type: "paper" + +title: "Work done in SOSEN" + +datasets: + - doi: https://doi.org/10.6084/m9.figshare.14916684.v1 + - doi: https://doi.org/10.5281/zenodo.5139550 + +software: + - link: https://github.com/KnowledgeCaptureAndDiscovery/somef + +bibliography: + - https://dx.doi.org/10.1109/BigData47090.2019.9006447 + +authors: + # Alternative way if participant has an ORCID + - + orcid: http://orcid.org/0000-0003-0454-7145 + role: "Supervisor"