Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
93bdbe7
Basic refactoring:
maxachis Dec 15, 2024
0fe043f
Basic refactoring:
maxachis Dec 15, 2024
4f5cc51
Basic refactoring:
maxachis Dec 15, 2024
9294fb0
Basic refactoring:
maxachis Dec 15, 2024
dd3ee80
Refactor: Add FOIAFetcher
maxachis Dec 15, 2024
435b090
Refactor: Add utility functions
maxachis Dec 15, 2024
7dd7d0c
Refactor: Create FOIASearcher
maxachis Dec 15, 2024
dd3f0a2
Remove `search_local_foia_json.py`
maxachis Dec 15, 2024
01d5f6b
Refactor: Create MuckrockFetchers
maxachis Dec 16, 2024
cc5b20d
Refactor: Modularize Logic
maxachis Dec 16, 2024
56062d2
Refactor: Modularize Logic
maxachis Dec 16, 2024
62f5a50
Refactor get_allegheny_foias.py
maxachis Dec 16, 2024
b6b30a4
Refactor create_foia_data_db.py
maxachis Dec 16, 2024
ee4a854
Refactor search_foia_data_db.py
maxachis Dec 16, 2024
ee76173
Refactor Directory
maxachis Dec 16, 2024
147a786
Begin draft of PDAP client
maxachis Dec 18, 2024
82d8c5b
Continue draft
maxachis Dec 18, 2024
55695fb
Continue draft of PDAP client
maxachis Dec 18, 2024
e8d599e
Refactor: Move AccessManager to separate file
maxachis Dec 18, 2024
8f10a8f
Add "Creating a Collector" section to CollectorManager readme.
maxachis Dec 22, 2024
67e54e8
Develop AutoGooglerCollector and connect to CollectorManager
maxachis Dec 22, 2024
da67086
Create Source Collector Core
maxachis Dec 24, 2024
0b50599
Incorporate CommonCrawler into Source Collector
maxachis Dec 25, 2024
34430cb
Merge branch 'mc_105_muckrock_scraper_enhancements' into mc_122_sourc…
maxachis Dec 25, 2024
c7fc102
Incorporate Muckrock Collectors into Source Collector
maxachis Dec 25, 2024
d8c19fd
Incorporate CKAN Collector into Source Collector
maxachis Dec 26, 2024
bde0ba7
Incorporate CKAN Collector into Source Collector
maxachis Dec 26, 2024
e1a8ad9
Add README files and rearrange some logic.
maxachis Dec 26, 2024
413caf7
Merge branch 'refs/heads/mc_122_source_collector_main' into mc_128_so…
maxachis Dec 27, 2024
fa4bdf9
Latest Draft of Source Collector
maxachis Dec 29, 2024
0bd78bc
Clean up directory, fix tests
maxachis Dec 30, 2024
b83ddfe
Cleanup and update READMEs
maxachis Dec 30, 2024
08fcda0
Update and Refine Duplicate logic and add additional endpoints
maxachis Dec 30, 2024
b79a8a1
Fix several bugs
maxachis Dec 30, 2024
253e1bc
Create `/batch/{id}/logs` route
maxachis Dec 31, 2024
5529c43
Draft on authorization work.
maxachis Dec 31, 2024
6403c74
Complete first draft of API security manager
maxachis Dec 31, 2024
9580d27
Add logic for deleting old logs periodically
maxachis Dec 31, 2024
291896e
Set up Label Studio pipeline.
maxachis Dec 31, 2024
eda628a
Add integration test for security validation.
maxachis Dec 31, 2024
0d48ba7
Fix bug in access info override.
maxachis Jan 1, 2025
42a46fd
Add alembic base
maxachis Jan 1, 2025
497012b
Add user id to batches
maxachis Jan 1, 2025
aa616f4
Fix bugs from latest round of development.
maxachis Jan 1, 2025
c464c51
Major refactors:
maxachis Jan 4, 2025
fb1a744
Implement and fix abort logic
maxachis Jan 4, 2025
cc2da16
Replace thread logic with executor logic
maxachis Jan 4, 2025
593e110
Add pagination for batch URL and duplicate queries
maxachis Jan 4, 2025
681e249
Remove openai playground
maxachis Jan 4, 2025
85ce7f6
Migrate hugging_face specific requirements to HuggingFace directory
maxachis Jan 4, 2025
07b9109
Fix import pathfinding issues
maxachis Jan 5, 2025
01d0e0d
Add pandas and datasets
maxachis Jan 5, 2025
91bdd39
Setup Dockerfile, docker-compose yml files, GitHub Action
maxachis Jan 5, 2025
00fcab0
Setup Dockerfile, docker-compose yml files, GitHub Action
maxachis Jan 5, 2025
84db6b4
Setup Dockerfile, docker-compose yml files, GitHub Action
maxachis Jan 5, 2025
8120102
Setup Dockerfile, docker-compose yml files, GitHub Action
maxachis Jan 5, 2025
e4e7bb0
Setup Dockerfile, docker-compose yml files, GitHub Action
maxachis Jan 5, 2025
e7d2457
Add to README, rename docker-compose-test.yml to docker-compose.yml
maxachis Jan 5, 2025
5e8efb2
Update Readme to mention different environment variables depending on OS
maxachis Jan 6, 2025
bc7106e
Clean up README
maxachis Jan 6, 2025
0e57a85
Clean up README
maxachis Jan 6, 2025
5b86ce9
Clean up README
maxachis Jan 6, 2025
5e38843
Update docker-compose.yml and README.md
maxachis Jan 6, 2025
33780bc
Update docker-compose.yml and README.md
maxachis Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/test_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This workflow will test the Source Collector App
# Utilizing the docker-compose file in the root directory
name: Test Source Collector App
on: pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run docker-compose
uses: hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: "docker-compose.yml"
- name: Execute tests in the running service
run: |
docker exec data-source-identification-app-1 pytest /app/tests/test_automated
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dockerfile for Source Collector FastAPI app

