cointainer-scraper-ecb


Namecointainer-scraper-ecb JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/cointainer/cointainer-scraper-ecb
SummaryCointainer component for scraping coins from the ECB Website.
upload_time2022-12-19 12:40:53
maintainer
docs_urlNone
authorB4rtware
requires_python>=3.9,<4.0
licenseApache-2.0
keywords scraper ecb coins collectables
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://github.com/cointainer/scraper-ecb/raw/main/docs/images/Cointainer-Scraper.png" width="100%" alt="Cointainer-Scraper Banner">

> Cointainer component for scraping coins from the ECB Website.

<div align="center">
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg">
</a>
<a href="https://github.com/cointainer/cointainer-scraper-ecb/blob/main/LICENSE">
    <img alt="License" src="https://img.shields.io/github/license/cointainer/
cointainer-scraper-ecb.svg?color=blue">
</a><br>
<a href="https://github.com/cointainer/scraper-ecb"><img src="https://img.shields.io/pypi/pyversions/cointainer-scraper-ecb.svg"></a>
<a href="">
  <img src="https://img.shields.io/pypi/v/cointainer-scraper-ecb?color=dar-green" />
</a>
</div>

## Introduction

Cointainer Scraper (ECB) is one of the components of the Cointainer. This component offers the functionality of scraping euro coin data from the ECB website.

Currently supported coins:
- €2 commemorative coins
  - Country
  - Feature
  - Description
  - Issuing Volume
  - Issuing Date
  - Image URLs

## Installation

```bash
pip install cointainer-scraper-ecb
```

## Example
```python
from cointainer_scraper_ecb import get_two_euro_commemorative_coins

get_two_euro_commemorative_coins(
    language="en",
    year=2004
)
```
> Tested with Python 3.9.13 and cointainer_scraper_ecb v0.1.3 ✔️

Two data classes are relevant which are beeing returned by the function:
```python
def get_two_euro_commemorative_coins(
    lang: str = "en",
    year: int = START_YEAR
) -> List[TwoEuro]: ...
```

```python
@dataclass
class Coinage:
    """Represents a coin of a country to be collected."""

    country: Optional[str]
    image_default_url: Optional[str]
    volume: Optional[int]
    image_default_url_info: Optional[str] = None
    country_info: Optional[str] = None
    circulation_date: Optional[datetime.date] = None
    image_attribution: Optional[str] = None
    circulation_date_info: Optional[str] = None
    volume_info: Optional[str] = None


@dataclass
class TwoEuro:
    """A two euro coin to collect."""

    feature: str = ""
    description: str = ""
    coinages: List[Coinage] = field(default_factory=list)
```

## Roadmap

- [ ] Implement national side scraping (2€, 1€, 50 cent, 20 cent, 10 cent, 5 cent, 2 cent and 1 cent)
- [ ] CLI implementation with click

## Development

### Creating a new release

1. Run the following command `poetry version <version>`
<br>*cointainer-scraper-ecb* uses the following schema: `^\d+\.\d+\.\d+((b|a)\d+)?$`

2. Bump the version within the files: 
   - [`cointainer_scraper_ecb/__init__.py`](cointainer_scraper_ecb/__init__.py)
   - [`tests/test_cointainer_scraper_ecb.py`](tests/test_cointainer_scraper_ecb.py)
   - [`pyproject.toml`](pyproject.toml)

    *Make sure it's the same version used when bumping with poetry*

3. Open `CHANGELOG.md` and write the new changelog:
    - Use the following `#` header: `v<version> - (yyyy-mm-dd)`
    <br>Used `##` headers:
    - 💌 Added
    - 🔨 Fixed
    - ♻️ Changed

4. Stage the modified files and push them with the following commit message:
    > chore: bump to version `v<version>`

5. Create annotated release tag
   1.  New tag
    ```
    git tag -s -m "release v<version>" v<version>
    ```
   2. Push created tag

    ```
    git push --tags
    ```

6. Run the following command `poetry build` to create a tarball and a wheel based on the new version

7. Create a new github release and:
    1. Copy and paste the changelog content **without** the `#` header into the *description of the release* textbox
    2. Use the `#` header style to fill in the *Release title* (copy it from the `CHANGELOG.md`)
    3. Copy the version with the `v`-prefix into the *Tag version*

