Skip to content

Conversation

@combinatorist
Copy link
Collaborator

No description provided.

Comment on lines +16 to +17
POST_DETAILS_TO_CTFG: bool = "TRUE".startswith(
os.getenv("POST_DETAILS_TO_CTFG", "False").upper()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main change: this cuts down on unnecessary records

src/config.py Outdated
Comment on lines 40 to 41
WIKIDATA_MAX_LISTINGS_TO_SEARCH: int = int(
os.getenv("WIKIDATA_MAX_LISTINGS_TO_SEARCH", 5)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this externally configurable.

# WikidataItem.recursive_save(wiki_items)
if wiki_items:
log("Example item")
pprint(wiki_items[0].to_record())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better logging (know how many before start and only show example if available)

requires-python = "<4.0,>=3.13"
dependencies = [
"wikibaseintegrator @ git+https://github.com/LeMyst/WikibaseIntegrator.git@301067883ddce0bca31fdd54973c3d6c8cbbcb7d",
"wikibaseintegrator @ git+https://github.com/combinatorist/WikibaseIntegrator.git@feature/search_entities-exact-max_results",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Using a fork!

Comment on lines +40 to +42
def getEnvInt(name: str, default: int) -> int:
raw = os.getenv("WIKIDATA_MAX_RESULTS_PER_SEARCH")
return int(raw) if raw else default
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safer int retrieval

Comment on lines +21 to +23
sample(matchable_items, max_attempts)
if max_attempts and max_attempts < len(matchable_items)
else matchable_items
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safer sampling

@combinatorist combinatorist merged commit 5f3a319 into main Sep 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants