zennewpy
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.0%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: man74cio
- License: mit
- Language: Python
- Default Branch: main
- Size: 17.6 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
ZennewPy
ZennewPy is a Python package for interacting with the Zenodo API, allowing users to manage depositions, metadata, and files on Zenodo.
Features
- Retrieve all depositions with full metadata
- Find community identifiers
- Set and unset depositions
- Create, delete, and manage depositions
- Upload and update files
- Publish depositions
- Create new versions of existing depositions
- Modify metadata for both published and unpublished depositions
Installation
bash
pip install zennewpy
Usage
- Create a Zenodo access token by first logging into your account and clicking on your username in the top right corner. Navigate to "Applications" and then "+new token" under "Personal access tokens". Keep this window open while you proceed to step 2 because the token is only displayed once. Note that Sandbox.zenodo is used for testing and zenodo for production. If you want to use both, create for each a token as desribed above.
- Store the token in
~/.zenodo_tokenusing the following command.
```sh
zenodo token
{ echo 'ACCESSTOKEN: youraccesstokenhere' } > ~/.zenodo_token
sandbox.zenodo token
{ echo 'ACCESSTOKEN-sandbox: youraccesstokenhere' } > ~/.zenodo_token ```
```python import zennewpy
Initialize the client
client = zennewpy.Client(sandbox=True)
Set up your Zenodo token
Ensure you have a ~/.zenodotoken file with your ACCESSTOKEN
Create a new deposition
depositionid = client.createnew_deposition()
Set the client to work with this deposition
client.setdeposition(depositionid)
Add metadata
metadata = { "title": "My Research Data", "description": "This dataset contains...", "uploadtype": "dataset" } client.createmetadata(metadata)
Upload a file
client.upload_file("path/to/your/file.csv")
Publish the deposition
client.publish_deposition() ```
Main Classes and Methods
Client
The main class for interacting with Zenodo.
__init__(self, title=None, bucket=None, deposition_id=None, sandbox=None, token=None)get_all_depositions()set_deposition(id_value)create_new_deposition()delete_deposition(deposition_id=None)create_metadata(metadata, **kwargs)upload_file(file_path, remote_filename=None, file_id=None)publish_deposition()create_new_version()modify_metadata(metadata_updates, **kwargs)
Authentication
ZennewPy uses a token-based authentication system. Store your Zenodo API token in a ~/.zenodo_token file.
Contributing
Contributions to ZennewPy are welcome. Please ensure you follow the coding style and add unit tests for any new features.
Acknowledgments
ZennewPy is a fork of zenodopy, an original project by L. Gloege. This package builds upon the foundational work of the original zenodopy library, extending and modifying its functionality while maintaining the core API interaction principles.
License
ZennewPy is distributed under the MIT License, which allows for free use, modification, and distribution of the software, in line with the original zenodopy project's licensing. Key Acknowledgment: This project respectfully derives from and credits the original zenodopy library, preserving its open-source spirit and collaborative approach.
Citation
If you use ZennewPy in your research, please cite it using the information provided in our CITATION.cff file. You can find this file in the root directory of our GitHub repository.
Owner
- Name: Marco Mancini
- Login: man74cio
- Kind: user
- Location: France
- Company: cnrs
- Repositories: 1
- Profile: https://github.com/man74cio
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: zennewpy
message: Tool to manipulate Zenodo API
type: software
authors:
- given-names: Marco
family-names: Mancini
name-particle: Marco
email: marco.mancini@obspm.fr
affiliation: Observatoire de Paris/ CNRS
orcid: 'https://orcid.org/0000-0003-2348-1890'
repository-code: 'https://gitlab.obspm.fr/mmancini/zennewpy'
abstract: Client to work with Zenodo API
identifiers:
- type: doi
value:
license: MIT
version: 0.2.0
date-released: '2024-12-18'
GitHub Events
Total
- Release event: 1
- Push event: 3
- Create event: 3
Last Year
- Release event: 1
- Push event: 3
- Create event: 3
Dependencies
- requests *
- tabulate *