FROM python:3.12.8

# Set working directory
WORKDIR /app

# Copy project files
COPY . .

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose the application port
EXPOSE 80

# Run FastAPI app with uvicorn
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "80"]
17 changes: 17 additions & 0 deletions ENV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This page provides a full list, with description, of all the environment variables used by the application.

Please ensure these are properly defined in a `.env` file in the root directory.

| Name | Description | Example |
|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| `LABEL_STUDIO_ACCESS_TOKEN` | The access token for the Label Studio API. The access token for the Label Studio API. This can be obtained by logging into Label Studio and navigating to the [user account section](https://app.heartex.com/user/account), where the access token can be copied. | `abc123` |
| `LABEL_STUDIO_PROJECT_ID` | The project ID for the Label Studio API. This can be obtained by logging into Label Studio and navigating to the relevant project, where the project id will be in the URL, as in `https://app.heartex.com/projects/58475/` | `58475` |
| `LABEL_STUDIO_ORGANIZATION_ID` | The organization ID for the Label Studio API. This can be obtained by logging into Label Studio and navigating to the [Organization section](https://app.heartex.com/organization?page=1), where the organization ID can be copied. | `6758` |
| `GOOGLE_API_KEY` | The API key required for accessing the Google Custom Search API | `abc123` |
| `GOOGLE_CSE_ID` | The CSE ID required for accessing the Google Custom Search API | `abc123` |
|`POSTGRES_USER` | The username for the test database | `test_source_collector_user` |
|`POSTGRES_PASSWORD` | The password for the test database | `HanviliciousHamiltonHilltops` |
|`POSTGRES_DB` | The database name for the test database | `source_collector_test_db` |
|`POSTGRES_HOST` | The host for the test database | `127.0.0.1` |
|`POSTGRES_PORT` | The port for the test database | `5432` |
|`DS_APP_SECRET_KEY`| The secret key used for decoding JWT tokens produced by the Data Sources App. Must match the secret token that is used in the Data Sources App for encoding. |`abc123`|
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ openai-playground | Scripts for accessing the openai API on PDAP's shared accoun
source_collectors| Tools for extracting metadata from different sources, including CKAN data portals and Common Crawler
collector_db | Database for storing data from source collectors
collector_manager | A module which provides a unified interface for interacting with source collectors and relevant data
core | A module which integrates other components, such as collector_manager and collector_db
api | API for interacting with collector_manager, core, and collector_db
local_database | Resources for setting up a test database for local development

## How to use

Expand All @@ -30,6 +33,29 @@ Thank you for your interest in contributing to this project! Please follow these
- If you want to work on something, create an issue first so the broader community can discuss it.
- If you make a utility, script, app, or other useful bit of code: put it in a top-level directory with an appropriate name and dedicated README and add it to the index.

# Testing

Note that prior to running tests, you need to install [Docker](https://docs.docker.com/get-started/get-docker/) and have the Docker engine running.

Tests can be run by spinning up the `docker-compose-test.yml` file in the root directory. This will start a two-container setup, consisting of the FastAPI Web App and a clean Postgres Database.

This can be done via the following command:

```bash
docker compose up -d
```

Note that while the container may mention the web app running on `0.0.0.0:8000`, the actual host may be `127.0.0.1:8000`.

To access the API documentation, visit `http://{host}:8000/docs`.

To run tests on the container, run:

```bash
docker exec data-source-identification-app-1 pytest /app/tests/test_automated
```

Be sure to inspect the `docker-compose.yml` file in the root directory -- some environment variables are dependant upon the Operating System you are using.

# Diagrams

Expand Down
2 changes: 1 addition & 1 deletion annotation_pipeline/populate_labelstudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def label_studio_upload(batch_id: str, FILENAME: str, record_type: str):
api_manager = LabelStudioAPIManager(config)

#import tasks
label_studio_response = api_manager.import_tasks_into_project(data)
label_studio_response = api_manager.export_tasks_into_project(data)

#check import success
if label_studio_response.status_code == HTTPStatus.CREATED:
Expand Down
7 changes: 7 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
To spin up a development version of the client, run:

```bash
fastapi dev main.py
```

For the client to function properly in a local environment, the local database must be set up. Consult the `README.md` file in the `local_database` directory for further instructions.
File renamed without changes.
6 changes: 6 additions & 0 deletions api/dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from core.SourceCollectorCore import SourceCollectorCore

Check warning on line 1 in api/dependencies.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/dependencies.py#L1 <100>

Missing docstring in public module
Raw output
./api/dependencies.py:1:1: D100 Missing docstring in public module


def get_core() -> SourceCollectorCore:

Check warning on line 4 in api/dependencies.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/dependencies.py#L4 <103>

Missing docstring in public function
Raw output
./api/dependencies.py:4:1: D103 Missing docstring in public function
from api.main import app
return app.state.core
47 changes: 47 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from contextlib import asynccontextmanager

Check warning on line 1 in api/main.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/main.py#L1 <100>

Missing docstring in public module
Raw output
./api/main.py:1:1: D100 Missing docstring in public module

from fastapi import FastAPI

from api.routes.batch import batch_router
from api.routes.collector import collector_router
from api.routes.label_studio import label_studio_router
from api.routes.root import root_router
from collector_db.DatabaseClient import DatabaseClient
from core.CoreLogger import CoreLogger
from core.SourceCollectorCore import SourceCollectorCore


@asynccontextmanager
async def lifespan(app: FastAPI):

Check warning on line 15 in api/main.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/main.py#L15 <103>

Missing docstring in public function
Raw output
./api/main.py:15:1: D103 Missing docstring in public function
# Initialize shared dependencies
db_client = DatabaseClient()
source_collector_core = SourceCollectorCore(
core_logger=CoreLogger(
db_client=db_client
),
db_client=DatabaseClient(),
)

# Pass dependencies into the app state
app.state.core = source_collector_core

# Startup logic
yield # Code here runs before shutdown

# Shutdown logic (if needed)
app.state.core.shutdown()
# Clean up resources, close connections, etc.
pass


app = FastAPI(
title="Source Collector API",
description="API for collecting data sources",
version="0.1.0",
lifespan=lifespan
)

app.include_router(root_router)
app.include_router(collector_router)
app.include_router(batch_router)
app.include_router(label_studio_router)
Empty file added api/routes/__init__.py
Empty file.
98 changes: 98 additions & 0 deletions api/routes/batch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
from typing import Optional

Check warning on line 1 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L1 <100>

Missing docstring in public module
Raw output
./api/routes/batch.py:1:1: D100 Missing docstring in public module

from fastapi import Path, APIRouter
from fastapi.params import Query, Depends

from api.dependencies import get_core
from collector_db.DTOs.BatchInfo import BatchInfo
from collector_manager.enums import CollectorType
from core.DTOs.GetBatchLogsResponse import GetBatchLogsResponse
from core.DTOs.GetBatchStatusResponse import GetBatchStatusResponse
from core.DTOs.GetDuplicatesByBatchResponse import GetDuplicatesByBatchResponse
from core.DTOs.GetURLsByBatchResponse import GetURLsByBatchResponse
from core.DTOs.MessageResponse import MessageResponse
from core.SourceCollectorCore import SourceCollectorCore
from core.enums import BatchStatus
from security_manager.SecurityManager import AccessInfo, get_access_info

batch_router = APIRouter(
prefix="/batch",
tags=["Batch"],
responses={404: {"description": "Not found"}},
)


@batch_router.get("")
def get_batch_status(
collector_type: Optional[CollectorType] = Query(
description="Filter by collector type",
default=None
),
status: Optional[BatchStatus] = Query(
description="Filter by status",
default=None
),
page: int = Query(
description="The page number",
default=1
),
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),

Check warning on line 40 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L40 <100>

Unused argument 'access_info'
Raw output
./api/routes/batch.py:40:9: U100 Unused argument 'access_info'
) -> GetBatchStatusResponse:
"""
Get the status of recent batches
"""
return core.get_batch_statuses(collector_type=collector_type, status=status, page=page)


@batch_router.get("/{batch_id}")
def get_batch_info(

Check warning on line 49 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L49 <103>

Missing docstring in public function
Raw output
./api/routes/batch.py:49:1: D103 Missing docstring in public function
batch_id: int = Path(description="The batch id"),
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),

Check warning on line 52 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L52 <100>

Unused argument 'access_info'
Raw output
./api/routes/batch.py:52:9: U100 Unused argument 'access_info'
) -> BatchInfo:
return core.get_batch_info(batch_id)

@batch_router.get("/{batch_id}/urls")
def get_urls_by_batch(

Check warning on line 57 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L57 <103>

Missing docstring in public function
Raw output
./api/routes/batch.py:57:1: D103 Missing docstring in public function
batch_id: int = Path(description="The batch id"),
page: int = Query(
description="The page number",
default=1
),
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),

Check warning on line 64 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L64 <100>

Unused argument 'access_info'
Raw output
./api/routes/batch.py:64:9: U100 Unused argument 'access_info'
) -> GetURLsByBatchResponse:
return core.get_urls_by_batch(batch_id, page=page)

