Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

# Monthly export → Zenodo (https://zenodo.org/records/13897048)
ZENODO_ENABLED=false
ZENODO_ACCESS_TOKEN=
ZENODO_LATEST_DEPOSITION_ID=13897048
ZENODO_CONCEPT_DOI=10.5281/zenodo.13382750
ZENODO_API_URL=https://zenodo.org/api
ZENODO_AUTO_PUBLISH=false
ZENODO_DRY_RUN=false
ZENODO_RELEASE_NOTES=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
Expand Down
11 changes: 11 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,15 @@
'cas_key' => env('CAS_KEY'),
],

'zenodo' => [
'enabled' => (bool) env('ZENODO_ENABLED', false),
'access_token' => env('ZENODO_ACCESS_TOKEN'),
'latest_deposition_id' => env('ZENODO_LATEST_DEPOSITION_ID'),
'concept_doi' => env('ZENODO_CONCEPT_DOI', '10.5281/zenodo.13382750'),
'api_url' => env('ZENODO_API_URL', 'https://zenodo.org/api'),
'auto_publish' => (bool) env('ZENODO_AUTO_PUBLISH', false),
'dry_run' => (bool) env('ZENODO_DRY_RUN', false),
'release_notes' => env('ZENODO_RELEASE_NOTES'),
],

];
18 changes: 17 additions & 1 deletion resources/scripts/python/exports/generate_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ def main():
sdf_filenames["light_sdf"] # e.g. coconut_sdf_2d_lite-03-2025.sdf
)

# Now we can safely remove the CSV files (since we've read them into SDF)
# Zip CSV exports for S3/Zenodo downloads, then remove the uncompressed files
zip_file(csv_with_collection)
zip_file(csv_without_collection)
cleanup_files(csv_with_collection, csv_without_collection)

# Zip the 2D SDF files, remove originals
Expand Down Expand Up @@ -652,5 +654,19 @@ def main():

print("All files have been successfully uploaded to S3.")

# 9. Publish to Zenodo (optional; configured via ZENODO_* env variables)
try:
from publish_zenodo import publish_monthly_release

publish_monthly_release(
env_vars=env_vars,
backup_path=backup_path,
month_year=timestamp,
full_dump_path=full_dump_path if os.path.exists(full_dump_path) else None,
db_params=db_params,
)
except ImportError as exc:
print(f"Zenodo publish skipped (publish_zenodo module unavailable): {exc}")

if __name__ == "__main__":
main()
Loading
Loading