Skip to content

Commit

Permalink
- Add Marine Regions (MrClient)
Browse files Browse the repository at this point in the history
- Add `bool ThrowExceptionIfRequestStatusCodeFails` properties to clients:
  - Gets or sets if it should throw an exception when the request code is other than success.
  - If false it will return a null object
- Fix the regex for `WebsiteUrl` to better remove the api sub-domain
  • Loading branch information
sn4k3 committed Aug 11, 2023
1 parent 8bb338f commit 7d16f4b
Show file tree
Hide file tree
Showing 20 changed files with 1,146 additions and 102 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/package-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,53 @@ jobs:
- name: 🚀 Push nuget.org
run: dotnet nuget push SpeciesDatabaseApi*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} --skip-duplicate

publish:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: SpeciesDatabaseCmd_win-x64_$tag.zip
asset_name: SpeciesDatabaseCmd_linux-x64_$tag
os_identifier: linux-x64

- os: windows-latest
artifact_name: SpeciesDatabaseCmd_win-x64_$tag.zip
asset_name: SpeciesDatabaseCmd_win-x64_$tag
os_identifier: win-x64

- os: macos-latest
artifact_name: SpeciesDatabaseCmd_macos-x64_$tag.zip
asset_name: SpeciesDatabaseCmd_macos-x64_$tag
os_identifier: macos-x64

steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: 🟣 Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: 🔧 Build
run: |
dotnet publish SpeciesDatabaseCmd -o ${{ matrix.asset_name }} -c Release -r ${{ matrix.os_identifier }} -p:PublishReadyToRun=true --self-contained
- name: 📦 Zip
run: |
zip -rq ${{ matrix.asset_name }} .
- name: 🚀 Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 12/08/2023 - v1.0.1

- Add Marine Regions (`MrClient`)
- Add `bool ThrowExceptionIfRequestStatusCodeFails` properties to clients:
- Gets or sets if it should throw an exception when the request code is other than success.
- If false it will return a null object
- Fix the regex for `WebsiteUrl` to better remove the api sub-domain

## 11/08/2023 - v1.0.0

- First release
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<Authors>Tiago Conceição; sn4k3</Authors>
<Company>PTRTECH</Company>
<Copyright>Copyright 2023-$([System.DateTime]::Now.ToString(`yyyy`)) © PTRTECH</Copyright>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Description>Queries and fetch data from species, taxon and conservation database(s) to retrieve information using the provider API.</Description>

<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/sn4k3/SpeciesDatabaseApi</RepositoryUrl>
<PackageProjectUrl>https://github.com/sn4k3/SpeciesDatabaseApi</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/sn4k3/SpeciesDatabaseApi/blob/master/CHANGELOG.md</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/sn4k3/SpeciesDatabaseApi/releases</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<PackageTags>species, taxomy, taxomony, biota, database, api, rest, world register of marine species, wrms, worms, iucn, conservation, nature</PackageTags>
<PackageTags>species, taxomy, taxomony, biota, database, api, rest, world, register, marine, wrms, worms, iucn, mr, conservation, nature, regions</PackageTags>
<RepositoryType>Git</RepositoryType>

<Nullable>enable</Nullable>
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[![License](https://img.shields.io/github/license/sn4k3/SpeciesDatabaseApi?style=for-the-badge)](https://github.com/sn4k3/SpeciesDatabaseApi/blob/master/LICENSE.txt)
[![GitHub repo size](https://img.shields.io/github/repo-size/sn4k3/SpeciesDatabaseApi?style=for-the-badge)](#)
[![Code size](https://img.shields.io/github/languages/code-size/sn4k3/SpeciesDatabaseApi?style=for-the-badge)](#)
[![Total code](https://img.shields.io/tokei/lines/github/sn4k3/SpeciesDatabaseApi?style=for-the-badge)](#)
[![Nuget](https://img.shields.io/nuget/v/SpeciesDatabaseApi?style=for-the-badge)](https://www.nuget.org/packages/SpeciesDatabaseApi)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/sn4k3?color=red&style=for-the-badge)](https://github.com/sponsors/sn4k3)
<!--[![Downloads](https://img.shields.io/github/downloads/sn4k3/SpeciesDatabaseApi/total?style=for-the-badge)](https://github.com/sn4k3/SpeciesDatabaseApi/releases)!-->

# Species Database Api

Expand All @@ -14,7 +14,8 @@ Queries and fetch data from species, taxon and conservation database(s) to retri
| Acronym | Name | Class | Terms of use |
| --------------------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| [WoRMS](https://www.marinespecies.org) | World Register of Marine Species | [WormsClient](https://github.com/sn4k3/SpeciesDatabaseApi/blob/master/SpeciesDatabaseApi/Worms/WormsClient.cs) | [Terms of use](https://www.marinespecies.org/about.php#terms) |
| [IUCN](https://www.iucn.org) | International Union for Conservation of Nature | [IucnClient](https://github.com/sn4k3/SpeciesDatabaseApi/blob/master/SpeciesDatabaseApi/Iucn/IucnClient.cs) | [Terms of use](http://apiv3.iucnredlist.org/about) |
| [IUCN](https://www.iucn.org) | International Union for Conservation of Nature | [IucnClient](https://github.com/sn4k3/SpeciesDatabaseApi/blob/master/SpeciesDatabaseApi/Iucn/IucnClient.cs) | [Terms of use](http://apiv3.iucnredlist.org/about) |
| [MR](https://www.iucn.org) | Marine Regions | [MrClient](https://github.com/sn4k3/SpeciesDatabaseApi/blob/master/SpeciesDatabaseApi/Mr/MrClient.cs) | [Terms of use](https://marineregions.org/disclaimer.php) |

## Terms of use

Expand Down Expand Up @@ -76,7 +77,7 @@ Modified: 15/01/2008 17:27:08
## Example (IUCN)

```C#
private static readonly IucnClient Client = new IucnClient();
private static readonly IucnClient Client = new IucnClient("your-api-key");

private async void Main()
{
Expand Down Expand Up @@ -113,8 +114,9 @@ Run the "SpeciesDatabaseCmd.exe" and follow the in-terminal instructions to call
# -?, -h, --help Show help and usage information
#
# Commands:
# WORMS Query - World Register of Marine Species
# IUCN Query - International Union for Conservation of Nature
# WORMS Query - World Register of Marine Species (https://marinespecies.org)
# IUCN Query - International Union for Conservation of Nature (http://iucnredlist.org)
# MR Query - Marine Regions (https://marineregions.org)

SpeciesDatabaseCmd.exe IUCN SpecieCommonNames "Carcharodon carcharias"

Expand Down
Loading

0 comments on commit 7d16f4b

Please sign in to comment.