@batch_router.get("/{batch_id}/duplicates")
def get_duplicates_by_batch(

Check warning on line 69 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L69 <103>

Missing docstring in public function
Raw output
./api/routes/batch.py:69:1: D103 Missing docstring in public function
batch_id: int = Path(description="The batch id"),
page: int = Query(
description="The page number",
default=1
),
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),

Check warning on line 76 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L76 <100>

Unused argument 'access_info'
Raw output
./api/routes/batch.py:76:9: U100 Unused argument 'access_info'
) -> GetDuplicatesByBatchResponse:
return core.get_duplicate_urls_by_batch(batch_id, page=page)

@batch_router.get("/{batch_id}/logs")
def get_batch_logs(
batch_id: int = Path(description="The batch id"),
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),

Check warning on line 84 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L84 <100>

Unused argument 'access_info'
Raw output
./api/routes/batch.py:84:9: U100 Unused argument 'access_info'
) -> GetBatchLogsResponse:
"""
Retrieve the logs for a recent batch.
Note that for later batches, the logs may not be available.
"""
return core.get_batch_logs(batch_id)

@batch_router.post("/{batch_id}/abort")
def abort_batch(

Check warning on line 93 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L93 <103>

Missing docstring in public function
Raw output
./api/routes/batch.py:93:1: D103 Missing docstring in public function
batch_id: int = Path(description="The batch id"),
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),

