semvec/pypi-packages huggingface dataset:
uk-election-timetables 4.3.0
Derives significant dates for UK elections
License: MIT

# uk-election-timetables

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/DemocracyClub/uk-election-timetables/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/DemocracyClub/uk-election-timetables/tree/main)
[![Documentation Status](https://readthedocs.org/projects/uk-election-timetables/badge/?version=latest)](https://uk-election-timetables.readthedocs.io/en/latest/overview.html?badge=latest)
[![PyPI](https://img.shields.io/pypi/v/uk-election-timetables.svg)](https://pypi.org/project/uk-election-timetables/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

This library encapsulates timetable legislation for elections run in the United Kingdom and its devolved administrations.

The election timetable varies based on:

 * *Type of Post* - Parliamentary, Local, devolved Government, etc.
 * *Country* - The United Kingdom has up to four different rules for the same type of election, one for each country.
 * *Calendar* - each country has their own unique set of Bank Holidays.

## Usage (publishing of candidate lists)

```python
from datetime import date
from uk_election_timetables.elections.uk_parliament import UKParliamentElection

election = UKParliamentElection(date(2019, 2, 21))

print(election.sopn_publish_date) # date(2019, 1, 25)
```

## Updating Bank Holiday Dates
This project checks daily for additions to the government bank holiday dataset at https://www.gov.uk/bank-holidays.json. When an addition is identified in the .gov file, this project will automatically create a GitHub issue to update our local bank holiday dataset.

To update `bank-holidays.json` with additions from the government supplied file, run the following within your venv:
```commandline
python manage_bank_holidays.py --update
```

## Documentation

Hosted by readthedocs at [https://uk-election-timetables.readthedocs.io/](https://uk-election-timetables.readthedocs.io/en/latest/overview.html)

## Installation

`pip install uk_election_timetables`
 
## Test

`pytest`

## Supported Election Types

 - [x] Local
 - [x] City of London Local
 - [x] United Kingdom Parliament
 - [x] Scottish Parliament
 - [x] Senedd Cymru
 - [x] Northern Ireland Assembly
 - [x] Mayoral
 - [x] Mayoral (London)
 - [x] Greater London Assembly
 - [x] Police and Crime commissioner
 - [x] Referendum
minmodapi 1.3.5
Client API for the MinMod API
License: MIT
Requires Python: <4.0,>=3.11

# MinMod API

MinMod API to create/update mineral sites.

## Quick start

1. Login to MinMod first. You can use the following command: `python -m minmodapi login -u <username> [-e <endpoint>]`. By default, the endpoint is `https://dev.minmod.isi.edu`, for production use `https://minmod.isi.edu`.

2. Upload mineral sites to MinMod programmatically:

```python

from minmodapi import MinModAPI, merge_deposit_type, replace_site

api = MinModAPI(<endpoint>)

# prepare a mineral site to upload
mineral_site = {
    "name": "test_mineral_site",
    "source_id": "https://api.cdr.land/v1/docs/documents",
    "record_id":  "021c30faa880995b3cab0fcdaa9ea2fa895634205ad3977b664f33492b2086052c"
    "location_info": {
        "country": [],
        "state_or_province": []
    },
    "mineral_inventory": [],
    "deposit_type_candidate": [],
    "modified_at": "2024-11-15T18:38:01.050553Z",
    ...
}

# Upload the mineral site. The function automatically determines whether
# to create a new site or update an existing one. If updating, the
# `apply_update` function merges the new site with the existing one.
# For instance, `replace_site` replaces the existing site with the new site.
# This function returns the identifier of the mineral site, or None if the upload fails.
mineral_site_ident = api.upsert_mineral_site(mineral_site, apply_update=replace_site)

# If not None, use `get_browse_link` or `get_api_link` to retrieve the site link.
if mineral_site_ident is not None:
    print("LOD link:", mineral_site_ident.get_browse_link())
    print("API link:", mineral_site_ident.get_api_link())
```
py-websites-scraper 0.1.2.1
Web scraper using aiohttp for efficient scraping of multiple URLs with ease
License: MIT
Requires Python: >=3.8

# About
Scrape main content on multiple websites using Python in parallel. 

> You still need to use proxy if the access to the website is blocked. Read "More Parameters" section.

## Dependency
- [AsyncIO](https://docs.python.org/3/library/asyncio.html)
- [aiohttp](https://docs.aiohttp.org/en/stable/)
- [Readability-lxml](https://pypi.org/project/readability-lxml/)

## How to use 
```
pip install py-websites-scraper
```

Quick usage:
```
import asyncio
from py_websites_scraper import scrape_urls

urls = ["https://news.ycombinator.com", "https://example.com"]
data = asyncio.run(scrape_urls(urls, max_concurrency=5))
for item in data:
    if item["success"] is True:
        print(item["url"], item.get("title"), item.get("content"))
    else:
        print("Failed fetching this URL: " + item["url"])
```

Available key on the response:
```
url
success # True/False
title   # only available when it's successful
content # only available when it's successful
error   # only available when it's failed
```

You can always check the `success` value if it's true, before fetching the `title` or `content`.


## More parameters
You can add any parameters for aiohttp to perform the request like headers, proxy, and more. Please check [aiohttp documentation](https://docs.aiohttp.org/en/stable/client_reference.html#clientrequest) for reference.

Example:
```
urls = []
results = await scrape_urls(
    urls,
    proxy="YOUR_PROXY_INFO",
    headers={"User-Agent": "USER_AGENT_INFO"},
)
```

## Limitation
- Gated content
- Dynamic generated content

## How the test the package locally for Dev
Install in editable mode:
```
pip install -e .
```

Run any file that importing this package
```
python test_local.py
```