Skip to main content

Cointainer component for scraping coins from the ECB Website.

Project description

Cointainer-Scraper Banner

Cointainer component for scraping coins from the ECB Website.

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

pip install cointainer-scraper-ecb

Example

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.0 ✔️

Two data classes are relevant which are beeing returned by the function:

def get_two_euro_commemorative_coins(
    lang: str = "en",
    year: int = START_YEAR
) -> List[TwoEuro]: ...
@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

A. Create annotated release tag

  1. New tag
git tag -a v<major>.<minor>.<patch>(a|b) -m release v<major>.<minor>.<patch>(a|b)
  1. Push created tag
git push --tags

B. Create GitHub release

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

  2. Bump the version within the file: cointainer_scraper_ecb/__init__.py
    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)
      Used ## headers:
    • 💌 Added
    • 🔨 Fixed
    • ♻️ Changed
  4. Stage the modified files and push them with the following commit message:

chore: bump to version v<version>

  1. Create annotated release tag

    1. New tag
    git tag -s -m "release v<version>" v<version>
    
    1. Push created tag
    git push --tags
    
  2. Run the following command poetry build to create a tarball and a wheel based on the new version

  3. 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:

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

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

cointainer-scraper-ecb-0.1.1.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

cointainer_scraper_ecb-0.1.1-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

Details for the file cointainer-scraper-ecb-0.1.1.tar.gz.

File metadata

  • Download URL: cointainer-scraper-ecb-0.1.1.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.4 Windows/10

File hashes

Hashes for cointainer-scraper-ecb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fed837f49bc9ece579c2898f27c77d2ceb142176308d55bc3b24b521909c9f88
MD5 bf212cc52c38e25bb1b72c96383eac04
BLAKE2b-256 70d507e7fc9f8ca0b648f7b956de8a43bf063fa029fe3de63b9a9fda93d589a4

See more details on using hashes here.

File details

Details for the file cointainer_scraper_ecb-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cointainer_scraper_ecb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fad1856441d61010f9d4ec27c4b40623ee4ab90c304a650ed522084fabd07331
MD5 cbf06523d8a43a36862e6744538f32ee
BLAKE2b-256 4741058e5b31be1de9338a3f3a1d6d5bd68af1fc250bda336ddb0d44111f2db0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page