4. Attach the produced tarball and wheel (`dist/`) to the release

5. Check *This is a pre-release* if it's either an alpha or beta release *(a|b)* - ***optional*** 

6.  **Publish release**

### Testing

Use the following command to execute the tests:

```bash
poetry run pytest
```

To run the tests, the: `download-test-files.(ps1|sh)` script must be executed.

This is not the best method because the test data can change. However, I don't know if it is allowed to upload the data to the repository because of the copyright.

## License
This cointainer-scraper-ecb module is distributed under Apache-2.0. For ODbL-1.0 exception, see [LICENSING.md](https://github.com/cointainer/cointainer-scraper-ecb/blob/main/LICENSING.md)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cointainer/cointainer-scraper-ecb",
    "name": "cointainer-scraper-ecb",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "scraper,ecb,coins,collectables",
    "author": "B4rtware",
    "author_email": "34386047+B4rtware@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/7e/12/a58aea83da8bd2b231c8bbe40c71a851e15d447a259b781031097522546d/cointainer-scraper-ecb-0.1.3.tar.gz",
    "platform": null,
    "description": "<img src=\"https://github.com/cointainer/scraper-ecb/raw/main/docs/images/Cointainer-Scraper.png\" width=\"100%\" alt=\"Cointainer-Scraper Banner\">\n\n> Cointainer component for scraping coins from the ECB Website.\n\n<div align=\"center\">\n<a href=\"https://github.com/psf/black\"><img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\">\n</a>\n<a href=\"https://github.com/cointainer/cointainer-scraper-ecb/blob/main/LICENSE\">\n    <img alt=\"License\" src=\"https://img.shields.io/github/license/cointainer/\ncointainer-scraper-ecb.svg?color=blue\">\n</a><br>\n<a href=\"https://github.com/cointainer/scraper-ecb\"><img src=\"https://img.shields.io/pypi/pyversions/cointainer-scraper-ecb.svg\"></a>\n<a href=\"\">\n  <img src=\"https://img.shields.io/pypi/v/cointainer-scraper-ecb?color=dar-green\" />\n</a>\n</div>\n\n## Introduction\n\nCointainer Scraper (ECB) is one of the components of the Cointainer. This component offers the functionality of scraping euro coin data from the ECB website.\n\nCurrently supported coins:\n- \u20ac2 commemorative coins\n  - Country\n  - Feature\n  - Description\n  - Issuing Volume\n  - Issuing Date\n  - Image URLs\n\n## Installation\n\n```bash\npip install cointainer-scraper-ecb\n```\n\n## Example\n```python\nfrom cointainer_scraper_ecb import get_two_euro_commemorative_coins\n\nget_two_euro_commemorative_coins(\n    language=\"en\",\n    year=2004\n)\n```\n> Tested with Python 3.9.13 and cointainer_scraper_ecb v0.1.3 \u2714\ufe0f\n\nTwo data classes are relevant which are beeing returned by the function:\n```python\ndef get_two_euro_commemorative_coins(\n    lang: str = \"en\",\n    year: int = START_YEAR\n) -> List[TwoEuro]: ...\n```\n\n```python\n@dataclass\nclass Coinage:\n    \"\"\"Represents a coin of a country to be collected.\"\"\"\n\n    country: Optional[str]\n    image_default_url: Optional[str]\n    volume: Optional[int]\n    image_default_url_info: Optional[str] = None\n    country_info: Optional[str] = None\n    circulation_date: Optional[datetime.date] = None\n    image_attribution: Optional[str] = None\n    circulation_date_info: Optional[str] = None\n    volume_info: Optional[str] = None\n\n\n@dataclass\nclass TwoEuro:\n    \"\"\"A two euro coin to collect.\"\"\"\n\n    feature: str = \"\"\n    description: str = \"\"\n    coinages: List[Coinage] = field(default_factory=list)\n```\n\n## Roadmap\n\n- [ ] Implement national side scraping (2\u20ac, 1\u20ac, 50 cent, 20 cent, 10 cent, 5 cent, 2 cent and 1 cent)\n- [ ] CLI implementation with click\n\n## Development\n\n### Creating a new release\n\n1. Run the following command `poetry version <version>`\n<br>*cointainer-scraper-ecb* uses the following schema: `^\\d+\\.\\d+\\.\\d+((b|a)\\d+)?$`\n\n2. Bump the version within the files: \n   - [`cointainer_scraper_ecb/__init__.py`](cointainer_scraper_ecb/__init__.py)\n   - [`tests/test_cointainer_scraper_ecb.py`](tests/test_cointainer_scraper_ecb.py)\n   - [`pyproject.toml`](pyproject.toml)\n\n    *Make sure it's the same version used when bumping with poetry*\n\n3. Open `CHANGELOG.md` and write the new changelog:\n    - Use the following `#` header: `v<version> - (yyyy-mm-dd)`\n    <br>Used `##` headers:\n    - \ud83d\udc8c Added\n    - \ud83d\udd28 Fixed\n    - \u267b\ufe0f Changed\n\n4. Stage the modified files and push them with the following commit message:\n    > chore: bump to version `v<version>`\n\n5. Create annotated release tag\n   1.  New tag\n    ```\n    git tag -s -m \"release v<version>\" v<version>\n    ```\n   2. Push created tag\n\n    ```\n    git push --tags\n    ```\n\n6. Run the following command `poetry build` to create a tarball and a wheel based on the new version\n\n7. Create a new github release and:\n    1. Copy and paste the changelog content **without** the `#` header into the *description of the release* textbox\n    2. Use the `#` header style to fill in the *Release title* (copy it from the `CHANGELOG.md`)\n    3. Copy the version with the `v`-prefix into the *Tag version*\n\n4. Attach the produced tarball and wheel (`dist/`) to the release\n\n5. Check *This is a pre-release* if it's either an alpha or beta release *(a|b)* - ***optional*** \n\n6.  **Publish release**\n\n### Testing\n\nUse the following command to execute the tests:\n\n```bash\npoetry run pytest\n```\n\nTo run the tests, the: `download-test-files.(ps1|sh)` script must be executed.\n\nThis is not the best method because the test data can change. However, I don't know if it is allowed to upload the data to the repository because of the copyright.\n\n## License\nThis cointainer-scraper-ecb module is distributed under Apache-2.0. For ODbL-1.0 exception, see [LICENSING.md](https://github.com/cointainer/cointainer-scraper-ecb/blob/main/LICENSING.md)",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Cointainer component for scraping coins from the ECB Website.",
    "version": "0.1.3",
    "split_keywords": [
        "scraper",
        "ecb",
        "coins",
        "collectables"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "fa94cad7e46e2c00b38565e89b2decb6",
                "sha256": "76739829b892a6680b4077da7399b3a9f0bf7e47415b4ed7fa46a52dab32dc49"
            },
            "downloads": -1,
            "filename": "cointainer_scraper_ecb-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fa94cad7e46e2c00b38565e89b2decb6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 54736,
            "upload_time": "2022-12-19T12:40:55",
            "upload_time_iso_8601": "2022-12-19T12:40:55.248873Z",
            "url": "https://files.pythonhosted.org/packages/8e/ca/e5900320a4667be5ea2c6e5b46ae36b8e2c22c4050989c5037372b198b86/cointainer_scraper_ecb-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "4a6204ca0b0a3935cfa3b1ebe9181c1c",
                "sha256": "45f0961cbe96096293c9aaba48cb1d97b417470782d1329a66fba5c97d595920"
            },
            "downloads": -1,
            "filename": "cointainer-scraper-ecb-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "4a6204ca0b0a3935cfa3b1ebe9181c1c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 54293,
            "upload_time": "2022-12-19T12:40:53",
            "upload_time_iso_8601": "2022-12-19T12:40:53.821979Z",
            "url": "https://files.pythonhosted.org/packages/7e/12/a58aea83da8bd2b231c8bbe40c71a851e15d447a259b781031097522546d/cointainer-scraper-ecb-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-19 12:40:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "cointainer",
    "github_project": "cointainer-scraper-ecb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cointainer-scraper-ecb"
}
        
Elapsed time: 0.02002s