Check warning on line 96 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L96 <100>

Unused argument 'access_info'
Raw output
./api/routes/batch.py:96:9: U100 Unused argument 'access_info'
) -> MessageResponse:
return core.abort_batch(batch_id)

Check warning on line 98 in api/routes/batch.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/batch.py#L98 <292>

no newline at end of file
Raw output
./api/routes/batch.py:98:38: W292 no newline at end of file
127 changes: 127 additions & 0 deletions api/routes/collector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
from typing import Optional

Check warning on line 1 in api/routes/collector.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/collector.py#L1 <100>

Missing docstring in public module
Raw output
./api/routes/collector.py:1:1: D100 Missing docstring in public module

Check warning on line 1 in api/routes/collector.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/collector.py#L1 <401>

'typing.Optional' imported but unused
Raw output
./api/routes/collector.py:1:1: F401 'typing.Optional' imported but unused

from fastapi import APIRouter, Query

Check warning on line 3 in api/routes/collector.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/collector.py#L3 <401>

'fastapi.Query' imported but unused
Raw output
./api/routes/collector.py:3:1: F401 'fastapi.Query' imported but unused
from fastapi.params import Depends

from api.dependencies import get_core
from collector_manager.DTOs.ExampleInputDTO import ExampleInputDTO
from collector_manager.enums import CollectorType
from core.DTOs.CollectorStartInfo import CollectorStartInfo
from core.SourceCollectorCore import SourceCollectorCore
from security_manager.SecurityManager import AccessInfo, get_access_info
from source_collectors.auto_googler.DTOs import AutoGooglerInputDTO
from source_collectors.ckan.DTOs import CKANInputDTO
from source_collectors.common_crawler.DTOs import CommonCrawlerInputDTO
from source_collectors.muckrock.DTOs import MuckrockCountySearchCollectorInputDTO, \
MuckrockAllFOIARequestsCollectorInputDTO, MuckrockSimpleSearchCollectorInputDTO

collector_router = APIRouter(
prefix="/collector",
tags=["Collector"],
responses={404: {"description": "Not found"}},
)

@collector_router.post("/example")
async def start_example_collector(
dto: ExampleInputDTO,
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),
) -> CollectorStartInfo:
"""
Start the example collector
"""
return core.initiate_collector(
collector_type=CollectorType.EXAMPLE,
dto=dto,
user_id=access_info.user_id
)

@collector_router.post("/ckan")
async def start_ckan_collector(
dto: CKANInputDTO,
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),
) -> CollectorStartInfo:
"""
Start the ckan collector
"""
return core.initiate_collector(
collector_type=CollectorType.CKAN,
dto=dto,
user_id=access_info.user_id
)

@collector_router.post("/common-crawler")
async def start_common_crawler_collector(
dto: CommonCrawlerInputDTO,
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),
) -> CollectorStartInfo:
"""
Start the common crawler collector
"""
return core.initiate_collector(
collector_type=CollectorType.COMMON_CRAWLER,
dto=dto,
user_id=access_info.user_id
)

@collector_router.post("/auto-googler")
async def start_auto_googler_collector(
dto: AutoGooglerInputDTO,
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),
) -> CollectorStartInfo:
"""
Start the auto googler collector
"""
return core.initiate_collector(
collector_type=CollectorType.AUTO_GOOGLER,
dto=dto,
user_id=access_info.user_id
)

@collector_router.post("/muckrock-simple")
async def start_muckrock_collector(
dto: MuckrockSimpleSearchCollectorInputDTO,
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),
) -> CollectorStartInfo:
"""
Start the muckrock collector
"""
return core.initiate_collector(
collector_type=CollectorType.MUCKROCK_SIMPLE_SEARCH,
dto=dto,
user_id=access_info.user_id
)

@collector_router.post("/muckrock-county")
async def start_muckrock_county_collector(
dto: MuckrockCountySearchCollectorInputDTO,
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),
) -> CollectorStartInfo:
"""
Start the muckrock county level collector
"""
return core.initiate_collector(
collector_type=CollectorType.MUCKROCK_COUNTY_SEARCH,
dto=dto,
user_id=access_info.user_id
)

@collector_router.post("/muckrock-all")
async def start_muckrock_all_foia_collector(
dto: MuckrockAllFOIARequestsCollectorInputDTO,
core: SourceCollectorCore = Depends(get_core),
access_info: AccessInfo = Depends(get_access_info),
) -> CollectorStartInfo:
"""
Start the muckrock collector for all FOIA requests
"""
return core.initiate_collector(
collector_type=CollectorType.MUCKROCK_ALL_SEARCH,
dto=dto,
user_id=access_info.user_id
)

Check warning on line 127 in api/routes/collector.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] api/routes/collector.py#L127 <292>

no newline at end of file
Raw output
./api/routes/collector.py:127:6: W292 no newline at end of file
Loading
Loading